Skip to content

Warning: "Widget has been unmounted" after inserting link with LinkStyleButton #566

Description

@Sjonnie2nd

Hey, a small thing I noticed while testing the LinkStyleButton.

I have a setup where the standalone FleatherToolbar is shown or hidden when the FormField containing the FleatherField gets or loses focus.
Inserting a link works fine but right after closing the dialog this warning shows up: "This widget has been unmounted, so the State no longer has a context (and should be considered defunct)."

The link itself is applied correctly, so it's pretty harmless. It seems to happen because the toolbar disposes during the dialog, and then "FleatherToolbar._of(context).requestKeyboard()" runs on a disposed state.

I tried guarding it with "if (context.mounted)" in LinkStyleButton, but it still happens, so maybe it's inside "requestKeyboard()" itself.

Not a big deal, just wanted to report it in case others run into it.

Environment

  • Flutter version: 3.35.5
  • Fleather version: ^1.23.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions