polish latest pr
This commit is contained in:
@@ -80,9 +80,9 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
/// [BoxDecoration] for the flag image
|
/// [BoxDecoration] for the flag image
|
||||||
final Decoration? flagDecoration;
|
final Decoration? flagDecoration;
|
||||||
|
|
||||||
/// An optional argument for inject list of countries
|
/// An optional argument for injecting a list of countries
|
||||||
/// with customized codes.
|
/// with customized codes.
|
||||||
final List<Map<String, dynamic>> countryList;
|
final List<Map<String, String>> countryList;
|
||||||
|
|
||||||
CountryCodePicker({
|
CountryCodePicker({
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
@@ -123,11 +123,10 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
List<Map> jsonList = countryList;
|
List<Map<String, String>> jsonList = countryList;
|
||||||
|
|
||||||
List<CountryCode> elements = jsonList
|
List<CountryCode> elements =
|
||||||
.map((json) => CountryCode.fromJson(json as Map<String, dynamic>))
|
jsonList.map((json) => CountryCode.fromJson(json)).toList();
|
||||||
.toList();
|
|
||||||
|
|
||||||
if (comparator != null) {
|
if (comparator != null) {
|
||||||
elements.sort(comparator);
|
elements.sort(comparator);
|
||||||
|
|||||||
Reference in New Issue
Block a user