Merge branch 'master' of https://github.com/Aravind99/CountryCodePicker into Aravind99-master

This commit is contained in:
Salvatore Giordano
2018-04-05 09:33:16 +02:00

View File

@@ -44,10 +44,10 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
@override @override
initState() { initState() {
if (widget.initialSelection != null) { if (widget.initialSelection != null) {
selectedItem = elements.firstWhere((e) { selectedItem = elements.firstWhere(
e.code.toUpperCase() == widget.initialSelection.toUpperCase() || (e) => (e.code.toUpperCase() == widget.initialSelection.toUpperCase()) ||
e.dialCode == widget.initialSelection.toString(); (e.dialCode == widget.initialSelection.toString()),
}, orElse: () => elements[0]); orElse: () => elements[0]);
} else { } else {
selectedItem = elements[0]; selectedItem = elements[0];
} }