From b952054422b74ce08d8ec4713c7c5b37fde417ef Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Mon, 2 Apr 2018 18:07:58 +0200 Subject: [PATCH] 0.1.0 --- CHANGELOG.md | 6 +++++- lib/celement.dart | 6 ++++-- lib/country_code_picker.dart | 6 +++--- pubspec.yaml | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce24fa1..900ee72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,4 +4,8 @@ Initial release ## 0.0.2 -Add favorite countries option. \ No newline at end of file +Add favorite countries option. + +## 0.1.0 + +Removed flags in iOS because they show up weirdly. \ No newline at end of file diff --git a/lib/celement.dart b/lib/celement.dart index 9740b93..2d11d9f 100644 --- a/lib/celement.dart +++ b/lib/celement.dart @@ -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"; } } \ No newline at end of file diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 33a7624..9bac94d 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -8,9 +8,9 @@ import 'package:country_code_picker/celement.dart'; class CountryCodePicker extends StatefulWidget { final Function(String) onChanged; final String initialSelection; - final List favorites; + final List favorite; - CountryCodePicker({this.onChanged, this.initialSelection, this.favorites}); + CountryCodePicker({this.onChanged, this.initialSelection, this.favorite}); @override State createState() { @@ -53,7 +53,7 @@ class _CountryCodePickerState extends State { favoriteElements = elements .where((e) => - widget.favorites.firstWhere((f) => e.code == f.toUpperCase(), + widget.favorite.firstWhere((f) => e.code == f.toUpperCase(), orElse: () => null) != null) .toList(); diff --git a/pubspec.yaml b/pubspec.yaml index ac83959..0d50db7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 homepage: https://github.com/Salvatore-Giordano/CountryCodePicker