瀏覽代碼

Merge pull request #799 from LucasXu0/feat/text_style

fix: text align error
Lucas.Xu 2 年之前
父節點
當前提交
ac3af7e01b

+ 8 - 5
frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/bulleted_list_text.dart

@@ -60,16 +60,19 @@ class _BulletedListTextNodeWidgetState extends State<BulletedListTextNodeWidget>
     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,
+            ),
           ),
         ],
       ),

+ 8 - 6
frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/checkbox_text.dart

@@ -84,12 +84,14 @@ class _CheckboxNodeWidgetState extends State<CheckboxNodeWidget>
                 ..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,
+            ),
           ),
         ],
       ),

+ 8 - 5
frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/number_list_text.dart

@@ -60,16 +60,19 @@ class _NumberListTextNodeWidgetState extends State<NumberListTextNodeWidget>
     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,
+            ),
           ),
         ],
       ),

+ 8 - 5
frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/quoted_text.dart

@@ -59,6 +59,7 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
     return SizedBox(
       width: maxTextNodeWidth,
       child: Row(
+        crossAxisAlignment: CrossAxisAlignment.start,
         children: [
           FlowySvg(
             size: Size(
@@ -67,11 +68,13 @@ class _QuotedTextNodeWidgetState extends State<QuotedTextNodeWidget>
             ),
             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,
+            ),
           ),
         ],
       ),