Skip to content

Commit

Permalink
Chore: fix missed changes on cursor, text_block and text_line
Browse files Browse the repository at this point in the history
  • Loading branch information
CatHood0 committed Nov 28, 2024
1 parent 3a37acd commit 33a8cdd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion lib/src/editor/widgets/cursor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
import '../../common/utils/platform.dart';
import '../../document/nodes/line.dart';
import 'box.dart';
import 'cursor_configuration/cursor_configuration.dart';

/// Style properties of editing cursor.
class CursorStyle {
Expand Down Expand Up @@ -264,7 +265,7 @@ class CursorPainter {
TextPosition position,
bool lineHasEmbed,
Line node,
CursorParagrahPlaceholderConfiguration? cursorPlaceholderConfiguration,
CursorPlaceholderConfig? cursorPlaceholderConfiguration,
TextDirection textDirection,
) {
// relative (x, y) to global offset
Expand Down
9 changes: 5 additions & 4 deletions lib/src/editor/widgets/text/text_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import '../../raw_editor/builders/leading_block_builder.dart';
import '../../raw_editor/builders/placeholder/placeholder_builder_internal.dart';
import '../box.dart';
import '../cursor.dart';
import '../cursor_configuration/cursor_configuration.dart';
import '../default_leading_components/leading_components.dart';
import '../default_styles.dart';
import '../delegate.dart';
Expand Down Expand Up @@ -79,7 +80,7 @@ class EditableTextBlock extends StatelessWidget {
required this.readOnly,
required this.customRecognizerBuilder,
required this.placeholderBuilder,
required this.cursorParagrahPlaceholderConfiguration,
required this.cursorPlaceholderConfig,
required this.composingRange,
this.checkBoxReadOnly,
this.onLaunchUrl,
Expand All @@ -96,8 +97,8 @@ class EditableTextBlock extends StatelessWidget {
final HorizontalSpacing horizontalSpacing;
final VerticalSpacing verticalSpacing;
final PlaceholderBuilder? placeholderBuilder;
final CursorParagrahPlaceholderConfiguration?
cursorParagrahPlaceholderConfiguration;
final CursorPlaceholderConfig?
cursorPlaceholderConfig;
final TextSelection textSelection;
final Color color;
final DefaultStyles? styles;
Expand Down Expand Up @@ -213,7 +214,7 @@ class EditableTextBlock extends StatelessWidget {
MediaQuery.devicePixelRatioOf(context),
cursorCont,
styles!.inlineCode!,
cursorParagrahPlaceholderConfiguration,
cursorPlaceholderConfig,
);
final nodeTextDirection = getDirectionOfNode(line, textDirection);
children.add(
Expand Down
24 changes: 12 additions & 12 deletions lib/src/editor/widgets/text/text_line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -714,16 +714,16 @@ class EditableTextLine extends RenderObjectWidget {
this.devicePixelRatio,
this.cursorCont,
this.inlineCodeStyle,
this.cursorParagrahPlaceholderConfiguration,
this.cursorPlaceholderConfig,
{super.key});

final Line line;
final Widget? leading;
final Widget body;
final HorizontalSpacing horizontalSpacing;
final VerticalSpacing verticalSpacing;
final CursorParagrahPlaceholderConfiguration?
cursorParagrahPlaceholderConfiguration;
final CursorPlaceholderConfig?
cursorPlaceholderConfig;
final TextDirection textDirection;
final TextSelection textSelection;
final Color color;
Expand Down Expand Up @@ -751,7 +751,7 @@ class EditableTextLine extends RenderObjectWidget {
color,
cursorCont,
inlineCodeStyle,
cursorParagrahPlaceholderConfiguration,
cursorPlaceholderConfig,
);
}

Expand All @@ -765,7 +765,7 @@ class EditableTextLine extends RenderObjectWidget {
..setTextSelection(textSelection)
..setColor(color)
..setCursorParagraphPlaceholderConfiguration(
cursorParagrahPlaceholderConfiguration)
cursorPlaceholderConfig)
..setEnableInteractiveSelection(enableInteractiveSelection)
..hasFocus = hasFocus
..setDevicePixelRatio(devicePixelRatio)
Expand Down Expand Up @@ -797,7 +797,7 @@ class RenderEditableTextLine extends RenderEditableBox {
this.color,
this.cursorCont,
this.inlineCodeStyle,
this.cursorParagrahPlaceholderConfiguration,
this.cursorPlaceholderConfig,
);

RenderBox? _leading;
Expand All @@ -807,8 +807,8 @@ class RenderEditableTextLine extends RenderEditableBox {
TextSelection textSelection;
Color color;
bool enableInteractiveSelection;
CursorParagrahPlaceholderConfiguration?
cursorParagrahPlaceholderConfiguration;
CursorPlaceholderConfig?
cursorPlaceholderConfig;
bool hasFocus = false;
double devicePixelRatio;
EdgeInsetsGeometry padding;
Expand Down Expand Up @@ -838,11 +838,11 @@ class RenderEditableTextLine extends RenderEditableBox {
}

void setCursorParagraphPlaceholderConfiguration(
CursorParagrahPlaceholderConfiguration? c) {
if (cursorParagrahPlaceholderConfiguration == c) {
CursorPlaceholderConfig? c) {
if (cursorPlaceholderConfig == c) {
return;
}
cursorParagrahPlaceholderConfiguration = c;
cursorPlaceholderConfig = c;
markNeedsLayout();
}

Expand Down Expand Up @@ -1453,7 +1453,7 @@ class RenderEditableTextLine extends RenderEditableBox {
position,
lineHasEmbed,
line,
cursorParagrahPlaceholderConfiguration,
cursorPlaceholderConfig,
textDirection,
);
}
Expand Down

0 comments on commit 33a8cdd

Please sign in to comment.