From 255cb47876e7b2cf0495bb01e27b3b6efed09ab1 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 9 Aug 2022 15:32:28 +0800 Subject: [PATCH] fix: text align error --- .../lib/render/rich_text/bulleted_list_text.dart | 13 ++++++++----- .../lib/render/rich_text/checkbox_text.dart | 14 ++++++++------ .../lib/render/rich_text/number_list_text.dart | 13 ++++++++----- .../lib/render/rich_text/quoted_text.dart | 13 ++++++++----- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart index 05da8d1e80..b962f63f3d 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart @@ -60,16 +60,19 @@ class _BulletedListTextNodeWidgetState extends State return SizedBox( width: maxTextNodeWidth, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ FlowySvg( size: Size.square(leftPadding), name: 'point', ), - FlowyRichText( - key: _richTextKey, - placeholderText: 'List', - textNode: widget.textNode, - editorState: widget.editorState, + Expanded( + child: FlowyRichText( + key: _richTextKey, + placeholderText: 'List', + textNode: widget.textNode, + editorState: widget.editorState, + ), ), ], ), diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart index 89c314eb8a..e5b02eb32d 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart @@ -84,12 +84,14 @@ class _CheckboxNodeWidgetState extends State ..commit(); }, ), - FlowyRichText( - key: _richTextKey, - placeholderText: 'To-do', - textNode: widget.textNode, - textSpanDecorator: _textSpanDecorator, - editorState: widget.editorState, + Expanded( + child: FlowyRichText( + key: _richTextKey, + placeholderText: 'To-do', + textNode: widget.textNode, + textSpanDecorator: _textSpanDecorator, + editorState: widget.editorState, + ), ), ], ), diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart index 0a2cd5937a..65b41e8e9b 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart @@ -60,16 +60,19 @@ class _NumberListTextNodeWidgetState extends State return SizedBox( width: maxTextNodeWidth, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ FlowySvg( size: Size.square(leftPadding), number: widget.textNode.attributes.number, ), - FlowyRichText( - key: _richTextKey, - placeholderText: 'List', - textNode: widget.textNode, - editorState: widget.editorState, + Expanded( + child: FlowyRichText( + key: _richTextKey, + placeholderText: 'List', + textNode: widget.textNode, + editorState: widget.editorState, + ), ), ], ), diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart index 65cfa3d066..0bb259de14 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart @@ -59,6 +59,7 @@ class _QuotedTextNodeWidgetState extends State return SizedBox( width: maxTextNodeWidth, child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ FlowySvg( size: Size( @@ -67,11 +68,13 @@ class _QuotedTextNodeWidgetState extends State ), name: 'quote', ), - FlowyRichText( - key: _richTextKey, - placeholderText: 'Quote', - textNode: widget.textNode, - editorState: widget.editorState, + Expanded( + child: FlowyRichText( + key: _richTextKey, + placeholderText: 'Quote', + textNode: widget.textNode, + editorState: widget.editorState, + ), ), ], ),