diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c40865..a27b4aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# [5.0.1] +* Fix static analysis errors. + # [5.0.0] * Flutter 3.0.0 support. diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index 1fc8ed34..f16b4c34 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_linux ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 411af46d..88b22e5c 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST url_launcher_windows ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/lib/src/widgets/delegate.dart b/lib/src/widgets/delegate.dart index 82dfa2ca..ddcc9053 100644 --- a/lib/src/widgets/delegate.dart +++ b/lib/src/widgets/delegate.dart @@ -259,7 +259,7 @@ class EditorTextSelectionGestureDetectorBuilder { // if double tap happens on an editor that doesn't // have focus, selection hasn't been set when the toolbars // get added - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { if (shouldShowSelectionToolbar) { editor!.showToolbar(); } diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 98a43b12..74faf5b6 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -628,6 +628,9 @@ class _QuillEditorSelectionGestureDetectorBuilder ..selectWordEdge(SelectionChangedCause.tap) ..onSelectionCompleted(); break; + case PointerDeviceKind.trackpad: + // TODO: Handle this case. + break; } } else { renderEditor! diff --git a/lib/src/widgets/embeds/image_resizer.dart b/lib/src/widgets/embeds/image_resizer.dart index 08644897..03e3f623 100644 --- a/lib/src/widgets/embeds/image_resizer.dart +++ b/lib/src/widgets/embeds/image_resizer.dart @@ -108,7 +108,7 @@ class _ImageResizerState extends State { } _scheduled = true; - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { widget.onImageResize(_width, _height); _scheduled = false; }); diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index 8c5cd4a6..9948e14f 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -423,7 +423,7 @@ class RawEditorState extends EditorState }; // Go back from offset 0 to current selection - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { widget.controller.updateSelection( TextSelection.collapsed(offset: offset), ChangeSource.LOCAL); }); @@ -748,7 +748,7 @@ class RawEditorState extends EditorState // a new RenderEditableBox child. If we try to update selection overlay // immediately it'll not be able to find the new child since it hasn't been // built yet. - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { if (!mounted) { return; } @@ -794,10 +794,10 @@ class RawEditorState extends EditorState _hasFocus, widget.controller.selection); _updateOrDisposeSelectionOverlayIfNeeded(); if (_hasFocus) { - WidgetsBinding.instance!.addObserver(this); + WidgetsBinding.instance.addObserver(this); _showCaretOnScreen(); } else { - WidgetsBinding.instance!.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); } updateKeepAlive(); } @@ -830,7 +830,7 @@ class RawEditorState extends EditorState } _showCaretOnScreenScheduled = true; - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { if (widget.scrollable || _scrollController.hasClients) { _showCaretOnScreenScheduled = false; @@ -1174,13 +1174,13 @@ class RawEditorState extends EditorState @override void insertTextPlaceholder(Size size) { - // this is needed for Scribble ( Stylus input) in Apple platforms + // this is needed for Scribble (Stylus input) in Apple platforms // and this package does not implement this feature } @override void removeTextPlaceholder() { - // this is needed for Scribble ( Stylus input) in Apple platforms + // this is needed for Scribble (Stylus input) in Apple platforms // and this package does not implement this feature } } diff --git a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart index a8697381..8b494dd1 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart @@ -15,7 +15,6 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState return widget.controller.plainTextEditingValue; } - @override set textEditingValue(TextEditingValue value) { final cursorPosition = value.selection.extentOffset; final oldText = widget.controller.document.toPlainText(); diff --git a/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart index f4ead94b..24cdc955 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart @@ -300,7 +300,7 @@ mixin RawEditorStateTextInputClientMixin on EditorState if (hasConnection) { // Asking for renderEditor.size here can cause errors if layout hasn't // occurred yet. So we schedule a post frame callback instead. - SchedulerBinding.instance!.addPostFrameCallback((_) { + SchedulerBinding.instance.addPostFrameCallback((_) { if (!mounted) { return; } diff --git a/lib/src/widgets/text_selection.dart b/lib/src/widgets/text_selection.dart index 03cc4c99..9478dcab 100644 --- a/lib/src/widgets/text_selection.dart +++ b/lib/src/widgets/text_selection.dart @@ -190,9 +190,9 @@ class EditorTextSelectionOverlay { handlesVisible = visible; // If we are in build state, it will be too late to update visibility. // We will need to schedule the build in next frame. - if (SchedulerBinding.instance!.schedulerPhase == + if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) { - SchedulerBinding.instance!.addPostFrameCallback(markNeedsBuild); + SchedulerBinding.instance.addPostFrameCallback(markNeedsBuild); } else { markNeedsBuild(); } @@ -269,9 +269,9 @@ class EditorTextSelectionOverlay { return; } value = newValue; - if (SchedulerBinding.instance!.schedulerPhase == + if (SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks) { - SchedulerBinding.instance!.addPostFrameCallback(markNeedsBuild); + SchedulerBinding.instance.addPostFrameCallback(markNeedsBuild); } else { markNeedsBuild(); } diff --git a/lib/src/widgets/toolbar/arrow_indicated_button_list.dart b/lib/src/widgets/toolbar/arrow_indicated_button_list.dart index b3858e5d..52098099 100644 --- a/lib/src/widgets/toolbar/arrow_indicated_button_list.dart +++ b/lib/src/widgets/toolbar/arrow_indicated_button_list.dart @@ -31,7 +31,7 @@ class _ArrowIndicatedButtonListState extends State // Listening to the WidgetsBinding instance is necessary so that we can // hide the arrows when the window gets a new size and thus the toolbar // becomes scrollable/unscrollable. - WidgetsBinding.instance!.addObserver(this); + WidgetsBinding.instance.addObserver(this); // Workaround to allow the scroll controller attach to our ListView so that // we can detect if overflow arrows need to be shown on init. @@ -55,7 +55,7 @@ class _ArrowIndicatedButtonListState extends State @override void dispose() { _controller.dispose(); - WidgetsBinding.instance!.removeObserver(this); + WidgetsBinding.instance.removeObserver(this); super.dispose(); } diff --git a/pubspec.yaml b/pubspec.yaml index 8df3f3ee..4d86f729 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) -version: 5.0.0 +version: 5.0.1 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill