I want something like this:
FlutterMentions(
key: _mentionsKey,
decoration: InputDecoration(
suffixIcon: ValueListenableBuilder(
valueListenable: _mentionsKey.currentState!.controller!,
builder: (BuildContext context, value, Widget? child) => // some widget
)
),
mentions: [
...
],
)
Essentially I need the controller to be used in the decoration. The problem with this is that the InputDecoration builds first, so _mentionsKey.currentState! throws an exception saying null check operator used on null value. This wouldn't be a problem if I could just build the TextEditingController (or AnnotationEditingController) elsewhere, then simply pass it to this widget.
I want something like this:
Essentially I need the controller to be used in the decoration. The problem with this is that the
InputDecorationbuilds first, so_mentionsKey.currentState!throws an exception saying null check operator used on null value. This wouldn't be a problem if I could just build theTextEditingController(orAnnotationEditingController) elsewhere, then simply pass it to this widget.