flutter_easy_autocomplete icon indicating copy to clipboard operation
flutter_easy_autocomplete copied to clipboard

disabling the edit field

Open mauricev opened this issue 2 years ago • 1 comments

How do I disable the edit field?

mauricev avatar Aug 10 '23 05:08 mauricev

In easy_autocomplete.dart file do next:

  1. On line 97 implement a boolean property like this: final bool? isTextFormFieldEnabled;.
  2. On line 119 after property called validator implement the new boolean like this: this.isTextFormFieldEnabled.
  3. On line 252 where you have the TextFormField(), there you need to implement the new property like this: enabled: isTextFormFieldEnabled.
  4. When you instantiate the EasyAutocomplete in your app, pass your own boolean to control the TextFormField (enable/disable).

I haven't tested, but it should work.

florentin89 avatar Nov 29 '23 11:11 florentin89