diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 77f38c2..e62cdbb 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -14,6 +14,7 @@ class CountryCodePicker extends StatefulWidget { final TextStyle textStyle; final EdgeInsetsGeometry padding; final bool showCountryOnly; + final InputDecoration searchDecoration; final WidgetBuilder emptySearchBuilder; CountryCodePicker({ @@ -23,6 +24,7 @@ class CountryCodePicker extends StatefulWidget { this.textStyle, this.padding = const EdgeInsets.all(0.0), this.showCountryOnly = false, + this.searchDecoration, this.emptySearchBuilder, }); @@ -115,6 +117,7 @@ class _CountryCodePickerState extends State { favoriteElements, showCountryOnly: widget.showCountryOnly, emptySearchBuilder: widget.emptySearchBuilder, + searchDecoration: widget.searchDecoration, ), ).then((e) { if (e != null) { diff --git a/lib/selection_dialog.dart b/lib/selection_dialog.dart index 851ff6a..a786f80 100644 --- a/lib/selection_dialog.dart +++ b/lib/selection_dialog.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; class SelectionDialog extends StatefulWidget { final List elements; final bool showCountryOnly; + final InputDecoration searchDecoration; final WidgetBuilder emptySearchBuilder; /// elements passed as favorite @@ -14,7 +15,10 @@ class SelectionDialog extends StatefulWidget { Key key, this.showCountryOnly, this.emptySearchBuilder, - }) : super(key: key); + InputDecoration searchDecoration = const InputDecoration(), + }) : + this.searchDecoration = searchDecoration.copyWith(prefixIcon: Icon(Icons.search)), + super(key: key); @override State createState() => _SelectionDialogState(); @@ -29,7 +33,7 @@ class _SelectionDialogState extends State { title: Column( children: [ TextField( - decoration: const InputDecoration(prefixIcon: Icon(Icons.search)), + decoration: widget.searchDecoration, onChanged: _filterElements, ), ],