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
initState() {
if (widget.initialSelection != null) {
selectedItem = elements.firstWhere((e) {
e.code.toUpperCase() == widget.initialSelection.toUpperCase() ||
e.dialCode == widget.initialSelection.toString();
}, orElse: () => elements[0]);
selectedItem = elements.firstWhere(
(e) => (e.code.toUpperCase() == widget.initialSelection.toUpperCase()) ||
(e.dialCode == widget.initialSelection.toString()),
orElse: () => elements[0]);
} else {
selectedItem = elements[0];
}