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] 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 e7d8e68..e73699d 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)