Improve SelectionDialog Performance
* Also added a emptySearchBuilder property, this is the widget that will build when a search contains no results.
This commit is contained in:
@@ -14,6 +14,7 @@ class CountryCodePicker extends StatefulWidget {
|
||||
final TextStyle textStyle;
|
||||
final EdgeInsetsGeometry padding;
|
||||
final bool showCountryOnly;
|
||||
final WidgetBuilder emptySearchBuilder;
|
||||
|
||||
CountryCodePicker({
|
||||
this.onChanged,
|
||||
@@ -22,6 +23,7 @@ class CountryCodePicker extends StatefulWidget {
|
||||
this.textStyle,
|
||||
this.padding = const EdgeInsets.all(0.0),
|
||||
this.showCountryOnly = false,
|
||||
this.emptySearchBuilder,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -107,8 +109,13 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
||||
void _showSelectionDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) => new SelectionDialog(elements, favoriteElements,
|
||||
showCountryOnly: widget.showCountryOnly),
|
||||
builder: (_) =>
|
||||
SelectionDialog(
|
||||
elements,
|
||||
favoriteElements,
|
||||
showCountryOnly: widget.showCountryOnly,
|
||||
emptySearchBuilder: widget.emptySearchBuilder,
|
||||
),
|
||||
).then((e) {
|
||||
if (e != null) {
|
||||
setState(() {
|
||||
|
||||
Reference in New Issue
Block a user