|
|
|
|
@ -133,41 +133,33 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
itemBuilder: (cxt, index) {
|
|
|
|
|
bool isDisabledItem = widget.disableItem != null && widget.disableItem?.identifier == filteredList![index].identifier;
|
|
|
|
|
return Theme(
|
|
|
|
|
data: Theme.of(context).copyWith(
|
|
|
|
|
checkboxTheme: CheckboxThemeData(
|
|
|
|
|
fillColor: MaterialStateColor.resolveWith((states) {
|
|
|
|
|
if (states.contains(MaterialState.selected)) {
|
|
|
|
|
return AppColor.iconColor(context); // Active color
|
|
|
|
|
}
|
|
|
|
|
return Colors.grey; // Inactive color
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: CheckboxListTile(
|
|
|
|
|
value: checkItContains(filteredList![index]),
|
|
|
|
|
dense: true,
|
|
|
|
|
controlAffinity: ListTileControlAffinity.leading,
|
|
|
|
|
activeColor: AppColor.iconColor(context),
|
|
|
|
|
contentPadding: const EdgeInsets.only(left: 16, right: 16),
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
// if (checkItContains(filteredList![index]) ?? false) {
|
|
|
|
|
// _selectedValue.remove(filteredList![index]);
|
|
|
|
|
// } else {
|
|
|
|
|
// _selectedValue.add(filteredList![index]);
|
|
|
|
|
// }
|
|
|
|
|
if (value == true) {
|
|
|
|
|
_selectedValue.add(filteredList![index]);
|
|
|
|
|
} else if (value == false) {
|
|
|
|
|
_selectedValue.remove(filteredList![index]);
|
|
|
|
|
}
|
|
|
|
|
searchFocusNode.unfocus();
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
title: Text(
|
|
|
|
|
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
|
|
|
),
|
|
|
|
|
return CheckboxListTile(
|
|
|
|
|
value: checkItContains(filteredList![index]),
|
|
|
|
|
dense: true,
|
|
|
|
|
controlAffinity: ListTileControlAffinity.leading,
|
|
|
|
|
activeColor: AppColor.primary10,
|
|
|
|
|
checkColor: AppColor.white10,
|
|
|
|
|
// fillColor: WidgetStateProperty.all(AppColor.background(context)),
|
|
|
|
|
contentPadding: const EdgeInsets.only(left: 16, right: 16),
|
|
|
|
|
// activeColor: AppColor.blueStatus(context),
|
|
|
|
|
side: BorderSide(color: AppColor.icon2Color(context).withValues(alpha: .3), width: 1.0),
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
// if (checkItContains(filteredList![index]) ?? false) {
|
|
|
|
|
// _selectedValue.remove(filteredList![index]);
|
|
|
|
|
// } else {
|
|
|
|
|
// _selectedValue.add(filteredList![index]);
|
|
|
|
|
// }
|
|
|
|
|
if (value == true) {
|
|
|
|
|
_selectedValue.add(filteredList![index]);
|
|
|
|
|
} else if (value == false) {
|
|
|
|
|
_selectedValue.remove(filteredList![index]);
|
|
|
|
|
}
|
|
|
|
|
searchFocusNode.unfocus();
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
title: Text(
|
|
|
|
|
widget.builderString(filteredList![index]).cleanupWhitespace.capitalizeFirstOfEach ?? "",
|
|
|
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
|