buildListViewSingleSelectBuilder function
Widget
buildListViewSingleSelectBuilder({
- required BuildContext context,
- required List<
CustomDropDownModel> listOfValues, - CustomDropDownModel? selectedValue,
- ScrollController? scrollController,
- bool isPaginationLoader = false,
- required dynamic callback(),
Common widget for list view builder Single select
Implementation
Widget buildListViewSingleSelectBuilder(
{required BuildContext context,
required List<CustomDropDownModel> listOfValues,
CustomDropDownModel? selectedValue,
ScrollController? scrollController,
bool isPaginationLoader = false,
required Function(CustomDropDownModel) callback}) {
return SizedBox(
height: CommonConfigurationDropDown.of(context).dropdownHeight,
child: ListView.builder(
controller: scrollController,
itemCount: listOfValues.length,
shrinkWrap: true,
itemBuilder: (context, index) {
CustomDropDownModel model = listOfValues[index];
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
buildRowItemForList(
context: context,
model: model,
selectedModel: selectedValue,
callback: (p0) {
callback(p0);
}),
if (isPaginationLoader && ((listOfValues.length - 1) == index))
Material(
child: Center(
key: UniqueKey(),
child: const CircularProgressIndicator()))
],
);
},
),
);
}