@@ -10,46 +10,53 @@ class FeaturesChoicesDivider extends StatefulWidget {
1010class _FeaturesChoicesDividerState extends State <FeaturesChoicesDivider > {
1111
1212 String _car = '' ;
13- List _smartphone = [];
13+ List < String > _smartphone = [];
1414
1515 @override
1616 Widget build (BuildContext context) {
1717 return Column (
1818 children: < Widget > [
1919 Container (height: 7 ),
20- SmartSelect (
20+ SmartSelect < String >. single (
2121 title: 'Car' ,
2222 placeholder: 'Choose one' ,
2323 isTwoLine: true ,
2424 value: _car,
25- option: SmartSelectOptionConfig (
26- options.cars,
27- groupBy: 'body' ,
25+ options: SmartSelectOption .listFrom <Map , String >(
26+ source: options.cars,
27+ value: (index, item) => item['value' ],
28+ title: (index, item) => item['title' ],
29+ group: (index, item) => item['body' ],
30+ ),
31+ choiceConfig: SmartSelectChoiceConfig (
32+ isGrouped: true ,
33+ useDivider: true
2834 ),
29- choice: SmartSelectChoiceConfig (useDivider: true ),
3035 leading: CircleAvatar (
3136 backgroundImage: NetworkImage ('https://source.unsplash.com/yeVtxxPxzbw/100x100' ),
3237 ),
3338 onChange: (val) => setState (() => _car = val),
3439 ),
3540 Divider (indent: 20 ),
36- SmartSelect (
41+ SmartSelect < String >. multiple (
3742 title: 'Smartphones' ,
3843 placeholder: 'Choose one' ,
3944 value: _smartphone,
4045 isTwoLine: true ,
41- isMultiChoice: true ,
42- option: SmartSelectOptionConfig (
43- options.smartphones,
44- value: 'id' ,
45- title: 'name' ,
46- groupBy: 'brand' ,
46+ options: SmartSelectOption .listFrom <Map , String >(
47+ source: options.smartphones,
48+ value: (index, item) => item['id' ],
49+ title: (index, item) => item['name' ],
50+ group: (index, item) => item['brand' ],
51+ ),
52+ modalType: SmartSelectModalType .bottomSheet,
53+ modalConfig: SmartSelectModalConfig (
54+ useFilter: true ,
4755 ),
48- modal : SmartSelectModalConfig (
49- type : SmartSelectModalType .bottomSheet ,
50- useFilter : true
56+ choiceConfig : SmartSelectChoiceConfig (
57+ isGrouped : true ,
58+ useDivider : true ,
5159 ),
52- choice: SmartSelectChoiceConfig (useDivider: true ),
5360 leading: CircleAvatar (
5461 backgroundImage: NetworkImage ('https://source.unsplash.com/xsGxhtAsfSA/100x100' ),
5562 ),
0 commit comments