From 7828e2a050b22f05403573195e53e8e364d7d63a Mon Sep 17 00:00:00 2001 From: Eunice Vassoa Date: Tue, 2 May 2023 15:12:56 +0100 Subject: [PATCH 1/3] #21 --- lib/easy_autocomplete.dart | 4 +++- lib/widgets/filterable_list.dart | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/easy_autocomplete.dart b/lib/easy_autocomplete.dart index 8bdf9f5..7683c05 100644 --- a/lib/easy_autocomplete.dart +++ b/lib/easy_autocomplete.dart @@ -97,7 +97,8 @@ class EasyAutocomplete extends StatefulWidget { /// Creates a autocomplete widget to help you manage your suggestions const EasyAutocomplete( - {this.suggestions, + {Key? key, + this.suggestions, this.asyncSuggestions, this.suggestionBuilder, this.progressIndicatorBuilder, @@ -176,6 +177,7 @@ class _EasyAutocompleteState extends State { showWhenUnlinked: false, offset: Offset(0.0, size.height + 5.0), child: FilterableList( + key: widget.key, loading: _isLoading, suggestionBuilder: widget.suggestionBuilder, progressIndicatorBuilder: widget.progressIndicatorBuilder, diff --git a/lib/widgets/filterable_list.dart b/lib/widgets/filterable_list.dart index 18553ff..9c29be2 100644 --- a/lib/widgets/filterable_list.dart +++ b/lib/widgets/filterable_list.dart @@ -39,7 +39,8 @@ class FilterableList extends StatelessWidget { final Widget? progressIndicatorBuilder; const FilterableList( - {required this.items, + {Key? key, + required this.items, required this.onItemTapped, this.suggestionBuilder, this.elevation = 5, From aa505fffd7bb667c02a60ae61770822fa2499d9f Mon Sep 17 00:00:00 2001 From: Eunice Vassoa Date: Tue, 2 May 2023 15:16:58 +0100 Subject: [PATCH 2/3] #26 --- lib/easy_autocomplete.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/easy_autocomplete.dart b/lib/easy_autocomplete.dart index 7683c05..01f7ec8 100644 --- a/lib/easy_autocomplete.dart +++ b/lib/easy_autocomplete.dart @@ -95,6 +95,8 @@ class EasyAutocomplete extends StatefulWidget { /// Can be used to validate field value final String? Function(String?)? validator; + final double maxListHeight; + /// Creates a autocomplete widget to help you manage your suggestions const EasyAutocomplete( {Key? key, @@ -117,7 +119,8 @@ class EasyAutocomplete extends StatefulWidget { this.suggestionTextStyle = const TextStyle(), this.suggestionBackgroundColor, this.debounceDuration = const Duration(milliseconds: 400), - this.validator}) + this.validator, + this.maxListHeight = 150}) : assert(onChanged != null || controller != null, 'onChanged and controller parameters cannot be both null at the same time'), assert(!(controller != null && initialValue != null), @@ -185,6 +188,7 @@ class _EasyAutocompleteState extends State { suggestionTextStyle: widget.suggestionTextStyle, suggestionBackgroundColor: widget.suggestionBackgroundColor, + maxListHeight: widget.maxListHeight, onItemTapped: (value) { _controller ..value = TextEditingValue( From 7f993ac42b266592dc05c109ebd10311c4d68e45 Mon Sep 17 00:00:00 2001 From: Eunice Vassoa Date: Tue, 2 May 2023 15:28:30 +0100 Subject: [PATCH 3/3] #25 --- lib/easy_autocomplete.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/easy_autocomplete.dart b/lib/easy_autocomplete.dart index 01f7ec8..4f729c0 100644 --- a/lib/easy_autocomplete.dart +++ b/lib/easy_autocomplete.dart @@ -90,7 +90,7 @@ class EasyAutocomplete extends StatefulWidget { final Widget Function(String data)? suggestionBuilder; /// Can be used to display custom progress idnicator - final Widget? progressIndicatorBuilder; + final Widget progressIndicatorBuilder; /// Can be used to validate field value final String? Function(String?)? validator; @@ -103,7 +103,7 @@ class EasyAutocomplete extends StatefulWidget { this.suggestions, this.asyncSuggestions, this.suggestionBuilder, - this.progressIndicatorBuilder, + this.progressIndicatorBuilder = const CircularProgressIndicator(), this.controller, this.decoration = const InputDecoration(), this.onChanged,