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 double flagWidth;
final Size size; final Size size;
final bool hideSearch; final bool hideSearch;
final Icon closeIcon;
/// elements passed as favorite /// elements passed as favorite
final List<CountryCode> favoriteElements; final List<CountryCode> favoriteElements;
@@ -30,9 +31,11 @@ class SelectionDialog extends StatefulWidget {
this.flagWidth = 32, this.flagWidth = 32,
this.size, this.size,
this.hideSearch = false, this.hideSearch = false,
this.closeIcon = closeIcon == null ? Icon(Icons.close) : closeIcon,
}) : assert(searchDecoration != null, 'searchDecoration must not be null!'), }) : assert(searchDecoration != null, 'searchDecoration must not be null!'),
this.searchDecoration = this.searchDecoration = searchDecoration.prefixIcon == null
searchDecoration.copyWith(prefixIcon: Icon(Icons.search)), ? searchDecoration.copyWith(prefixIcon: Icon(Icons.search))
: searchDecoration,
super(key: key); super(key: key);
@override @override
@@ -72,9 +75,7 @@ class _SelectionDialogState extends State<SelectionDialog> {
IconButton( IconButton(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
iconSize: 20, iconSize: 20,
icon: Icon( icon: closeIcon,
Icons.close,
),
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
if (!widget.hideSearch) if (!widget.hideSearch)