Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 818c698

Browse files
authored
Merge pull request #4 from 4inka/controller_issue
Controller initial value issue
2 parents e57a246 + 2b93e6b commit 818c698

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.2.1 - [09-12-2021]
2+
3+
### Added
4+
* Correcting bug in which could not set initial value through controller
5+
16
## 1.2.0 - [09-12-2021]
27

38
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In the `pubspec.yaml` of your flutter project, add the following dependency:
2323
``` yaml
2424
dependencies:
2525
...
26-
easy_autocomplete: ^1.2.0
26+
easy_autocomplete: ^1.2.1
2727
```
2828
2929
### Basic example

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ packages:
5656
path: ".."
5757
relative: true
5858
source: path
59-
version: "1.2.0"
59+
version: "1.2.1"
6060
fake_async:
6161
dependency: transitive
6262
description:

lib/easy_autocomplete.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ class _EasyAutocompleteState extends State<EasyAutocomplete> {
122122
},
123123
onEditingComplete: () => closeOverlay(),
124124
);
125+
if (widget.controller == null) {
125126
_textFormField.controller!.text = widget.initialValue ?? '';
127+
}
126128
_textFormField.controller!.addListener(() {
127129
updateSuggestions(_textFormField.controller!.text);
128130
});

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: easy_autocomplete
22
description: A simple but flexible autocomplete TextFormField to help you display suggestions to your users while typing
3-
version: 1.2.0
3+
version: 1.2.1
44
homepage: https://github.com/4inka/flutter_easy_autocomplete
55

66
environment:

0 commit comments

Comments
 (0)