Skip to content

Commit

Permalink
Use Timer instead of Ticker with mobile caret blink controller to avo…
Browse files Browse the repository at this point in the history
…id constantly pumping frames (Resolves #2340) (#2341)
  • Loading branch information
matthew-carroll committed Sep 25, 2024
1 parent ac5c158 commit 4c0859d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion super_editor/lib/src/default_editor/super_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ const defaultComponentBuilders = <ComponentBuilder>[

/// Default list of document overlays that are displayed on top of the document
/// layout in a [SuperEditor].
const defaultSuperEditorDocumentOverlayBuilders = [
const defaultSuperEditorDocumentOverlayBuilders = <SuperEditorLayerBuilder>[
// Adds a Leader around the document selection at a focal point for the
// iOS floating toolbar.
SuperEditorIosToolbarFocalPointDocumentLayerBuilder(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class AndroidControlsDocumentLayerState
@override
void initState() {
super.initState();
_caretBlinkController = BlinkController(tickerProvider: this);
_caretBlinkController = BlinkController.withTimer();

_previousSelection = widget.selection.value;
widget.selection.addListener(_onSelectionChange);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ class IosControlsDocumentLayerState extends DocumentLayoutLayerState<IosHandlesD
@override
void initState() {
super.initState();
_caretBlinkController = BlinkController(tickerProvider: this);
_caretBlinkController = BlinkController.withTimer();

widget.selection.addListener(_onSelectionChange);
widget.shouldCaretBlink.addListener(_onBlinkModeChange);
Expand Down

0 comments on commit 4c0859d

Please sign in to comment.