Merge branch 'master' of github.com:imtoori/CountryCodePicker

This commit is contained in:
Salvatore Giordano
2021-06-19 12:16:44 +02:00
2 changed files with 8 additions and 3 deletions

View File

@@ -80,6 +80,10 @@ class CountryCodePicker extends StatefulWidget {
/// [BoxDecoration] for the flag image
final Decoration? flagDecoration;
/// An optional argument for inject list of countries
/// with customized codes.
final List<Map<String, dynamic>> countryList;
CountryCodePicker({
this.onChanged,
this.onInit,
@@ -113,12 +117,13 @@ class CountryCodePicker extends StatefulWidget {
this.dialogSize,
this.dialogBackgroundColor,
this.closeIcon = const Icon(Icons.close),
this.countryList = codes,
Key? key,
}) : super(key: key);
@override
State<StatefulWidget> createState() {
List<Map> jsonList = codes;
List<Map> jsonList = countryList;
List<CountryCode> elements = jsonList
.map((json) => CountryCode.fromJson(json as Map<String, dynamic>))

View File

@@ -1,4 +1,4 @@
List<Map<String, String>> codes = [
const List<Map<String, String>> codes = [
{
"name": "افغانستان",
"code": "AF",
@@ -770,7 +770,7 @@ List<Map<String, String>> codes = [
"dial_code": "+674",
},
{
"name": "",
"name": "ेपा",
"code": "NP",
"dial_code": "+977",
},