This repository was archived by the owner on Jul 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class CountryCodePicker extends StatefulWidget {
23
23
final Function (CountryCode ) builder;
24
24
final bool enabled;
25
25
final TextOverflow textOverflow;
26
+ final Icon closeIcon;
26
27
27
28
/// Barrier color of ModalBottomSheet
28
29
final Color barrierColor;
@@ -96,6 +97,7 @@ class CountryCodePicker extends StatefulWidget {
96
97
this .countryFilter,
97
98
this .hideSearch = false ,
98
99
this .dialogSize,
100
+ this .closeIcon = const Icon (Icons .close),
99
101
Key key,
100
102
}) : super (key: key);
101
103
@@ -258,6 +260,7 @@ class CountryCodePickerState extends State<CountryCodePicker> {
258
260
flagWidth: widget.flagWidth,
259
261
size: widget.dialogSize,
260
262
hideSearch: widget.hideSearch,
263
+ closeIcon: widget.closeIcon,
261
264
),
262
265
).then ((e) {
263
266
if (e != null ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ class SelectionDialog extends StatefulWidget {
14
14
final double flagWidth;
15
15
final Size size;
16
16
final bool hideSearch;
17
+ final Icon closeIcon;
17
18
18
19
/// elements passed as favorite
19
20
final List <CountryCode > favoriteElements;
@@ -32,9 +33,11 @@ class SelectionDialog extends StatefulWidget {
32
33
this .flagWidth = 32 ,
33
34
this .size,
34
35
this .hideSearch = false ,
36
+ this .closeIcon,
35
37
}) : assert (searchDecoration != null , 'searchDecoration must not be null!' ),
36
- this .searchDecoration =
37
- searchDecoration.copyWith (prefixIcon: Icon (Icons .search)),
38
+ this .searchDecoration = searchDecoration.prefixIcon == null
39
+ ? searchDecoration.copyWith (prefixIcon: Icon (Icons .search))
40
+ : searchDecoration,
38
41
super (key: key);
39
42
40
43
@override
@@ -75,7 +78,7 @@ class _SelectionDialogState extends State<SelectionDialog> {
75
78
IconButton (
76
79
padding: const EdgeInsets .all (0 ),
77
80
iconSize: 20 ,
78
- icon: const Icon ( Icons .close) ,
81
+ icon: widget.closeIcon ,
79
82
onPressed: () => Navigator .pop (context),
80
83
),
81
84
if (! widget.hideSearch)
You can’t perform that action at this time.
0 commit comments