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

tileBuilder error in multiple #6

Closed Saulmarti closed 2 years ago

Saulmarti commented 3 years ago

ERROR

type '(BuildContext, S2MultiState) => S2Tile' is not a subtype of type '((BuildContext, S2MultiState<String?>) => Widget)?'

SmartSelect<String>.multiple( title: translate('FILTER.genres'), selectedValue: widget.filters.generes, onChange: (selected) { setState(() => widget.filters.generes = selected!.value); }, choiceItems: options, placeholder: translate("FILTER.select_more"), modalType: S2ModalType.bottomSheet, tileBuilder: (context, state) { return S2Tile.fromState( state, isTwoLine: true, ); }, );

vasilich6107 commented 3 years ago

@Saulmarti this is due to the issues with null safety migration

Eider3a commented 3 years ago

Hi guys, I have the same issue, Have you found a solution or maybe a workaround, thanks a lot if you provide some information regarding the solution to this issue. Thanks a lot.

journeystamps commented 3 years ago

Its also with single and onChange Method.

Error: Expected a value of type '((S2SingleSelected<String?>) => void)?', but got one of type '(S2SingleSelected) => void'

SRomanova commented 3 years ago

Hi, You may try to make it SmartSelect<String?>.multiple(..) instead of SmartSelect.multiple(..) and adjust content. It works by me.

DonWasyl commented 2 years ago

Yup SmartSelect<String?>.multiple(..) instead of SmartSelect.multiple<String>(..) helps. But it doesn't resolve problem.

I compared the code from the old package and this one. I don't know why @akbarpulatov did you make these changes but I revert them and now is ok.

akbarpulatov commented 2 years ago

Issue is fixed on 834321de79dbb2b61befcfa8ddd97c90d2569c55.