select all option added.

main_production_RSG
Sikander Saleem 1 month ago
parent e08f845cce
commit 84e36c9d70

@ -59,6 +59,7 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
@override
Widget build(BuildContext context) {
bool isAllSelected = _selectedValue.isNotEmpty && (widget.items?.length ?? 0) == _selectedValue.length;
return Scaffold(
appBar: AppBar(
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)),
@ -133,7 +134,26 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
// contentPadding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
// ),
// ),
8.height,
CheckboxListTile(
value: isAllSelected,
dense: true,
controlAffinity: ListTileControlAffinity.leading,
activeColor: AppColor.primary10,
checkColor: AppColor.white10,
contentPadding: const EdgeInsets.only(left: 16, right: 16),
side: BorderSide(color: AppColor.icon2Color(context).withValues(alpha: .3), width: 1.0),
onChanged: (val) {
if (val == null) return;
if (val) {
_selectedValue = List<T>.from(widget.items ?? []);
} else {
_selectedValue.clear();
}
setState(() {});
},
title: Text(isAllSelected ? "UnSelect All" : "Select All", style: Theme.of(context).textTheme.bodyLarge),
),
const Divider().defaultStyle(context),
Expanded(
child: ListView.builder(
itemCount: filteredList?.length,

Loading…
Cancel
Save