You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI, thanks for good package.
I have some problems here.
I use a ListView.builder to render a three List<S2Choice> , and it's worked nice.
Now I need to add the new S2Choice in List. It has been added in list when I print List.
But the page not refresh the view When I use setState like this .
And I saw @absar solved this on #12 .
I follow his commit modify s2_state.dart like this ,
after i do some tests,
thanks for @absar code, I found the oldWidget.choiceItems is show updated items when I add a S2Choice
in s2_state.dart
void didUpdateWidget(SmartSelect<T> oldWidget) {
super.didUpdateWidget(oldWidget);
print("oldWidget is ${oldWidget.choiceItems}");
print("Widget is ${widget.choiceItems}");
}
It will print 4 items when I add one to a three items list.
oldWidget is [S2Choice#f52ad, S2Choice#8de44, S2Choice#192d6, S2Choice#5ccc1]
Widget is [S2Choice#f52ad, S2Choice#8de44, S2Choice#192d6, S2Choice#5ccc1]
I don't know why.
for now, my solution is just reload choices directly like this
HI, thanks for good package.
I have some problems here.
I use a ListView.builder to render a three List<S2Choice> , and it's worked nice.
Now I need to add the new S2Choice in List. It has been added in list when I print List.
But the page not refresh the view When I use setState like this .
And I saw @absar solved this on #12 .
I follow his commit modify s2_state.dart like this ,
but still not work.
Does anyone can help me?
here is my code.
flutter version : 3.3.9
The text was updated successfully, but these errors were encountered: