@@ -22,7 +22,7 @@ class MyApp extends StatelessWidget {
22
22
GlobalMaterialLocalizations .delegate,
23
23
GlobalWidgetsLocalizations .delegate,
24
24
],
25
- supportedLocales: FormBuilderLocalizations .delegate.supportedLocales ,
25
+ supportedLocales: const [ Locale ( 'en' )] ,
26
26
home: const MyHomePage (),
27
27
);
28
28
}
@@ -72,16 +72,25 @@ class _MyHomePageState extends State<MyHomePage> {
72
72
),
73
73
),
74
74
FormBuilderSearchableDropdown <String >(
75
- popupProps: const PopupProps .menu (showSearchBox: true ),
75
+ popupProps: PopupProps .dialog (
76
+ showSelectedItems: true ,
77
+ showSearchBox: true ,
78
+ isFilterOnline: true ,
79
+ ),
80
+ autoValidateMode: AutovalidateMode .onUserInteraction,
76
81
dropdownSearchDecoration: const InputDecoration (
77
82
hintText: 'Search' ,
78
83
labelText: 'Search' ,
79
84
),
80
85
name: 'searchable_dropdown_offline' ,
81
86
items: allCountries,
87
+ clearButtonProps: ClearButtonProps (icon: Icon (Icons .close)),
82
88
onChanged: _onChanged,
83
89
decoration: const InputDecoration (
84
90
labelText: 'Searchable Dropdown Offline' ),
91
+ validator: FormBuilderValidators .compose ([
92
+ FormBuilderValidators .required (),
93
+ ]),
85
94
filterFn: (country, filter) =>
86
95
country.toLowerCase ().contains (filter.toLowerCase ()),
87
96
),
0 commit comments