artflutter / 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/flutter_awesome_select
MIT License
15 stars 33 forks source link

Can I trigger the chips bottom sheet with custom widget? #30

Open xplatsolutions opened 1 year ago

xplatsolutions commented 1 year ago

I am trying to just have a readonly TextField (or a button) where it will trigger the bottom sheet, is it possible with this package?

What I tried so far.

SmartSelect<String>.single(
                  choiceType: S2ChoiceType.chips,
                  choiceLayout: S2ChoiceLayout.wrap,
                  modalType: S2ModalType.bottomSheet,
                  modalHeader: false,
                  tileBuilder: (context, value) {
                    return FillProfileTextField(
                      labelText: 'gender',
                      // How to trigger the bottom sheet on TextField focus
                    );
                  },
                  title: 'gender',
                  selectedValue: 'non_binary',
                  choiceItems: options,
                  onChange: (state) => print(state.value)),