File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ class CountryCodePicker extends StatefulWidget {
80
80
/// [BoxDecoration] for the flag image
81
81
final Decoration ? flagDecoration;
82
82
83
+ /// An optional argument for inject list of countries
84
+ /// with customized codes.
85
+ final List <Map <String , dynamic >> countryList;
86
+
83
87
CountryCodePicker ({
84
88
this .onChanged,
85
89
this .onInit,
@@ -113,12 +117,13 @@ class CountryCodePicker extends StatefulWidget {
113
117
this .dialogSize,
114
118
this .dialogBackgroundColor,
115
119
this .closeIcon = const Icon (Icons .close),
120
+ this .countryList = codes,
116
121
Key ? key,
117
122
}) : super (key: key);
118
123
119
124
@override
120
125
State <StatefulWidget > createState () {
121
- List <Map > jsonList = codes ;
126
+ List <Map > jsonList = countryList ;
122
127
123
128
List <CountryCode > elements = jsonList
124
129
.map ((json) => CountryCode .fromJson (json as Map <String , dynamic >))
Original file line number Diff line number Diff line change 1
- List <Map <String , String >> codes = [
1
+ const List <Map <String , String >> codes = [
2
2
{
3
3
"name" : "افغانستان" ,
4
4
"code" : "AF" ,
You can’t perform that action at this time.
0 commit comments