flutter-autocomplete-textfield
flutter-autocomplete-textfield copied to clipboard
How do I create a validator for the AutoCompleteTextField?
validator: (value) { if (value.isEmpty) { return "msg ...."; } return null; },
Same question. Would like to apply my basic email validator to this list.
I'm having the same issue..
I'm in the process of rewriting the library for the current version of text field in flutter. I'll add an AutoCompleteTextFormField while I am at it. I'm unsure if my pull request will be reviewed given the 6 open ones from 14 months ago.
I'm in the process of rewriting the library for the current version of text field in flutter. I'll add an AutoCompleteTextFormField while I am at it. I'm unsure if my pull request will be reviewed given the 6 open ones from 14 months ago.
check this fork: by marcelser
We will wait for the implementation. For now I decided like this:
autocompleteField.updateDecoration(decoration: autocompleteField.decoration.copyWith(errorText: "msg error"));
to clean:
autocompleteField.updateDecoration(decoration: autocompleteField.decoration.copyWith(errorText: null));
Can anyone please elaborate more on this? How can I use this so that i can validate the field like how we do in Flutter forms?
As of right now, built in validation is not supported. You can the alternative method that @mdmota provided. I implemented support for flutter's validation in my latest pull request #103, but as far as I can tell this project is abandoned by the original author. I would suggest Flutter Typeahed, my fork, or Marcelser's Fork.
I've requested @marcelser make a PR to get this in. :)
@felixmccuaig Any update on providing validator ?