From cf3c953bde4b0c82b89bb24bece063dee5548e58 Mon Sep 17 00:00:00 2001 From: ARAVIND99 Date: Thu, 5 Apr 2018 12:46:31 +0530 Subject: [PATCH] * initialSelection can be one of code OR dial_code --- lib/country_code_picker.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 6e48144..68f203b 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -45,10 +45,8 @@ class _CountryCodePickerState extends State { initState() { if (widget.initialSelection != null) { selectedItem = elements.firstWhere( - (e) { - e.code.toUpperCase() == widget.initialSelection.toUpperCase() || - e.dialCode == widget.initialSelection.toString(); - }, + (e) => (e.code.toUpperCase() == widget.initialSelection.toUpperCase()) || + (e.dialCode == widget.initialSelection.toString()), orElse: () => elements[0]); } else { selectedItem = elements[0];