From f13b6fae05858490ae647b4b83da48c78cf293d7 Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 18:36:42 -0300 Subject: [PATCH 1/6] Update selection_dialog.dart --- lib/selection_dialog.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index e7d8e681..e73699d9 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -13,6 +13,7 @@ class SelectionDialog extends StatefulWidget { final double flagWidth; final Size size; final bool hideSearch; + final Icon closeIcon; /// elements passed as favorite final List favoriteElements; @@ -30,9 +31,11 @@ class SelectionDialog extends StatefulWidget { this.flagWidth = 32, this.size, this.hideSearch = false, + this.closeIcon = closeIcon == null ? Icon(Icons.close) : closeIcon, }) : assert(searchDecoration != null, 'searchDecoration must not be null!'), - this.searchDecoration = - searchDecoration.copyWith(prefixIcon: Icon(Icons.search)), + this.searchDecoration = searchDecoration.prefixIcon == null + ? searchDecoration.copyWith(prefixIcon: Icon(Icons.search)) + : searchDecoration, super(key: key); @override @@ -72,9 +75,7 @@ class _SelectionDialogState extends State { IconButton( padding: const EdgeInsets.all(0), iconSize: 20, - icon: Icon( - Icons.close, - ), + icon: closeIcon, onPressed: () => Navigator.pop(context), ), if (!widget.hideSearch) From ef3bb23d3e5ed1e1b8d8577027cc2e0a770637c4 Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 18:40:19 -0300 Subject: [PATCH 2/6] Update country_code_picker.dart --- lib/country_code_picker.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 1fa96723..6f9498de 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -23,6 +23,7 @@ class CountryCodePicker extends StatefulWidget { final Function(CountryCode) builder; final bool enabled; final TextOverflow textOverflow; + final Icon closeIcon; /// the size of the selection dialog final Size dialogSize; @@ -84,6 +85,7 @@ class CountryCodePicker extends StatefulWidget { this.countryFilter, this.hideSearch = false, this.dialogSize, + this.closeIcon = Icon(Icons.close), Key key, }) : super(key: key); @@ -245,6 +247,7 @@ class CountryCodePickerState extends State { flagWidth: widget.flagWidth, size: widget.dialogSize, hideSearch: widget.hideSearch, + closeIcon: widget.closeIcon, ), ).then((e) { if (e != null) { From f1aa08bdd00108690c8c7d3cc3d664ee8d82f5fe Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 18:41:00 -0300 Subject: [PATCH 3/6] Update selection_dialog.dart --- lib/selection_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index e73699d9..baf6e880 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -31,7 +31,7 @@ class SelectionDialog extends StatefulWidget { this.flagWidth = 32, this.size, this.hideSearch = false, - this.closeIcon = closeIcon == null ? Icon(Icons.close) : closeIcon, + this.closeIcon = closeIcon, }) : assert(searchDecoration != null, 'searchDecoration must not be null!'), this.searchDecoration = searchDecoration.prefixIcon == null ? searchDecoration.copyWith(prefixIcon: Icon(Icons.search)) From 575e0a880e0e33248b21bc6a645808d7af7683da Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 18:47:11 -0300 Subject: [PATCH 4/6] Update selection_dialog.dart --- lib/selection_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index baf6e880..03b29941 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -75,7 +75,7 @@ class _SelectionDialogState extends State { IconButton( padding: const EdgeInsets.all(0), iconSize: 20, - icon: closeIcon, + icon: widget.closeIcon, onPressed: () => Navigator.pop(context), ), if (!widget.hideSearch) From 300f86c9b8cebe37c2505ad4eba1a5c23c3b2704 Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 18:49:25 -0300 Subject: [PATCH 5/6] Update country_code_picker.dart --- lib/country_code_picker.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 6f9498de..17ad5251 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -85,7 +85,7 @@ class CountryCodePicker extends StatefulWidget { this.countryFilter, this.hideSearch = false, this.dialogSize, - this.closeIcon = Icon(Icons.close), + this.closeIcon = const Icon(Icons.close), Key key, }) : super(key: key); From 51f50b61d8a7c35dd991f1b9055a3901c6cba7fa Mon Sep 17 00:00:00 2001 From: vlfr1997 <49419833+vlfr1997@users.noreply.github.com> Date: Thu, 24 Sep 2020 19:00:02 -0300 Subject: [PATCH 6/6] Update selection_dialog.dart --- lib/selection_dialog.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index 03b29941..d08bdbaa 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -31,7 +31,7 @@ class SelectionDialog extends StatefulWidget { this.flagWidth = 32, this.size, this.hideSearch = false, - this.closeIcon = closeIcon, + this.closeIcon, }) : assert(searchDecoration != null, 'searchDecoration must not be null!'), this.searchDecoration = searchDecoration.prefixIcon == null ? searchDecoration.copyWith(prefixIcon: Icon(Icons.search))