[SuperEditor][SuperReader] - Implement line-based layout #2359
Labels
area_attributed_text
Related to attributed_text
area_infrastructure
Pertains to cross-cutting infrastructure
area_super_reader
Related to SuperReader
area_super_text
area_supereditor
Pertains to SuperEditor
bounty_junior
time: 40
Flutter implements block-based layout, even for test. In Flutter, one lays out an entire paragraph (or block) of text at one time.
Many features in rich text layout depend upon the flow of lines of text:
Flutter doesn't support these use-cases, except perhaps inline bitmaps. Flutter technically supports inline widgets but this support is almost useless when it comes to the needs of rich text layout and editing. Instead, what's needed is a completely different layout approach.
Ideally, Flutter would expose the full surface area of
SkParagraph
, which is the underlying text shaping library that Flutter uses. With full access toSkParagraph
, we could probably build our own render object that calculates layout in a relatively efficient manner.However, Flutter has only included a subset of
SkParagraph
. As a result, implementing line-based layout requires repeatedly measuring blocks of text, querying line breaks, injecting non-text content, and then continuing the process.For this ticket, implement the aforementioned line-based layout by writing one or more custom render objects, which both layout content based on lines, and also reports any relevant bounds to other widgets.
The text was updated successfully, but these errors were encountered: