From 58406bac296f435e1416cc56a4baa5eacab24e4f Mon Sep 17 00:00:00 2001 From: Eunice Vassoa Date: Tue, 14 Dec 2021 13:55:30 +0200 Subject: [PATCH 1/2] fixing controller dispose bug --- lib/easy_autocomplete.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/easy_autocomplete.dart b/lib/easy_autocomplete.dart index 2391bf1..ee56b91 100644 --- a/lib/easy_autocomplete.dart +++ b/lib/easy_autocomplete.dart @@ -233,7 +233,7 @@ class _EasyAutocompleteState extends State { @override void dispose() { if (_overlayEntry != null) _overlayEntry!.dispose(); - if (widget.controller != null) widget.controller!.dispose(); + if (widget.controller == null) _textFormField.controller!.dispose(); if (_debounce != null) _debounce?.cancel(); super.dispose(); } From 2376efd7b1f1baf81435c56ae18b65053794c5f6 Mon Sep 17 00:00:00 2001 From: Eunice Vassoa Date: Tue, 14 Dec 2021 13:58:21 +0200 Subject: [PATCH 2/2] Updating CHANGELOG --- CHANGELOG.md | 7 ++++++- README.md | 2 +- example/pubspec.lock | 2 +- pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83e6ef3..404f547 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ +## 1.2.2 - [14-12-2021] + +### Fixed +* Correcting bug in which disposing controller would generate error + ## 1.2.1 - [09-12-2021] -### Added +### Fixed * Correcting bug in which could not set initial value through controller ## 1.2.0 - [09-12-2021] diff --git a/README.md b/README.md index 88ae214..1be002e 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency: ``` yaml dependencies: ... - easy_autocomplete: ^1.2.1 + easy_autocomplete: ^1.2.2 ``` ### Basic example diff --git a/example/pubspec.lock b/example/pubspec.lock index e3f488d..c9a9c15 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -56,7 +56,7 @@ packages: path: ".." relative: true source: path - version: "1.2.1" + version: "1.2.2" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 4b0dad3..81903ee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: easy_autocomplete description: A simple but flexible autocomplete TextFormField to help you display suggestions to your users while typing -version: 1.2.1 +version: 1.2.2 homepage: https://github.com/4inka/flutter_easy_autocomplete environment: