Skip to content

allow passing textcontroller to FlutterMentions #76

Description

@Fnalsk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions