-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
When scrolling down multiple time while et the end of the dropdown items, that make the app crash.
#my code to reproduce :
final gradeList = [
'5a', '5b', '5c',
'6a', '6a+', '6b',
'6b+', '6c', '6c+',
'7a', '7a+', '7b',
'7b+', '7c', '7c+',
'8a', '8a+', '8b',
'8b+', '8c', '8c+',
'9a', '9a+', '9b',
'9b+', '9c', '9c+',
];
final controller = DropdownController<String>();
List<CoolDropdownItem<String>> dropdownItems = [];
CoolDropdownItem<String> defaultItemSelected = CoolDropdownItem<String>(
label: "??",
value: "??",
);
for (var i = 0; i < gradeList .length; i++) {
dropdownItems.add(CoolDropdownItem<String>(
label: gradeList [i],
value: gradeList [i],
isSelected: true,
)
);
}
CoolDropdown<String>(
controller: controller,
dropdownList: dropdownItems,
defaultItem: defaultItemSelected,
onChange: (value) async {
if (controller.isError) {
await controller.resetError();
}
controller.close();
},
onOpen: (value) {},
resultOptions: ResultOptions(
padding: EdgeInsets.symmetric(horizontal: 10),
width: width,
icon: const SizedBox(
width: 10,
height: 10,
child: CustomPaint(
painter: DropdownArrowPainter(),
),
),
render: ResultRender.all,
isMarquee: true,
),
dropdownOptions: DropdownOptions(
top: 20,
height: 400,
gap: DropdownGap.all(5),
borderSide: BorderSide(width: 1.5, color: AppColors().mainColor()),
padding: EdgeInsets.symmetric(horizontal: 10),
align: DropdownAlign.left,
animationType: DropdownAnimationType.size),
dropdownItemOptions: DropdownItemOptions(
isMarquee: true,
mainAxisAlignment: MainAxisAlignment.center,
render: DropdownItemRender.all,
height: 50,
textStyle: TextStyle(fontSize: 18, color: AppColors().fontColor()),
selectedTextStyle: TextStyle(fontSize: 21, color: AppColors().fontColor(),fontWeight: FontWeight.w600),
selectedBoxDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: AppColors().secondFadedColor1(),
),
),
);
Metadata
Metadata
Assignees
Labels
No labels