diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index dc06eda9..06858569 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; /// Barrier color of ModalBottomSheet final Color barrierColor; @@ -96,6 +97,7 @@ class CountryCodePicker extends StatefulWidget { this.countryFilter, this.hideSearch = false, this.dialogSize, + this.closeIcon = const Icon(Icons.close), Key key, }) : super(key: key); @@ -258,6 +260,7 @@ class CountryCodePickerState extends State { flagWidth: widget.flagWidth, size: widget.dialogSize, hideSearch: widget.hideSearch, + closeIcon: widget.closeIcon, ), ).then((e) { if (e != null) { diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index 1e15fbeb..7434b4a3 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -14,6 +14,7 @@ class SelectionDialog extends StatefulWidget { final double flagWidth; final Size size; final bool hideSearch; + final Icon closeIcon; /// elements passed as favorite final List favoriteElements; @@ -32,9 +33,11 @@ class SelectionDialog extends StatefulWidget { this.flagWidth = 32, this.size, this.hideSearch = false, + this.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 @@ -75,7 +78,7 @@ class _SelectionDialogState extends State { IconButton( padding: const EdgeInsets.all(0), iconSize: 20, - icon: const Icon(Icons.close), + icon: widget.closeIcon, onPressed: () => Navigator.pop(context), ), if (!widget.hideSearch)