fix: flowy_rich_text will not automatically wrap when the text exceeds a line

This commit is contained in:
Lucas.Xu 2022-08-08 10:54:09 +08:00
parent 25387cd0b0
commit 9b9de523da
6 changed files with 40 additions and 33 deletions

View File

@ -62,12 +62,14 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
size: Size.square(leftPadding), size: Size.square(leftPadding),
name: 'point', name: 'point',
), ),
FlowyRichText( Expanded(
child: FlowyRichText(
key: _richTextKey, key: _richTextKey,
placeholderText: 'List', placeholderText: 'List',
textNode: widget.textNode, textNode: widget.textNode,
editorState: widget.editorState, editorState: widget.editorState,
), ),
),
], ],
); );
} }

View File

@ -82,13 +82,15 @@ class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
..commit(); ..commit();
}, },
), ),
FlowyRichText( Expanded(
child: FlowyRichText(
key: _richTextKey, key: _richTextKey,
placeholderText: 'To-do', placeholderText: 'To-do',
textNode: widget.textNode, textNode: widget.textNode,
textSpanDecorator: _textSpanDecorator, textSpanDecorator: _textSpanDecorator,
editorState: widget.editorState, editorState: widget.editorState,
) ),
),
], ],
); );
} }

View File

@ -141,10 +141,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
return Stack( return Stack(
children: [ children: [
_buildPlaceholderText(context), _buildPlaceholderText(context),
Align( _buildSingleRichText(context),
alignment: Alignment.centerLeft,
child: _buildSingleRichText(context),
)
], ],
); );
} }

View File

@ -63,6 +63,7 @@ class _HeadingTextNodeWidgetState extends State<HeadingTextNodeWidget>
top: topPadding, top: topPadding,
bottom: bottomPadding, bottom: bottomPadding,
), ),
child: Expanded(
child: FlowyRichText( child: FlowyRichText(
key: _richTextKey, key: _richTextKey,
placeholderText: 'Heading', placeholderText: 'Heading',
@ -71,6 +72,7 @@ class _HeadingTextNodeWidgetState extends State<HeadingTextNodeWidget>
textNode: widget.textNode, textNode: widget.textNode,
editorState: widget.editorState, editorState: widget.editorState,
), ),
),
) )
], ],
); );

View File

@ -63,12 +63,14 @@ class _NumberListTextNodeWidgetState extends State<NumberListTextNodeWidget>
size: Size.square(leftPadding), size: Size.square(leftPadding),
number: widget.textNode.attributes.number, number: widget.textNode.attributes.number,
), ),
FlowyRichText( Expanded(
child: FlowyRichText(
key: _richTextKey, key: _richTextKey,
placeholderText: 'List', placeholderText: 'List',
textNode: widget.textNode, textNode: widget.textNode,
editorState: widget.editorState, editorState: widget.editorState,
), ),
),
], ],
); );
} }

View File

@ -65,12 +65,14 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
), ),
name: 'quote', name: 'quote',
), ),
FlowyRichText( Expanded(
child: FlowyRichText(
key: _richTextKey, key: _richTextKey,
placeholderText: 'Quote', placeholderText: 'Quote',
textNode: widget.textNode, textNode: widget.textNode,
editorState: widget.editorState, editorState: widget.editorState,
), ),
),
], ],
); );
} }