flutter_easy_autocomplete icon indicating copy to clipboard operation
flutter_easy_autocomplete copied to clipboard

How to access overlayEntry.remove() ?

Open florentin89 opened this issue 2 years ago • 0 comments

I have the next example:

EasyAutocomplete (
....
decoration: InputDecoration(
  border: const OutlineInputBorder(),
  hintText: 'Search...',
  hintStyle: const TextStyle(color: Colors.white),
  suffixIcon: IconButton(
    onPressed: () {
      setState(() {
        myTextEditingController.clear();
        _overlayEntry.closeOverlay();   // HOW TO ACCESS THIS FUNCTION ?
      });
    },
    icon: const Icon(Icons.delete_forever_outlined, color: Colors.white),
  ),
),
....
);

How can I access _overlayEntry.closeOverlay() when I press a clear button inside decoration property, which is part of the EasyAutocomplete instance class ?

florentin89 avatar Nov 29 '23 11:11 florentin89