Open tbsmanish opened 2 years ago
I am using multi select here is code of my widget.
Container(
margin: EdgeInsets.only(
top: 20.h,
left: 10.w,
right: 10.w,
),
padding: EdgeInsets.zero,
color: primaryColor.withAlpha(20),
child: SmartSelect<EmployeeModel>.multiple(
title: 'Employees',
selectedValue: selectedEmployees,
onChange: (selected) {
setState(() => selectedEmployees = selected?.value ?? []);
},
choiceItems: listChoiceEmployees,
modalType: S2ModalType.fullPage,
modalFilter: true,
modalHeaderStyle: S2ModalHeaderStyle(
backgroundColor: defaultColor,
textStyle: googlePoppins.copyWith(
fontSize: 18.sp,
color: Colors.white,
fontWeight: FontWeight.w700,
),
),
placeholder: '',
tileBuilder: (context, state) {
return S2Tile.fromState(
state,
padding: EdgeInsets.only(left: 15.w, right: 15.w),
title: Text(
'Select Employee',
style: TextStyle(
color: Color(0xff606264),
),
),
isTwoLine: false,
);
},
// modalActionsBuilder: (context, state) {
// return <Widget>[
// Padding(
// padding: EdgeInsets.only(right: 13.w),
// child: Row(
// children: [
// Text(
// 'Select All Employees',
// style: googlePoppins.copyWith(
// fontSize: 16.sp,
// color: const Color(0xFFABABAB),
// fontWeight: FontWeight.w500,
// ),
// textAlign: TextAlign.center,
// ),
// state.choiceSelectorAll
// ],
// ),
// )
// ];
// },
modalDividerBuilder: (context, state) {
return const Divider(height: 1);
},
modalFilterAuto: true,
modalFilterHint: 'Search Username',
modalFooterBuilder: (context, state) {
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 12.0,
vertical: 7.0,
),
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.only(right: 13.w),
child: Row(
children: [
Text(
'Select All Employees',
style: googlePoppins.copyWith(
fontSize: 16.sp,
color: const Color(0xFFABABAB),
fontWeight: FontWeight.w500,
),
textAlign: TextAlign.center,
),
state.choiceSelectorAll
],
),
),
const Spacer(),
TextButton(
child: const Text('Cancel'),
onPressed: () =>
state.closeModal(confirmed: false),
),
const SizedBox(width: 5),
TextButton(
child:
Text('OK (${state.selection?.length ?? 0})'),
onPressed: (state.selection?.isValid ?? true)
? () => state.closeModal(confirmed: true)
: null,
),
],
),
);
},
),
),
Please help me to resolve this issue. can I customize this error layout or something else that can help me out of this issue .