diff --git a/example/lib/main.dart b/example/lib/main.dart index ca32fbc..8520606 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -118,8 +118,9 @@ class _MyAppState extends State { favorite: ['+39', 'FR'], countryFilter: ['IT', 'FR'], // flag can be styled with BoxDecoration's `borderRadius` and `shape` fields - flagDecoration: - BoxDecoration(borderRadius: BorderRadius.circular(7)), + flagDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(7), + ), ), SizedBox( width: 400, diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index ba22a1f..8a71867 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -79,7 +79,7 @@ class CountryCodePicker extends StatefulWidget { final bool showDropDownButton; /// [BoxDecoration] for the flag image - final Decoration flagDecoration; + final Decoration? flagDecoration; CountryCodePicker({ this.onChanged, @@ -302,6 +302,7 @@ class CountryCodePickerState extends State { barrierColor: widget.barrierColor, hideSearch: widget.hideSearch, closeIcon: widget.closeIcon, + flagDecoration: widget.flagDecoration, ), ), ), diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index 3177a05..34f3168 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -44,8 +44,7 @@ class SelectionDialog extends StatefulWidget { this.barrierColor, this.hideSearch = false, this.closeIcon, - }) : assert(searchDecoration != null, 'searchDecoration must not be null!'), - this.searchDecoration = searchDecoration.prefixIcon == null + }) : this.searchDecoration = searchDecoration.prefixIcon == null ? searchDecoration.copyWith(prefixIcon: Icon(Icons.search)) : searchDecoration, super(key: key);