From 4c0859dcf62bd7a926c3fb933059d82af85b81ca Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Tue, 24 Sep 2024 19:27:38 -0700 Subject: [PATCH] Use Timer instead of Ticker with mobile caret blink controller to avoid constantly pumping frames (Resolves #2340) (#2341) --- super_editor/lib/src/default_editor/super_editor.dart | 2 +- .../platforms/android/android_document_controls.dart | 2 +- .../src/infrastructure/platforms/ios/ios_document_controls.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/super_editor/lib/src/default_editor/super_editor.dart b/super_editor/lib/src/default_editor/super_editor.dart index f252ced67..98c3a478d 100644 --- a/super_editor/lib/src/default_editor/super_editor.dart +++ b/super_editor/lib/src/default_editor/super_editor.dart @@ -1210,7 +1210,7 @@ const defaultComponentBuilders = [ /// Default list of document overlays that are displayed on top of the document /// layout in a [SuperEditor]. -const defaultSuperEditorDocumentOverlayBuilders = [ +const defaultSuperEditorDocumentOverlayBuilders = [ // Adds a Leader around the document selection at a focal point for the // iOS floating toolbar. SuperEditorIosToolbarFocalPointDocumentLayerBuilder(), diff --git a/super_editor/lib/src/infrastructure/platforms/android/android_document_controls.dart b/super_editor/lib/src/infrastructure/platforms/android/android_document_controls.dart index a56b1f7e1..bca988851 100644 --- a/super_editor/lib/src/infrastructure/platforms/android/android_document_controls.dart +++ b/super_editor/lib/src/infrastructure/platforms/android/android_document_controls.dart @@ -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); diff --git a/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart b/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart index 44720920f..7ef8d6683 100644 --- a/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart +++ b/super_editor/lib/src/infrastructure/platforms/ios/ios_document_controls.dart @@ -564,7 +564,7 @@ class IosControlsDocumentLayerState extends DocumentLayoutLayerState