diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 1d56969..c979e12 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -80,9 +80,9 @@ class CountryCodePicker extends StatefulWidget { /// [BoxDecoration] for the flag image final Decoration? flagDecoration; - /// An optional argument for inject list of countries + /// An optional argument for injecting a list of countries /// with customized codes. - final List> countryList; + final List> countryList; CountryCodePicker({ this.onChanged, @@ -123,11 +123,10 @@ class CountryCodePicker extends StatefulWidget { @override State createState() { - List jsonList = countryList; + List> jsonList = countryList; - List elements = jsonList - .map((json) => CountryCode.fromJson(json as Map)) - .toList(); + List elements = + jsonList.map((json) => CountryCode.fromJson(json)).toList(); if (comparator != null) { elements.sort(comparator);