akbarpulatov / flutter_awesome_select

Forked from https://github.com/davigmacode/flutter_smart_select, updated legacy code, migrated to null safety and more. AwesomeSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
https://pub.dev/packages/awesome_select
MIT License
48 stars 56 forks source link

Overflow on no item found on search #44

Open tbsmanish opened 2 years ago

tbsmanish commented 2 years ago

Please help me to resolve this issue. can I customize this error layout or something else that can help me out of this issue Screenshot_5 .

tbsmanish commented 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,
                            ),
                          ],
                        ),
                      );
                    },
                  ),
                ),