Closed john-ravi closed 5 years ago
That's because your example is just DEFINING the variable textField and not CREATING it ..
perhaps something like
AutoCompleteTextField textField = AutoCompleteTextField(arg1, arg2, etc);
textField.key.currentState.textField.inputFormatters.add.... would work? (not sure but at least textField would be initialized
@john-ravi I'm adding this feature now. :)
Added inputformatters param in autocomplete_textfield as of 1.6.4.
@felixlucien -- If not already thought of you may want to follow the pattern of the "other" autocomplete project and allow just about any textfield modification to be passed in via a named parameter..
It's the flutter_typeahead project .. and he uses a TextFieldConfiguration idea as in the following code
TypeAheadField(
textFieldConfiguration: TextFieldConfiguration(
autofocus: true,
style: DefaultTextStyle.of(context).style.copyWith(
fontStyle: FontStyle.italic
),
decoration: InputDecoration(
border: OutlineInputBorder()
)
),
There are lot more options obviously but you get the idea (and since it's open source...)
I may look into doing such a thing. For now, it all seems to work well however it could be useful for simplicity.
This gives null exception. Thank you!