Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #150 from HandCash/master
Browse files Browse the repository at this point in the history
Fest/inect-list-countries
  • Loading branch information
imtoori authored Jun 19, 2021
2 parents 6fa320c + d3bf5f4 commit a3c8b01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/country_code_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>))
Expand Down
2 changes: 1 addition & 1 deletion lib/country_codes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
List<Map<String, String>> codes = [
const List<Map<String, String>> codes = [
{
"name": "افغانستان",
"code": "AF",
Expand Down

0 comments on commit a3c8b01

Please sign in to comment.