diff --git a/lib/src/editor/raw_editor/raw_editor_state.dart b/lib/src/editor/raw_editor/raw_editor_state.dart index 6c6f9dba7..9eba64052 100644 --- a/lib/src/editor/raw_editor/raw_editor_state.dart +++ b/lib/src/editor/raw_editor/raw_editor_state.dart @@ -719,7 +719,8 @@ class QuillRawEditorState extends EditorState widget.configurations.enableInteractiveSelection, _hasFocus, MediaQuery.devicePixelRatioOf(context), - _cursorCont); + _cursorCont, + _styles!.inlineCode!); return editableTextLine; } diff --git a/lib/src/editor/widgets/text/text_block.dart b/lib/src/editor/widgets/text/text_block.dart index 56a4aecff..8208ab0f0 100644 --- a/lib/src/editor/widgets/text/text_block.dart +++ b/lib/src/editor/widgets/text/text_block.dart @@ -203,6 +203,7 @@ class EditableTextBlock extends StatelessWidget { hasFocus, MediaQuery.devicePixelRatioOf(context), cursorCont, + styles!.inlineCode!, ); final nodeTextDirection = getDirectionOfNode(line, textDirection); children.add( diff --git a/lib/src/editor/widgets/text/text_line.dart b/lib/src/editor/widgets/text/text_line.dart index 95040ea88..2e5dd9778 100644 --- a/lib/src/editor/widgets/text/text_line.dart +++ b/lib/src/editor/widgets/text/text_line.dart @@ -642,6 +642,7 @@ class EditableTextLine extends RenderObjectWidget { this.hasFocus, this.devicePixelRatio, this.cursorCont, + this.inlineCodeStyle, {super.key}); final Line line; @@ -656,6 +657,7 @@ class EditableTextLine extends RenderObjectWidget { final bool hasFocus; final double devicePixelRatio; final CursorCont cursorCont; + final InlineCodeStyle inlineCodeStyle; @override RenderObjectElement createElement() { @@ -664,7 +666,6 @@ class EditableTextLine extends RenderObjectWidget { @override RenderObject createRenderObject(BuildContext context) { - final defaultStyles = DefaultStyles.getInstance(context); return RenderEditableTextLine( line, textDirection, @@ -675,13 +676,12 @@ class EditableTextLine extends RenderObjectWidget { _getPadding(), color, cursorCont, - defaultStyles.inlineCode!); + inlineCodeStyle); } @override void updateRenderObject( BuildContext context, covariant RenderEditableTextLine renderObject) { - final defaultStyles = DefaultStyles.getInstance(context); renderObject ..setLine(line) ..setPadding(_getPadding()) @@ -692,7 +692,7 @@ class EditableTextLine extends RenderObjectWidget { ..hasFocus = hasFocus ..setDevicePixelRatio(devicePixelRatio) ..setCursorCont(cursorCont) - ..setInlineCodeStyle(defaultStyles.inlineCode!); + ..setInlineCodeStyle(inlineCodeStyle); } EdgeInsetsGeometry _getPadding() {