Update selection_dialog.dart

This commit is contained in:
vlfr1997
2020-09-24 18:36:42 -03:00
committed by GitHub
parent 4a03708b22
commit f13b6fae05

View File

@@ -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<CountryCode> 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<SelectionDialog> {
IconButton(
padding: const EdgeInsets.all(0),
iconSize: 20,
icon: Icon(
Icons.close,
),
icon: closeIcon,
onPressed: () => Navigator.pop(context),
),
if (!widget.hideSearch)