📚 Encyclopedia

Flutter & Mobile · updated 2026-10-13

flutter_quill rich-text editor gotchas (markdown, IME, spell check, fonts)

flutterflutter_quillmarkdownimeandroidedge-to-edgespell-checkfonts

TLDR's composer is a WYSIWYG markdown editor built on flutter_quill 11 with markdown_quill for Delta to markdown conversion and a custom compact toolbar. These are the traps it hit.

Android: typing always appends at the end (IME desync)

On Android 15/16, tapping into the middle of text and typing inserted at the end. Cause: flutter_quill (up to 11.5.1) skips updateRemoteValueIfNeeded() whenever its keyboard-visibility plugin says the keyboard is hidden. That plugin's heuristic (getWindowVisibleDisplayFrame < 0.82 of the screen) is permanently false under edge-to-edge mode, which the app enables and Android 15+ enforces. The IME keeps a stale end-of-text cursor. Workaround in main.dart, before runApp:

KeyboardVisibilityTesting.setVisibilityForTesting(true);

It is sticky and puts quill in the forced-visible mode it uses on desktop and in tests. Remove once upstream fixes the gate, and do not trust flutter_keyboard_visibility* detection anywhere else in an edge-to-edge app.

Controller and markdown round-tripping

Spell check after flutter_quill 11

The built-in SpellCheckConfiguration was deprecated in 10.7.1 and removed in 11. Replacement: simple_spell_checker + an English dictionary package (discontinued on pub.dev but working), a custom inline attribute spell-error rendered by customStyleBuilder as a red wavy underline. - Two passes over the Delta: first find code-block line ranges (the code-block attribute sits on the \n op, not the text ops), then check words in text ops, skipping inline code, links and code blocks. Handle contractions with and without apostrophes. - Debounce 500 ms and set a suppress flag while applying attributes, or applying them triggers another check. - Strip the attribute before converting to markdown, so it never leaks into saved posts. - Copy the dictionary map (Map.from) before caching it; the package may invalidate its internal map on dispose.

Changing the editor font

flutter_quill's DefaultStyles.getInstance derives from the ambient DefaultTextStyle, so wrapping the editor in DefaultTextStyle.merge(style: TextStyle(fontFamily: 'X')) re-fonts paragraphs, headings and the placeholder in one place; inline code keeps its hardcoded monospace. Characters the font lacks fall back per character to the default font. (TLDR ships a handwritten font built from a photo, see Turning a photo of handwriting into an OpenType font (Python pipeline).)

Emoji on Flutter web

CanvasKit's chromium variant strips emoji font support; use canvasKitVariant: "full" in a custom flutter_bootstrap.js and load Noto Color Emoji at startup with loadFontFromList().

See also

Linked from

Sources: tldr memory (fix-quill-ime-sync, completed-work, feature-compose-font), post #1564, #1533