fleather icon indicating copy to clipboard operation
fleather copied to clipboard

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

Open Sjonnie2nd opened this issue 2 months ago • 0 comments

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

Sjonnie2nd avatar Oct 29 '25 11:10 Sjonnie2nd