This commit is contained in:
Salvatore Giordano
2018-04-02 18:07:58 +02:00
parent b2e6e84bc2
commit b952054422
4 changed files with 13 additions and 7 deletions

View File

@@ -4,4 +4,8 @@ Initial release
## 0.0.2
Add favorite countries option.
Add favorite countries option.
## 0.1.0
Removed flags in iOS because they show up weirdly.

View File

@@ -1,3 +1,5 @@
import 'package:flutter/foundation.dart';
class CElement {
String name;
String flag;
@@ -8,10 +10,10 @@ class CElement {
@override
String toString() {
return "$flag $dialCode";
return defaultTargetPlatform == TargetPlatform.android ? "$flag $dialCode" : dialCode;
}
String toLongString() {
return "$flag $dialCode $name";
return defaultTargetPlatform == TargetPlatform.android ? "$flag $dialCode $name" : "$dialCode $name";
}
}

View File

@@ -8,9 +8,9 @@ import 'package:country_code_picker/celement.dart';
class CountryCodePicker extends StatefulWidget {
final Function(String) onChanged;
final String initialSelection;
final List<String> favorites;
final List<String> favorite;
CountryCodePicker({this.onChanged, this.initialSelection, this.favorites});
CountryCodePicker({this.onChanged, this.initialSelection, this.favorite});
@override
State<StatefulWidget> createState() {
@@ -53,7 +53,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
favoriteElements = elements
.where((e) =>
widget.favorites.firstWhere((f) => e.code == f.toUpperCase(),
widget.favorite.firstWhere((f) => e.code == f.toUpperCase(),
orElse: () => null) !=
null)
.toList();

View File

@@ -1,6 +1,6 @@
name: country_code_picker
description: A flutter package for showing a country code selector.
version: 0.0.2
version: 0.1.0
author: Salvatore-Giordano <salvatoregiordanoo@gmail.com>
homepage: https://github.com/Salvatore-Giordano/CountryCodePicker