diff --git a/lib/src/widgets/cursor.dart b/lib/src/widgets/cursor.dart index d0bc91b2..67ac45f5 100644 --- a/lib/src/widgets/cursor.dart +++ b/lib/src/widgets/cursor.dart @@ -60,7 +60,7 @@ class CursorCont extends ChangeNotifier { required CursorStyle style, required TickerProvider tickerProvider, }) : _style = style, - _blink = ValueNotifier(false), + blink = ValueNotifier(false), color = ValueNotifier(style.color) { _blinkOpacityCont = AnimationController(vsync: tickerProvider, duration: _FADE_DURATION); @@ -68,17 +68,13 @@ class CursorCont extends ChangeNotifier { } final ValueNotifier show; - final ValueNotifier _blink; + final ValueNotifier blink; final ValueNotifier color; late AnimationController _blinkOpacityCont; Timer? _cursorTimer; bool _targetCursorVisibility = false; CursorStyle _style; - ValueNotifier get cursorBlink => _blink; - - ValueNotifier get cursorColor => color; - CursorStyle get style => _style; set style(CursorStyle value) { @@ -93,7 +89,7 @@ class CursorCont extends ChangeNotifier { stopCursorTimer(); _blinkOpacityCont.dispose(); show.dispose(); - _blink.dispose(); + blink.dispose(); color.dispose(); assert(_cursorTimer == null); super.dispose(); @@ -154,7 +150,7 @@ class CursorCont extends ChangeNotifier { void _onColorTick() { color.value = _style.color.withOpacity(_blinkOpacityCont.value); - _blink.value = show.value && _blinkOpacityCont.value > 0; + blink.value = show.value && _blinkOpacityCont.value > 0; } } diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index ef80a024..2bac327b 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -575,7 +575,7 @@ class RenderEditableTextLine extends RenderEditableBox { } if (containsCursor()) { cursorCont.addListener(markNeedsLayout); - cursorCont.cursorColor.addListener(markNeedsPaint); + cursorCont.color.addListener(markNeedsPaint); } } @@ -587,7 +587,7 @@ class RenderEditableTextLine extends RenderEditableBox { } if (containsCursor()) { cursorCont.removeListener(markNeedsLayout); - cursorCont.cursorColor.removeListener(markNeedsPaint); + cursorCont.color.removeListener(markNeedsPaint); } } @@ -728,7 +728,7 @@ class RenderEditableTextLine extends RenderEditableBox { _body, cursorCont.style, _caretPrototype, - cursorCont.cursorColor.value, + cursorCont.color.value, devicePixelRatio, );