Closed mrizkynurfajrie closed 4 months ago
Are you looking for valueListenable?
Are you looking for valueListenable?
It's 404 not found. But, is valueListenable can initialize selected item? if you don't mind, can you show me how to use it?
Check examples at https://pub.dev/packages/dropdown_button2/versions/3.0.0-beta.13
Check examples at https://pub.dev/packages/dropdown_button2/versions/3.0.0-beta.13
Pardon me, in that examples, i saw valueListenable function triggered only when onChanged condition, It means i should do select an item first then the values & UI will update. My question is, is it possible dropdown automatically select an item without manually open dropdown button (value initialized when page onInit)
https://pub.dev/packages/dropdown_button2/versions/3.0.0-beta.13
You can pass the initialValue, i.e:
final List<String> items = [
'Item1',
'Item2',
'Item3',
'Item4',
];
final valueListenable = ValueNotifier<String?>('Item1');
Item1
will be initially selected.
https://pub.dev/packages/dropdown_button2/versions/3.0.0-beta.13
You can pass the initialValue, i.e:
final List<String> items = [ 'Item1', 'Item2', 'Item3', 'Item4', ]; final valueListenable = ValueNotifier<String?>('Item1');
Item1
will be initially selected.
Ah I see. Your answer help me a bit, i will try with my condition. Thanks a lot, really appreciate your awesome works!
Is it possible in this package dropdown automatically shows selected item when page initialized. Of course the selected item is based on their items. I've try re-read the documentation, i still didn't found any params who gave me that function (or i just missed?).
Thank you for your great works!