0.1.0
This commit is contained in:
@@ -5,3 +5,7 @@ Initial release
|
|||||||
## 0.0.2
|
## 0.0.2
|
||||||
|
|
||||||
Add favorite countries option.
|
Add favorite countries option.
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
Removed flags in iOS because they show up weirdly.
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
class CElement {
|
class CElement {
|
||||||
String name;
|
String name;
|
||||||
String flag;
|
String flag;
|
||||||
@@ -8,10 +10,10 @@ class CElement {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
return "$flag $dialCode";
|
return defaultTargetPlatform == TargetPlatform.android ? "$flag $dialCode" : dialCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
String toLongString() {
|
String toLongString() {
|
||||||
return "$flag $dialCode $name";
|
return defaultTargetPlatform == TargetPlatform.android ? "$flag $dialCode $name" : "$dialCode $name";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,9 +8,9 @@ import 'package:country_code_picker/celement.dart';
|
|||||||
class CountryCodePicker extends StatefulWidget {
|
class CountryCodePicker extends StatefulWidget {
|
||||||
final Function(String) onChanged;
|
final Function(String) onChanged;
|
||||||
final String initialSelection;
|
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
|
@override
|
||||||
State<StatefulWidget> createState() {
|
State<StatefulWidget> createState() {
|
||||||
@@ -53,7 +53,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
|
|
||||||
favoriteElements = elements
|
favoriteElements = elements
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
widget.favorites.firstWhere((f) => e.code == f.toUpperCase(),
|
widget.favorite.firstWhere((f) => e.code == f.toUpperCase(),
|
||||||
orElse: () => null) !=
|
orElse: () => null) !=
|
||||||
null)
|
null)
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: country_code_picker
|
name: country_code_picker
|
||||||
description: A flutter package for showing a country code selector.
|
description: A flutter package for showing a country code selector.
|
||||||
version: 0.0.2
|
version: 0.1.0
|
||||||
author: Salvatore-Giordano <salvatoregiordanoo@gmail.com>
|
author: Salvatore-Giordano <salvatoregiordanoo@gmail.com>
|
||||||
homepage: https://github.com/Salvatore-Giordano/CountryCodePicker
|
homepage: https://github.com/Salvatore-Giordano/CountryCodePicker
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user