From 6c70c5915fe42f896a6c420df945288df9b8296c Mon Sep 17 00:00:00 2001 From: Rutvik Tak <65209850+rutvik110@users.noreply.github.com> Date: Wed, 14 Jun 2023 02:08:53 +0530 Subject: [PATCH] Clean up analysis issues (Resolves #1165) (#1169) --- .gitignore | 1 + .../demos/components/demo_text_with_hint.dart | 2 +- .../components/demo_unselectable_hr.dart | 2 +- .../demos/debugging/simple_deltas_input.dart | 2 +- .../lib/demos/demo_animated_task_height.dart | 7 +- .../example/lib/demos/demo_app_shortcuts.dart | 2 +- .../lib/demos/demo_attributed_text.dart | 14 +- .../lib/demos/demo_document_loses_focus.dart | 4 +- .../lib/demos/demo_empty_document.dart | 2 +- .../demos/demo_markdown_serialization.dart | 2 +- .../example/lib/demos/demo_paragraphs.dart | 2 +- super_editor/example/lib/demos/demo_rtl.dart | 2 +- .../lib/demos/demo_selectable_text.dart | 2 +- .../demos/demo_switch_document_content.dart | 2 +- .../demo_mobile_editing_android.dart | 2 +- .../demo_mobile_editing_ios.dart | 2 +- .../lib/demos/example_editor/_toolbar.dart | 8 +- .../demos/example_editor/example_editor.dart | 8 +- .../demo_panel_behind_keyboard.dart | 22 +- .../flutter_features/demo_inline_widgets.dart | 12 +- .../barebones_ios_text_input_client.dart | 2 +- .../basic_text_input_client.dart | 2 +- .../textinputclient/textfield.dart | 2 +- ...o_task_and_chat_with_customscrollview.dart | 14 +- .../lib/demos/sliver_example_editor.dart | 2 +- .../lib/demos/styles/demo_doc_styles.dart | 2 +- .../demo_read_only_scrolling_document.dart | 2 +- .../demos/supertextfield/_emojis_demo.dart | 2 +- .../_expanding_multi_line_demo.dart | 2 +- .../supertextfield/_interactive_demo.dart | 2 +- .../_mobile_textfield_demo.dart | 2 +- .../supertextfield/_single_line_demo.dart | 2 +- .../_static_multi_line_demo.dart | 2 +- .../android/demo_superandroidtextfield.dart | 4 +- .../demos/supertextfield/demo_textfield.dart | 4 +- .../ios/demo_superiostextfield.dart | 4 +- super_editor/example/lib/main.dart | 4 +- .../lib/main_panel_behind_keyboard.dart | 8 +- .../marketing_video/main_marketing_video.dart | 2 +- super_editor/example/pubspec.yaml | 1 + .../super_editor_test/supereditor_robot.dart | 2 +- .../infrastructure/content_layers_test.dart | 8 +- .../src/default_editor/auto_scroll_test.dart | 14 +- .../test/src/default_editor/caret_test.dart | 46 +-- .../document_input_ime_test.dart | 3 +- .../infrastructure/editor_test.dart | 12 +- .../supereditor_gestures_test.dart | 2 +- .../supereditor_scrolling_test.dart | 6 +- .../super_reader_scrolling_test.dart | 8 +- .../super_textfield_auto_scroll_test.dart | 10 +- super_editor/test/test_tools.dart | 12 +- .../components/_components_test_utils.dart | 6 +- .../editor/mobile/mobile_selection_test.dart | 8 +- super_text_layout/example/pubspec.lock | 124 +++---- website/analysis_options.yaml | 2 +- website/lib/homepage/call_to_action.dart | 6 +- website/lib/homepage/editor_toolbar.dart | 183 +++++----- website/lib/homepage/featured_editor.dart | 35 +- website/lib/homepage/footer.dart | 10 +- website/lib/homepage/header.dart | 12 +- website/lib/homepage/home_page.dart | 15 +- website/lib/homepage/inside_the_toolbox.dart | 51 +-- website/pubspec.lock | 320 +++++++++++------- website/pubspec.yaml | 6 +- 64 files changed, 587 insertions(+), 479 deletions(-) diff --git a/.gitignore b/.gitignore index 2f2eff8c11..44de409c06 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ ios_text_example/ android_text_example/ +.vscode \ No newline at end of file diff --git a/super_editor/example/lib/demos/components/demo_text_with_hint.dart b/super_editor/example/lib/demos/components/demo_text_with_hint.dart index 3ed74bc5c4..ff95eadf71 100644 --- a/super_editor/example/lib/demos/components/demo_text_with_hint.dart +++ b/super_editor/example/lib/demos/components/demo_text_with_hint.dart @@ -15,7 +15,7 @@ import 'package:super_editor/super_editor.dart'; /// Each of the above steps are demonstrated in this example. class TextWithHintDemo extends StatefulWidget { @override - _TextWithHintDemoState createState() => _TextWithHintDemoState(); + State createState() => _TextWithHintDemoState(); } class _TextWithHintDemoState extends State { diff --git a/super_editor/example/lib/demos/components/demo_unselectable_hr.dart b/super_editor/example/lib/demos/components/demo_unselectable_hr.dart index 48f5823672..31e1a3829f 100644 --- a/super_editor/example/lib/demos/components/demo_unselectable_hr.dart +++ b/super_editor/example/lib/demos/components/demo_unselectable_hr.dart @@ -6,7 +6,7 @@ import 'package:super_editor/super_editor.dart'; /// The user can select around the horizontal rule, but cannot select it, specifically. class UnselectableHrDemo extends StatefulWidget { @override - _UnselectableHrDemoState createState() => _UnselectableHrDemoState(); + State createState() => _UnselectableHrDemoState(); } class _UnselectableHrDemoState extends State { diff --git a/super_editor/example/lib/demos/debugging/simple_deltas_input.dart b/super_editor/example/lib/demos/debugging/simple_deltas_input.dart index ea70fbdd15..4bd4e7ce1e 100644 --- a/super_editor/example/lib/demos/debugging/simple_deltas_input.dart +++ b/super_editor/example/lib/demos/debugging/simple_deltas_input.dart @@ -9,7 +9,7 @@ import 'package:super_text_layout/super_text_layout.dart'; /// all the rest of Super Editor into the picture. class SimpleDeltasInputDemo extends StatefulWidget { @override - _SimpleDeltasInputState createState() => _SimpleDeltasInputState(); + State createState() => _SimpleDeltasInputState(); } class _SimpleDeltasInputState extends State with TextInputClient, DeltaTextInputClient { diff --git a/super_editor/example/lib/demos/demo_animated_task_height.dart b/super_editor/example/lib/demos/demo_animated_task_height.dart index e6853177b8..a5337a4caf 100644 --- a/super_editor/example/lib/demos/demo_animated_task_height.dart +++ b/super_editor/example/lib/demos/demo_animated_task_height.dart @@ -4,7 +4,7 @@ import 'package:super_editor/super_editor.dart'; /// Example of a task component whose height is animated. class AnimatedTaskHeightDemo extends StatefulWidget { @override - _AnimatedTaskHeightDemoState createState() => _AnimatedTaskHeightDemoState(); + State createState() => _AnimatedTaskHeightDemoState(); } class _AnimatedTaskHeightDemoState extends State { @@ -99,6 +99,7 @@ class _AnimatedTaskComponent extends StatefulWidget { const _AnimatedTaskComponent({ Key? key, required this.viewModel, + // ignore: unused_element this.showDebugPaint = false, }) : super(key: key); @@ -166,12 +167,12 @@ class _AnimatedTaskComponentState extends State<_AnimatedTaskComponent> key: _animatedSizeKey, duration: const Duration(milliseconds: 100), child: widget.viewModel.selection != null - ? SizedBox( + ? const SizedBox( height: 20, child: Row( children: [ Icon(Icons.label_important_outline, size: 16), - const SizedBox(width: 4), + SizedBox(width: 4), Icon(Icons.timelapse_sharp, size: 16), ], ), diff --git a/super_editor/example/lib/demos/demo_app_shortcuts.dart b/super_editor/example/lib/demos/demo_app_shortcuts.dart index 013254a7fd..919f95d0e6 100644 --- a/super_editor/example/lib/demos/demo_app_shortcuts.dart +++ b/super_editor/example/lib/demos/demo_app_shortcuts.dart @@ -4,7 +4,7 @@ import 'package:super_editor/super_editor.dart'; class AppShortcutsDemo extends StatefulWidget { @override - _AppShortcutsDemoState createState() => _AppShortcutsDemoState(); + State createState() => _AppShortcutsDemoState(); } class _AppShortcutsDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_attributed_text.dart b/super_editor/example/lib/demos/demo_attributed_text.dart index c084566650..e72feeabde 100644 --- a/super_editor/example/lib/demos/demo_attributed_text.dart +++ b/super_editor/example/lib/demos/demo_attributed_text.dart @@ -4,7 +4,7 @@ import 'package:super_text_layout/super_text_layout.dart'; class AttributedTextDemo extends StatefulWidget { @override - _AttributedTextDemoState createState() => _AttributedTextDemoState(); + State createState() => _AttributedTextDemoState(); } class _AttributedTextDemoState extends State { @@ -21,22 +21,22 @@ class _AttributedTextDemoState extends State { } void _computeStyledText() { - AttributedText _text = AttributedText( + AttributedText text = AttributedText( text: 'This is some text styled with AttributedText', ); for (final range in _boldRanges) { - _text.addAttribution(boldAttribution, range); + text.addAttribution(boldAttribution, range); } for (final range in _italicsRanges) { - _text.addAttribution(italicsAttribution, range); + text.addAttribution(italicsAttribution, range); } for (final range in _strikethroughRanges) { - _text.addAttribution(strikethroughAttribution, range); + text.addAttribution(strikethroughAttribution, range); } setState(() { - _richText = _text.computeTextSpan((Set attributions) { + _richText = text.computeTextSpan((Set attributions) { TextStyle newStyle = const TextStyle( color: Colors.black, fontSize: 30, @@ -184,7 +184,7 @@ class TextRangeSelector extends StatefulWidget { final void Function(List)? onRangesChange; @override - _TextRangeSelectorState createState() => _TextRangeSelectorState(); + State createState() => _TextRangeSelectorState(); } class _TextRangeSelectorState extends State { diff --git a/super_editor/example/lib/demos/demo_document_loses_focus.dart b/super_editor/example/lib/demos/demo_document_loses_focus.dart index 174a077cd7..c2fc60fe97 100644 --- a/super_editor/example/lib/demos/demo_document_loses_focus.dart +++ b/super_editor/example/lib/demos/demo_document_loses_focus.dart @@ -6,7 +6,7 @@ import 'package:super_editor/super_editor.dart'; /// its caret. class LoseFocusDemo extends StatefulWidget { @override - _LoseFocusDemoState createState() => _LoseFocusDemoState(); + State createState() => _LoseFocusDemoState(); } class _LoseFocusDemoState extends State { @@ -35,7 +35,7 @@ class _LoseFocusDemoState extends State { _buildTextField(), Expanded( child: SuperEditorDebugVisuals( - config: SuperEditorDebugVisualsConfig( + config: const SuperEditorDebugVisualsConfig( showFocus: true, showImeConnection: true, ), diff --git a/super_editor/example/lib/demos/demo_empty_document.dart b/super_editor/example/lib/demos/demo_empty_document.dart index 6385cd1630..f502530d8c 100644 --- a/super_editor/example/lib/demos/demo_empty_document.dart +++ b/super_editor/example/lib/demos/demo_empty_document.dart @@ -11,7 +11,7 @@ import 'package:super_editor/super_editor.dart'; /// This demo can also be used to quickly hack experiments and tests. class EmptyDocumentDemo extends StatefulWidget { @override - _EmptyDocumentDemoState createState() => _EmptyDocumentDemoState(); + State createState() => _EmptyDocumentDemoState(); } class _EmptyDocumentDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_markdown_serialization.dart b/super_editor/example/lib/demos/demo_markdown_serialization.dart index c1c1373d56..045db0240b 100644 --- a/super_editor/example/lib/demos/demo_markdown_serialization.dart +++ b/super_editor/example/lib/demos/demo_markdown_serialization.dart @@ -11,7 +11,7 @@ import 'package:super_editor_markdown/super_editor_markdown.dart'; /// current structure of the document in the editor. class MarkdownSerializationDemo extends StatefulWidget { @override - _MarkdownSerializationDemoState createState() => _MarkdownSerializationDemoState(); + State createState() => _MarkdownSerializationDemoState(); } class _MarkdownSerializationDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_paragraphs.dart b/super_editor/example/lib/demos/demo_paragraphs.dart index 7133ba2a4d..b6722bc68a 100644 --- a/super_editor/example/lib/demos/demo_paragraphs.dart +++ b/super_editor/example/lib/demos/demo_paragraphs.dart @@ -5,7 +5,7 @@ import 'package:super_editor/super_editor.dart'; /// Example of various paragraph configurations in an editor. class ParagraphsDemo extends StatefulWidget { @override - _ParagraphsDemoState createState() => _ParagraphsDemoState(); + State createState() => _ParagraphsDemoState(); } class _ParagraphsDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_rtl.dart b/super_editor/example/lib/demos/demo_rtl.dart index 175e4be5a8..4d0b6bd144 100644 --- a/super_editor/example/lib/demos/demo_rtl.dart +++ b/super_editor/example/lib/demos/demo_rtl.dart @@ -8,7 +8,7 @@ import 'package:super_editor/super_editor.dart'; /// package expands. class RTLDemo extends StatefulWidget { @override - _RTLDemoState createState() => _RTLDemoState(); + State createState() => _RTLDemoState(); } class _RTLDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_selectable_text.dart b/super_editor/example/lib/demos/demo_selectable_text.dart index 1713bb6bf1..44e57d2ad8 100644 --- a/super_editor/example/lib/demos/demo_selectable_text.dart +++ b/super_editor/example/lib/demos/demo_selectable_text.dart @@ -4,7 +4,7 @@ import 'package:super_text_layout/super_text_layout.dart'; /// Demo of a variety of `SelectableText` configurations. class SelectableTextDemo extends StatefulWidget { @override - _SelectableTextDemoState createState() => _SelectableTextDemoState(); + State createState() => _SelectableTextDemoState(); } class _SelectableTextDemoState extends State { diff --git a/super_editor/example/lib/demos/demo_switch_document_content.dart b/super_editor/example/lib/demos/demo_switch_document_content.dart index 6a9734f17c..0ef9270105 100644 --- a/super_editor/example/lib/demos/demo_switch_document_content.dart +++ b/super_editor/example/lib/demos/demo_switch_document_content.dart @@ -7,7 +7,7 @@ import 'package:super_editor/super_editor.dart'; /// when its content is replaced. class SwitchDocumentDemo extends StatefulWidget { @override - _SwitchDocumentDemoState createState() => _SwitchDocumentDemoState(); + State createState() => _SwitchDocumentDemoState(); } class _SwitchDocumentDemoState extends State { diff --git a/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_android.dart b/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_android.dart index 095c9af590..a56798f287 100644 --- a/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_android.dart +++ b/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_android.dart @@ -11,7 +11,7 @@ import 'keyboard_overlay_clipper.dart'; /// no matter which platform or form factor you use. class MobileEditingAndroidDemo extends StatefulWidget { @override - _MobileEditingAndroidDemoState createState() => _MobileEditingAndroidDemoState(); + State createState() => _MobileEditingAndroidDemoState(); } class _MobileEditingAndroidDemoState extends State { diff --git a/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_ios.dart b/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_ios.dart index d214df0fcf..b5ad06e339 100644 --- a/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_ios.dart +++ b/super_editor/example/lib/demos/editor_configs/demo_mobile_editing_ios.dart @@ -10,7 +10,7 @@ import 'package:super_editor/super_editor.dart'; /// no matter which platform or form factor you use. class MobileEditingIOSDemo extends StatefulWidget { @override - _MobileEditingIOSDemoState createState() => _MobileEditingIOSDemoState(); + State createState() => _MobileEditingIOSDemoState(); } class _MobileEditingIOSDemoState extends State { diff --git a/super_editor/example/lib/demos/example_editor/_toolbar.dart b/super_editor/example/lib/demos/example_editor/_toolbar.dart index 885a89dd90..5c87448dcb 100644 --- a/super_editor/example/lib/demos/example_editor/_toolbar.dart +++ b/super_editor/example/lib/demos/example_editor/_toolbar.dart @@ -52,7 +52,7 @@ class EditorToolbar extends StatefulWidget { final VoidCallback closeToolbar; @override - _EditorToolbarState createState() => _EditorToolbarState(); + State createState() => _EditorToolbarState(); } class _EditorToolbarState extends State { @@ -617,9 +617,9 @@ class _EditorToolbarState extends State { inputSource: TextInputSource.ime, hintBehavior: HintBehavior.displayHintUntilTextEntered, hintBuilder: (context) { - return Text( + return const Text( "enter a url...", - style: const TextStyle( + style: TextStyle( color: Colors.grey, fontSize: 16, ), @@ -723,7 +723,7 @@ class ImageFormatToolbar extends StatefulWidget { final VoidCallback closeToolbar; @override - _ImageFormatToolbarState createState() => _ImageFormatToolbarState(); + State createState() => _ImageFormatToolbarState(); } class _ImageFormatToolbarState extends State { diff --git a/super_editor/example/lib/demos/example_editor/example_editor.dart b/super_editor/example/lib/demos/example_editor/example_editor.dart index d90202636e..2f13857a2a 100644 --- a/super_editor/example/lib/demos/example_editor/example_editor.dart +++ b/super_editor/example/lib/demos/example_editor/example_editor.dart @@ -12,7 +12,7 @@ import '_toolbar.dart'; /// capabilities expand. class ExampleEditor extends StatefulWidget { @override - _ExampleEditorState createState() => _ExampleEditorState(); + State createState() => _ExampleEditorState(); } class _ExampleEditorState extends State { @@ -30,7 +30,7 @@ class _ExampleEditorState extends State { final _darkBackground = const Color(0xFF222222); final _lightBackground = Colors.white; - ValueNotifier _brightness = ValueNotifier(Brightness.light); + final _brightness = ValueNotifier(Brightness.light); SuperEditorDebugVisualsConfig? _debugConfig; @@ -366,7 +366,7 @@ class _ExampleEditorState extends State { setState(() { _debugConfig = _debugConfig != null ? null - : SuperEditorDebugVisualsConfig( + : const SuperEditorDebugVisualsConfig( showFocus: true, showImeConnection: true, ); @@ -412,7 +412,7 @@ class _ExampleEditorState extends State { documentLayoutKey: _docLayoutKey, documentOverlayBuilders: [ DefaultCaretOverlayBuilder( - CaretStyle().copyWith(color: isLight ? Colors.black : Colors.redAccent), + const CaretStyle().copyWith(color: isLight ? Colors.black : Colors.redAccent), ), ], selectionStyle: isLight diff --git a/super_editor/example/lib/demos/experiments/demo_panel_behind_keyboard.dart b/super_editor/example/lib/demos/experiments/demo_panel_behind_keyboard.dart index de62464022..1c27c3a9d7 100644 --- a/super_editor/example/lib/demos/experiments/demo_panel_behind_keyboard.dart +++ b/super_editor/example/lib/demos/experiments/demo_panel_behind_keyboard.dart @@ -154,7 +154,7 @@ class _PanelBehindKeyboardDemoState extends State { _keyboardController.close(); _editor.execute([ - ClearSelectionRequest(), + const ClearSelectionRequest(), ]); // If we clear SuperEditor's selection, but leave SuperEditor focused, then @@ -180,10 +180,10 @@ class _PanelBehindKeyboardDemoState extends State { document: _doc, composer: _composer, softwareKeyboardController: _keyboardController, - selectionPolicies: SuperEditorSelectionPolicies( + selectionPolicies: const SuperEditorSelectionPolicies( clearSelectionWhenEditorLosesFocus: false, ), - imePolicies: SuperEditorImePolicies( + imePolicies: const SuperEditorImePolicies( openKeyboardOnSelectionChange: false, ), ), @@ -193,7 +193,7 @@ class _PanelBehindKeyboardDemoState extends State { left: 0, right: 0, bottom: 0, - child: BehindKeyboardPanel( + child: _BehindKeyboardPanel( keyboardState: _keyboardState, nonKeyboardEditorState: _nonKeyboardEditorState, onOpenKeyboard: _openKeyboard, @@ -207,8 +207,8 @@ class _PanelBehindKeyboardDemoState extends State { } } -class BehindKeyboardPanel extends StatefulWidget { - const BehindKeyboardPanel({ +class _BehindKeyboardPanel extends StatefulWidget { + const _BehindKeyboardPanel({ Key? key, required this.keyboardState, required this.nonKeyboardEditorState, @@ -224,10 +224,10 @@ class BehindKeyboardPanel extends StatefulWidget { final VoidCallback onEndEditing; @override - State createState() => _BehindKeyboardPanelState(); + State<_BehindKeyboardPanel> createState() => __BehindKeyboardPanelState(); } -class _BehindKeyboardPanelState extends State { +class __BehindKeyboardPanelState extends State<_BehindKeyboardPanel> { double _maxBottomInsets = 0.0; double _latestBottomInsets = 0.0; @@ -236,7 +236,7 @@ class _BehindKeyboardPanelState extends State { super.didChangeDependencies(); final newBottomInset = MediaQuery.of(context).viewInsets.bottom; - print("BehindKeyboardPanel didChangeDependencies() - bottom inset: $newBottomInset"); + print("_BehindKeyboardPanel didChangeDependencies() - bottom inset: $newBottomInset"); if (newBottomInset > _maxBottomInsets) { print("Setting max bottom insets to: $newBottomInset"); _maxBottomInsets = newBottomInset; @@ -296,9 +296,9 @@ class _BehindKeyboardPanelState extends State { const SizedBox(width: 24), GestureDetector( onTap: _closeKeyboardAndPanel, - child: Icon(Icons.close), + child: const Icon(Icons.close), ), - Spacer(), + const Spacer(), GestureDetector( onTap: widget.keyboardState.value == _InputState.open ? widget.onCloseKeyboard : widget.onOpenKeyboard, child: Icon(widget.keyboardState.value == _InputState.open ? Icons.keyboard_hide : Icons.keyboard), diff --git a/super_editor/example/lib/demos/flutter_features/demo_inline_widgets.dart b/super_editor/example/lib/demos/flutter_features/demo_inline_widgets.dart index 162cbfcc01..3f5c74cffb 100644 --- a/super_editor/example/lib/demos/flutter_features/demo_inline_widgets.dart +++ b/super_editor/example/lib/demos/flutter_features/demo_inline_widgets.dart @@ -3,7 +3,7 @@ import 'package:flutter/rendering.dart'; class TextInlineWidgetDemo extends StatefulWidget { @override - _TextInlineWidgetDemoState createState() => _TextInlineWidgetDemoState(); + State createState() => _TextInlineWidgetDemoState(); } class _TextInlineWidgetDemoState extends State { @@ -107,10 +107,10 @@ class _TextInlineWidgetDemoState extends State { shape: StadiumBorder(), color: Colors.yellow, ), - child: Row( + child: const Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, - children: const [ + children: [ Icon( Icons.account_circle, size: 14, @@ -136,10 +136,10 @@ class _TextInlineWidgetDemoState extends State { } Widget _buildProgressExample() { - return SelectableText.rich( + return const SelectableText.rich( TextSpan( text: "This is a multi-step item with progress", - style: const TextStyle( + style: TextStyle( color: Colors.black, ), children: [ @@ -148,7 +148,7 @@ class _TextInlineWidgetDemoState extends State { child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, - children: const [ + children: [ SizedBox(width: 8), Icon(Icons.check_circle, color: Colors.green, size: 14), SizedBox(width: 4), diff --git a/super_editor/example/lib/demos/flutter_features/textinputclient/barebones_ios_text_input_client.dart b/super_editor/example/lib/demos/flutter_features/textinputclient/barebones_ios_text_input_client.dart index 62853e61eb..455d4be214 100644 --- a/super_editor/example/lib/demos/flutter_features/textinputclient/barebones_ios_text_input_client.dart +++ b/super_editor/example/lib/demos/flutter_features/textinputclient/barebones_ios_text_input_client.dart @@ -7,7 +7,7 @@ import 'package:super_text_layout/super_text_layout.dart'; /// of a [RawKeyboardListener] or similar. class BarebonesIosTextInputClientDemo extends StatefulWidget { @override - _BarebonesIosTextInputClientDemoState createState() => _BarebonesIosTextInputClientDemoState(); + State createState() => _BarebonesIosTextInputClientDemoState(); } class _BarebonesIosTextInputClientDemoState extends State { diff --git a/super_editor/example/lib/demos/flutter_features/textinputclient/basic_text_input_client.dart b/super_editor/example/lib/demos/flutter_features/textinputclient/basic_text_input_client.dart index c0e0aa267f..704c2a955c 100644 --- a/super_editor/example/lib/demos/flutter_features/textinputclient/basic_text_input_client.dart +++ b/super_editor/example/lib/demos/flutter_features/textinputclient/basic_text_input_client.dart @@ -7,7 +7,7 @@ import 'package:super_text_layout/super_text_layout.dart'; /// of a [RawKeyboardListener] or similar. class BasicTextInputClientDemo extends StatefulWidget { @override - _BasicTextInputClientDemoState createState() => _BasicTextInputClientDemoState(); + State createState() => _BasicTextInputClientDemoState(); } class _BasicTextInputClientDemoState extends State { diff --git a/super_editor/example/lib/demos/flutter_features/textinputclient/textfield.dart b/super_editor/example/lib/demos/flutter_features/textinputclient/textfield.dart index eeee427791..ce577f003b 100644 --- a/super_editor/example/lib/demos/flutter_features/textinputclient/textfield.dart +++ b/super_editor/example/lib/demos/flutter_features/textinputclient/textfield.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class FlutterTextFieldDemo extends StatefulWidget { @override - _FlutterTextFieldDemoState createState() => _FlutterTextFieldDemoState(); + State createState() => _FlutterTextFieldDemoState(); } class _FlutterTextFieldDemoState extends State { diff --git a/super_editor/example/lib/demos/scrolling/demo_task_and_chat_with_customscrollview.dart b/super_editor/example/lib/demos/scrolling/demo_task_and_chat_with_customscrollview.dart index 9ae33cf182..c29a40ef52 100644 --- a/super_editor/example/lib/demos/scrolling/demo_task_and_chat_with_customscrollview.dart +++ b/super_editor/example/lib/demos/scrolling/demo_task_and_chat_with_customscrollview.dart @@ -22,7 +22,7 @@ import 'package:super_editor/super_editor.dart'; /// The layout is implemented with a [CustomScrollView] and relevant `Sliver`s. class TaskAndChatWithCustomScrollViewDemo extends StatefulWidget { @override - _TaskAndChatWithCustomScrollViewDemoState createState() => _TaskAndChatWithCustomScrollViewDemoState(); + State createState() => _TaskAndChatWithCustomScrollViewDemoState(); } class _TaskAndChatWithCustomScrollViewDemoState extends State { @@ -112,13 +112,13 @@ class _TaskAndChatWithCustomScrollViewDemoState extends State _SliverExampleEditorState(); + State createState() => _SliverExampleEditorState(); } class _SliverExampleEditorState extends State { diff --git a/super_editor/example/lib/demos/styles/demo_doc_styles.dart b/super_editor/example/lib/demos/styles/demo_doc_styles.dart index 7bad1df62b..2b578ea7e8 100644 --- a/super_editor/example/lib/demos/styles/demo_doc_styles.dart +++ b/super_editor/example/lib/demos/styles/demo_doc_styles.dart @@ -5,7 +5,7 @@ class DocumentStylesDemo extends StatefulWidget { const DocumentStylesDemo({Key? key}) : super(key: key); @override - _DocumentStylesDemoState createState() => _DocumentStylesDemoState(); + State createState() => _DocumentStylesDemoState(); } class _DocumentStylesDemoState extends State { diff --git a/super_editor/example/lib/demos/super_document/demo_read_only_scrolling_document.dart b/super_editor/example/lib/demos/super_document/demo_read_only_scrolling_document.dart index 35e2eed718..d9e47680be 100644 --- a/super_editor/example/lib/demos/super_document/demo_read_only_scrolling_document.dart +++ b/super_editor/example/lib/demos/super_document/demo_read_only_scrolling_document.dart @@ -11,7 +11,7 @@ import 'package:super_editor/super_editor.dart'; /// the read-only document, and then an infinite number of list items. class ReadOnlyCustomScrollViewDemo extends StatefulWidget { @override - _ReadOnlyCustomScrollViewDemoState createState() => _ReadOnlyCustomScrollViewDemoState(); + State createState() => _ReadOnlyCustomScrollViewDemoState(); } class _ReadOnlyCustomScrollViewDemoState extends State { diff --git a/super_editor/example/lib/demos/supertextfield/_emojis_demo.dart b/super_editor/example/lib/demos/supertextfield/_emojis_demo.dart index 673da05ed4..27480f66d6 100644 --- a/super_editor/example/lib/demos/supertextfield/_emojis_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_emojis_demo.dart @@ -12,7 +12,7 @@ class EmojisTextFieldDemo extends StatefulWidget { final TextAffinity direction; @override - _EmojisTextFieldDemoState createState() => _EmojisTextFieldDemoState(); + State createState() => _EmojisTextFieldDemoState(); } class _EmojisTextFieldDemoState extends State with TickerProviderStateMixin { diff --git a/super_editor/example/lib/demos/supertextfield/_expanding_multi_line_demo.dart b/super_editor/example/lib/demos/supertextfield/_expanding_multi_line_demo.dart index aacb088c06..37aaa04ac7 100644 --- a/super_editor/example/lib/demos/supertextfield/_expanding_multi_line_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_expanding_multi_line_demo.dart @@ -5,7 +5,7 @@ import '_robot.dart'; class ExpandingMultiLineTextFieldDemo extends StatefulWidget { @override - _ExpandingMultiLineTextFieldDemoState createState() => _ExpandingMultiLineTextFieldDemoState(); + State createState() => _ExpandingMultiLineTextFieldDemoState(); } class _ExpandingMultiLineTextFieldDemoState extends State diff --git a/super_editor/example/lib/demos/supertextfield/_interactive_demo.dart b/super_editor/example/lib/demos/supertextfield/_interactive_demo.dart index 8931d7a5ef..eaeaa09afb 100644 --- a/super_editor/example/lib/demos/supertextfield/_interactive_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_interactive_demo.dart @@ -7,7 +7,7 @@ const flutterAttribution = NamedAttribution('flutter'); class InteractiveTextFieldDemo extends StatefulWidget { @override - _InteractiveTextFieldDemoState createState() => _InteractiveTextFieldDemoState(); + State createState() => _InteractiveTextFieldDemoState(); } class _InteractiveTextFieldDemoState extends State { diff --git a/super_editor/example/lib/demos/supertextfield/_mobile_textfield_demo.dart b/super_editor/example/lib/demos/supertextfield/_mobile_textfield_demo.dart index 2fa6368c9f..9b4b5f9e4c 100644 --- a/super_editor/example/lib/demos/supertextfield/_mobile_textfield_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_mobile_textfield_demo.dart @@ -16,7 +16,7 @@ class MobileSuperTextFieldDemo extends StatefulWidget { final Widget Function(MobileTextFieldDemoConfig) createTextField; @override - _MobileSuperTextFieldDemoState createState() => _MobileSuperTextFieldDemoState(); + State createState() => _MobileSuperTextFieldDemoState(); } class _MobileSuperTextFieldDemoState extends State { diff --git a/super_editor/example/lib/demos/supertextfield/_single_line_demo.dart b/super_editor/example/lib/demos/supertextfield/_single_line_demo.dart index 71cd3d57a7..5d5d138093 100644 --- a/super_editor/example/lib/demos/supertextfield/_single_line_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_single_line_demo.dart @@ -5,7 +5,7 @@ import '_robot.dart'; class SingleLineTextFieldDemo extends StatefulWidget { @override - _SingleLineTextFieldDemoState createState() => _SingleLineTextFieldDemoState(); + State createState() => _SingleLineTextFieldDemoState(); } class _SingleLineTextFieldDemoState extends State with TickerProviderStateMixin { diff --git a/super_editor/example/lib/demos/supertextfield/_static_multi_line_demo.dart b/super_editor/example/lib/demos/supertextfield/_static_multi_line_demo.dart index 30dccc1f76..603d2034b2 100644 --- a/super_editor/example/lib/demos/supertextfield/_static_multi_line_demo.dart +++ b/super_editor/example/lib/demos/supertextfield/_static_multi_line_demo.dart @@ -5,7 +5,7 @@ import '_robot.dart'; class StaticMultiLineTextFieldDemo extends StatefulWidget { @override - _StaticMultiLineTextFieldDemoState createState() => _StaticMultiLineTextFieldDemoState(); + State createState() => _StaticMultiLineTextFieldDemoState(); } class _StaticMultiLineTextFieldDemoState extends State with TickerProviderStateMixin { diff --git a/super_editor/example/lib/demos/supertextfield/android/demo_superandroidtextfield.dart b/super_editor/example/lib/demos/supertextfield/android/demo_superandroidtextfield.dart index 98da1e5167..56a1bca6f8 100644 --- a/super_editor/example/lib/demos/supertextfield/android/demo_superandroidtextfield.dart +++ b/super_editor/example/lib/demos/supertextfield/android/demo_superandroidtextfield.dart @@ -6,7 +6,7 @@ import 'package:super_editor/super_editor.dart'; /// Demo of [SuperAndroidTextField]. class SuperAndroidTextFieldDemo extends StatefulWidget { @override - _SuperAndroidTextFieldDemoState createState() => _SuperAndroidTextFieldDemoState(); + State createState() => _SuperAndroidTextFieldDemoState(); } class _SuperAndroidTextFieldDemoState extends State { @@ -46,7 +46,7 @@ class _SuperAndroidTextFieldDemoState extends State { return config.styleBuilder(attributions).copyWith(color: Colors.grey); }).build, selectionColor: Colors.blue.withOpacity(0.4), - caretStyle: CaretStyle(color: Colors.green), + caretStyle: const CaretStyle(color: Colors.green), handlesColor: Colors.lightGreen, minLines: config.minLines, maxLines: config.maxLines, diff --git a/super_editor/example/lib/demos/supertextfield/demo_textfield.dart b/super_editor/example/lib/demos/supertextfield/demo_textfield.dart index 02ca153591..979306d432 100644 --- a/super_editor/example/lib/demos/supertextfield/demo_textfield.dart +++ b/super_editor/example/lib/demos/supertextfield/demo_textfield.dart @@ -1,7 +1,7 @@ import 'package:example/demos/supertextfield/_emojis_demo.dart'; +import 'package:example/demos/supertextfield/_expanding_multi_line_demo.dart'; import 'package:example/demos/supertextfield/_interactive_demo.dart'; import 'package:example/demos/supertextfield/_single_line_demo.dart'; -import 'package:example/demos/supertextfield/_expanding_multi_line_demo.dart'; import 'package:example/demos/supertextfield/_static_multi_line_demo.dart'; import 'package:example/demos/supertextfield/_textfield_demo_screen.dart'; import 'package:flutter/material.dart' hide SelectableText; @@ -20,7 +20,7 @@ import 'package:super_editor/super_editor.dart'; /// Demo of a variety of [SuperTextField] class TextFieldDemo extends StatefulWidget { @override - _TextFieldDemoState createState() => _TextFieldDemoState(); + State createState() => _TextFieldDemoState(); } class _TextFieldDemoState extends State { diff --git a/super_editor/example/lib/demos/supertextfield/ios/demo_superiostextfield.dart b/super_editor/example/lib/demos/supertextfield/ios/demo_superiostextfield.dart index bd55577b63..6afa2739d3 100644 --- a/super_editor/example/lib/demos/supertextfield/ios/demo_superiostextfield.dart +++ b/super_editor/example/lib/demos/supertextfield/ios/demo_superiostextfield.dart @@ -7,7 +7,7 @@ import '../_mobile_textfield_demo.dart'; /// Demo of [SuperIOSTextField]. class SuperIOSTextFieldDemo extends StatefulWidget { @override - _SuperIOSTextFieldDemoState createState() => _SuperIOSTextFieldDemoState(); + State createState() => _SuperIOSTextFieldDemoState(); } class _SuperIOSTextFieldDemoState extends State { @@ -47,7 +47,7 @@ class _SuperIOSTextFieldDemoState extends State { return config.styleBuilder(attributions).copyWith(color: Colors.grey); }).build, selectionColor: Colors.blue.withOpacity(0.4), - caretStyle: CaretStyle(color: Colors.blue), + caretStyle: const CaretStyle(color: Colors.blue), handlesColor: Colors.blue, minLines: config.minLines, maxLines: config.maxLines, diff --git a/super_editor/example/lib/main.dart b/super_editor/example/lib/main.dart index 1e549a2afa..3091974f8b 100644 --- a/super_editor/example/lib/main.dart +++ b/super_editor/example/lib/main.dart @@ -80,7 +80,7 @@ class SuperEditorDemoApp extends StatelessWidget { /// options in a drawer. class HomeScreen extends StatefulWidget { @override - _HomeScreenState createState() => _HomeScreenState(); + State createState() => _HomeScreenState(); } class _HomeScreenState extends State { @@ -304,7 +304,7 @@ final _menu = <_MenuGroup>[ icon: Icons.text_snippet, title: 'SuperReader', pageBuilder: (context) { - return SuperReaderDemo(); + return const SuperReaderDemo(); }, ), _MenuItem( diff --git a/super_editor/example/lib/main_panel_behind_keyboard.dart b/super_editor/example/lib/main_panel_behind_keyboard.dart index 505faaf815..a5b48050b7 100644 --- a/super_editor/example/lib/main_panel_behind_keyboard.dart +++ b/super_editor/example/lib/main_panel_behind_keyboard.dart @@ -18,7 +18,9 @@ void main() { editorImeLog, }); - runApp(MaterialApp( - home: PanelBehindKeyboardDemo(), - )); + runApp( + const MaterialApp( + home: PanelBehindKeyboardDemo(), + ), + ); } diff --git a/super_editor/example/lib/marketing_video/main_marketing_video.dart b/super_editor/example/lib/marketing_video/main_marketing_video.dart index a4a5c91ebb..fdc1e4adfe 100644 --- a/super_editor/example/lib/marketing_video/main_marketing_video.dart +++ b/super_editor/example/lib/marketing_video/main_marketing_video.dart @@ -14,7 +14,7 @@ void main() { class MarketingVideo extends StatefulWidget { @override - _MarketingVideoState createState() => _MarketingVideoState(); + State createState() => _MarketingVideoState(); } class _MarketingVideoState extends State { diff --git a/super_editor/example/pubspec.yaml b/super_editor/example/pubspec.yaml index ca30896384..bb55c37271 100644 --- a/super_editor/example/pubspec.yaml +++ b/super_editor/example/pubspec.yaml @@ -69,6 +69,7 @@ dependency_overrides: dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^2.0.1 # integration_test: # sdk: flutter diff --git a/super_editor/lib/src/test/super_editor_test/supereditor_robot.dart b/super_editor/lib/src/test/super_editor_test/supereditor_robot.dart index b857798c04..dad420aa44 100644 --- a/super_editor/lib/src/test/super_editor_test/supereditor_robot.dart +++ b/super_editor/lib/src/test/super_editor_test/supereditor_robot.dart @@ -286,7 +286,7 @@ extension SuperEditorRobot on WidgetTester { } Future _updateFloatingCursor({required String action, required Offset offset}) async { - await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.handlePlatformMessage( + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.handlePlatformMessage( SystemChannels.textInput.name, SystemChannels.textInput.codec.encodeMethodCall( MethodCall( diff --git a/super_editor/test/infrastructure/content_layers_test.dart b/super_editor/test/infrastructure/content_layers_test.dart index 0ae3611372..d0a9ca5e77 100644 --- a/super_editor/test/infrastructure/content_layers_test.dart +++ b/super_editor/test/infrastructure/content_layers_test.dart @@ -326,11 +326,11 @@ Future _pumpScaffold( WidgetTester tester, { required Widget child, }) async { - addTearDown(() => tester.binding.window.clearAllTestValues()); + addTearDown(() => tester.platformDispatcher.clearAllTestValues()); - tester.binding.window - ..physicalSizeTestValue = _windowSize - ..devicePixelRatioTestValue = 1.0; + tester.view + ..physicalSize = _windowSize + ..devicePixelRatio = 1.0; await tester.pumpWidget( MaterialApp( diff --git a/super_editor/test/src/default_editor/auto_scroll_test.dart b/super_editor/test/src/default_editor/auto_scroll_test.dart index 631737b1bb..bab35b05ba 100644 --- a/super_editor/test/src/default_editor/auto_scroll_test.dart +++ b/super_editor/test/src/default_editor/auto_scroll_test.dart @@ -19,10 +19,10 @@ void main() { (screenSizeWithoutKeyboard.height - screenSizeWithKeyboard.height) / keyboardExpansionFrameCount; testWidgets('on Android, keeps caret visible when keyboard appears', (WidgetTester tester) async { - tester.binding.window - ..physicalSizeTestValue = screenSizeWithoutKeyboard + tester.view + ..physicalSize = screenSizeWithoutKeyboard ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..devicePixelRatioTestValue = 1.0; + ..devicePixelRatio = 1.0; await tester.pumpWidget( const _SliverTestEditor( @@ -56,10 +56,10 @@ void main() { }); testWidgets('on iOS, keeps caret visible when keyboard appears', (WidgetTester tester) async { - tester.binding.window - ..physicalSizeTestValue = screenSizeWithoutKeyboard + tester.view + ..physicalSize = screenSizeWithoutKeyboard ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..devicePixelRatioTestValue = 1.0; + ..devicePixelRatio = 1.0; await tester.pumpWidget( const _SliverTestEditor( @@ -287,7 +287,7 @@ Future _simulateKeyboardAppearance({ // Shrink the height of the screen by a small amount. keyboardHeight += shrinkPerFrame; final currentScreenSize = (initialScreenSize - Offset(0, keyboardHeight)) as Size; - tester.binding.window.physicalSizeTestValue = currentScreenSize; + tester.view.physicalSize = currentScreenSize; // Let the scrolling system auto-scroll, as desired. await tester.pumpAndSettle(); diff --git a/super_editor/test/src/default_editor/caret_test.dart b/super_editor/test/src/default_editor/caret_test.dart index 31ec99b028..bdc49821ea 100644 --- a/super_editor/test/src/default_editor/caret_test.dart +++ b/super_editor/test/src/default_editor/caret_test.dart @@ -95,10 +95,10 @@ void main() { const screenSizeSmaller = Size(250.0, 400.0); testWidgets('moves caret to next line when available width contracts', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizeBigger; + ..physicalSize = screenSizeBigger; final docKey = GlobalKey(); await tester.pumpWidget( @@ -131,10 +131,10 @@ void main() { }); testWidgets('moves caret to preceding line when available width expands', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizeSmaller; + ..physicalSize = screenSizeSmaller; final docKey = GlobalKey(); await tester.pumpWidget( @@ -173,10 +173,10 @@ void main() { group('on Android', () { testWidgets('from portrait to landscape updates caret position', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizePortrait; + ..physicalSize = screenSizePortrait; final docKey = GlobalKey(); await tester.pumpWidget( @@ -198,7 +198,7 @@ void main() { expect(initialCaretOffset, expectedInitialCaretOffset); // Make the window wider, pushing the caret text position up a line. - tester.binding.window.physicalSizeTestValue = screenSizeLandscape; + tester.view.physicalSize = screenSizeLandscape; await tester.pumpAndSettle(); // Ensure that after rotating the phone, the caret updated its (x,y) to match the text @@ -209,10 +209,10 @@ void main() { }); testWidgets('from landscape to portrait updates caret position', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizeLandscape; + ..physicalSize = screenSizeLandscape; final docKey = GlobalKey(); await tester.pumpWidget( @@ -234,7 +234,7 @@ void main() { expect(initialCaretOffset, expectedInitialCaretOffset); // Make the window more narrow, pushing the caret text position up a line. - tester.binding.window.physicalSizeTestValue = screenSizePortrait; + tester.view.physicalSize = screenSizePortrait; await tester.pumpAndSettle(); // Ensure that after rotating the phone, the caret updated its (x,y) to match the text @@ -247,10 +247,10 @@ void main() { group('on iOS', () { testWidgets('from portrait to landscape updates caret position', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizePortrait; + ..physicalSize = screenSizePortrait; final docKey = GlobalKey(); await tester.pumpWidget( @@ -272,7 +272,7 @@ void main() { expect(initialOffset, expectedInitialCaretOffset); // Make the window wider, pushing the caret text position up a line. - tester.binding.window.physicalSizeTestValue = screenSizeLandscape; + tester.view.physicalSize = screenSizeLandscape; await tester.pumpAndSettle(); // Ensure that after rotating the phone, the caret updated its (x,y) to match the text @@ -283,10 +283,10 @@ void main() { }); testWidgets('from landscape to portrait updates caret position', (WidgetTester tester) async { - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..physicalSizeTestValue = screenSizeLandscape; + ..physicalSize = screenSizeLandscape; final docKey = GlobalKey(); await tester.pumpWidget( @@ -308,7 +308,7 @@ void main() { expect(initialOffset, expectedInitialCaretOffset); // Make the window more narrow, pushing the caret text position down a line. - tester.binding.window.physicalSizeTestValue = screenSizePortrait; + tester.view.physicalSize = screenSizePortrait; await tester.pumpAndSettle(); // Ensure that after rotating the phone, the caret updated its (x,y) to match the text @@ -421,7 +421,7 @@ Future _resizeWindow({ resizedWidth += widthShrinkPerFrame; resizedHeight += heightShrinkPerFrame; final currentScreenSize = (initialScreenSize - Offset(resizedWidth, resizedHeight)) as Size; - tester.binding.window.physicalSizeTestValue = currentScreenSize; + tester.view.physicalSize = currentScreenSize; await tester.pumpAndSettle(); } } diff --git a/super_editor/test/src/default_editor/document_input_ime_test.dart b/super_editor/test/src/default_editor/document_input_ime_test.dart index 7088961970..8145eb1463 100644 --- a/super_editor/test/src/default_editor/document_input_ime_test.dart +++ b/super_editor/test/src/default_editor/document_input_ime_test.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test_robots/flutter_test_robots.dart'; -import 'package:logging/logging.dart'; import 'package:super_editor/super_editor.dart'; import 'package:super_editor/super_editor_test.dart'; @@ -107,7 +106,7 @@ void main() { await tester.placeCaretInParagraph("1", 0); // Simulate a "Newline" action from the platform. - await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.handlePlatformMessage( + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.handlePlatformMessage( SystemChannels.textInput.name, SystemChannels.textInput.codec.encodeMethodCall( const MethodCall( diff --git a/super_editor/test/super_editor/infrastructure/editor_test.dart b/super_editor/test/super_editor/infrastructure/editor_test.dart index 5439fe5111..f6a9c38164 100644 --- a/super_editor/test/super_editor/infrastructure/editor_test.dart +++ b/super_editor/test/super_editor/infrastructure/editor_test.dart @@ -563,12 +563,12 @@ StandardEditorPieces _createStandardEditor({ }, requestHandlers: defaultRequestHandlers, reactionPipeline: [ - LinkifyReaction(), - UnorderedListItemConversionReaction(), - OrderedListItemConversionReaction(), - BlockquoteConversionReaction(), - HorizontalRuleConversionReaction(), - ImageUrlConversionReaction(), + const LinkifyReaction(), + const UnorderedListItemConversionReaction(), + const OrderedListItemConversionReaction(), + const BlockquoteConversionReaction(), + const HorizontalRuleConversionReaction(), + const ImageUrlConversionReaction(), ], ); diff --git a/super_editor/test/super_editor/supereditor_gestures_test.dart b/super_editor/test/super_editor/supereditor_gestures_test.dart index 02a458423d..e3d3a58d98 100644 --- a/super_editor/test/super_editor/supereditor_gestures_test.dart +++ b/super_editor/test/super_editor/supereditor_gestures_test.dart @@ -515,7 +515,7 @@ spans multiple lines.''', // add buttons in our test just for this purpose, we'll explicitly // activate interaction mode. context.editContext.editor.execute([ - ChangeInteractionModeRequest(isInteractionModeDesired: true), + const ChangeInteractionModeRequest(isInteractionModeDesired: true), ]); } else if (defaultTargetPlatform == TargetPlatform.macOS) { // Press CMD to activate interaction mode on Mac. diff --git a/super_editor/test/super_editor/supereditor_scrolling_test.dart b/super_editor/test/super_editor/supereditor_scrolling_test.dart index 933989c5b4..fc703a6ba9 100644 --- a/super_editor/test/super_editor/supereditor_scrolling_test.dart +++ b/super_editor/test/super_editor/supereditor_scrolling_test.dart @@ -85,7 +85,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls down", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; await tester // .createDocument() // @@ -130,7 +130,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls up", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; final docContext = await tester // .createDocument() // @@ -196,7 +196,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls to caret position", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; final docContext = await tester // .createDocument() // diff --git a/super_editor/test/super_reader/super_reader_scrolling_test.dart b/super_editor/test/super_reader/super_reader_scrolling_test.dart index 15a6c99255..850c69a9f7 100644 --- a/super_editor/test/super_reader/super_reader_scrolling_test.dart +++ b/super_editor/test/super_reader/super_reader_scrolling_test.dart @@ -1,8 +1,8 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:super_editor/super_reader_test.dart'; import 'package:super_editor/super_editor.dart'; +import 'package:super_editor/super_reader_test.dart'; import '../test_tools.dart'; import 'reader_test_tools.dart'; @@ -84,7 +84,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls down", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; await tester // .createDocument() // @@ -129,7 +129,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls up", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; final testDocContext = await tester // .createDocument() // @@ -185,7 +185,7 @@ void main() { testWidgetsOnDesktop("auto-scrolls to caret position", (tester) async { const windowSize = Size(800, 600); - tester.binding.window.physicalSizeTestValue = windowSize; + tester.view.physicalSize = windowSize; final docContext = await tester // .createDocument() // diff --git a/super_editor/test/super_textfield/super_textfield_auto_scroll_test.dart b/super_editor/test/super_textfield/super_textfield_auto_scroll_test.dart index d3ca4c39e2..ce703522fa 100644 --- a/super_editor/test/super_textfield/super_textfield_auto_scroll_test.dart +++ b/super_editor/test/super_textfield/super_textfield_auto_scroll_test.dart @@ -155,11 +155,11 @@ void _testWidgetsOnMobileWithKeyboard( Future Function(WidgetTester tester, _KeyboardToggle keyboardToggle) test, ) { testWidgetsOnMobile(description, (tester) async { - tester.binding.window - ..physicalSizeTestValue = screenSizeWithoutKeyboard + tester.view + ..physicalSize = screenSizeWithoutKeyboard ..platformDispatcher.textScaleFactorTestValue = 1.0 - ..devicePixelRatioTestValue = 1.0; - addTearDown(() => tester.binding.window.clearAllTestValues()); + ..devicePixelRatio = 1.0; + addTearDown(() => tester.platformDispatcher.clearAllTestValues()); final keyboardToggle = _KeyboardToggle( tester: tester, @@ -196,7 +196,7 @@ class _KeyboardToggle { resizedWidth += widthShrinkPerFrame; resizedHeight += heightShrinkPerFrame; final currentScreenSize = (sizeWithoutKeyboard - Offset(resizedWidth, resizedHeight)) as Size; - tester.binding.window.physicalSizeTestValue = currentScreenSize; + tester.view.physicalSize = currentScreenSize; await tester.pumpAndSettle(); } } diff --git a/super_editor/test/test_tools.dart b/super_editor/test/test_tools.dart index 4f244e115f..fa092a35b7 100644 --- a/super_editor/test/test_tools.dart +++ b/super_editor/test/test_tools.dart @@ -154,8 +154,8 @@ void testWidgetsOnMac( testWidgets(description, (tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.macOS; - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0; try { @@ -202,8 +202,8 @@ void testWidgetsOnWindows( testWidgets(description, (tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.windows; - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0; try { @@ -250,8 +250,8 @@ void testWidgetsOnLinux( testWidgets(description, (tester) async { debugDefaultTargetPlatformOverride = TargetPlatform.linux; - tester.binding.window - ..devicePixelRatioTestValue = 1.0 + tester.view + ..devicePixelRatio = 1.0 ..platformDispatcher.textScaleFactorTestValue = 1.0; try { diff --git a/super_editor/test_goldens/editor/components/_components_test_utils.dart b/super_editor/test_goldens/editor/components/_components_test_utils.dart index 0dbb9337e6..0ebb07fbfa 100644 --- a/super_editor/test_goldens/editor/components/_components_test_utils.dart +++ b/super_editor/test_goldens/editor/components/_components_test_utils.dart @@ -3,9 +3,9 @@ import 'package:golden_toolkit/golden_toolkit.dart'; void testComponentGolden(String description, Widget componentBuilder, String fileName) { testGoldens(description, (tester) async { - tester.binding.window - ..physicalSizeTestValue = const Size(600, 400) - ..devicePixelRatioTestValue = 1.0; + tester.view + ..physicalSize = const Size(600, 400) + ..devicePixelRatio = 1.0; tester.binding.platformDispatcher.textScaleFactorTestValue = 1.0; await tester.pumpWidget( diff --git a/super_editor/test_goldens/editor/mobile/mobile_selection_test.dart b/super_editor/test_goldens/editor/mobile/mobile_selection_test.dart index 3d181e8eb0..da8febc98e 100644 --- a/super_editor/test_goldens/editor/mobile/mobile_selection_test.dart +++ b/super_editor/test_goldens/editor/mobile/mobile_selection_test.dart @@ -723,9 +723,9 @@ void _testParagraphSelection( final docKey = GlobalKey(); testGoldens(description, (tester) async { - tester.binding.window - ..physicalSizeTestValue = const Size(800, 200) - ..devicePixelRatioTestValue = 1.0; + tester.view + ..physicalSize = const Size(800, 200) + ..devicePixelRatio = 1.0; tester.binding.platformDispatcher.textScaleFactorTestValue = 1.0; final dragLine = ValueNotifier<_Line?>(null); @@ -761,7 +761,7 @@ void _testParagraphSelection( // Compare the golden await screenMatchesGolden(tester, goldenName); - tester.binding.window.clearPhysicalSizeTestValue(); + tester.view.resetPhysicalSize(); }); } diff --git a/super_text_layout/example/pubspec.lock b/super_text_layout/example/pubspec.lock index 99ed8825ae..eecc86e3aa 100644 --- a/super_text_layout/example/pubspec.lock +++ b/super_text_layout/example/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "3444216bfd127af50bbe4862d8843ed44db946dd933554f0d7285e89f10e28ac" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a url: "https://pub.dev" source: hosted - version: "50.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "68796c31f510c8455a06fed75fc97d8e5ad04d324a830322ab3efc9feb6201c1" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 url: "https://pub.dev" source: hosted - version: "5.2.0" + version: "5.13.0" args: dependency: transitive description: name: args - sha256: b003c3098049a51720352d219b0bb5f219b60fbfb68e7a4748139a06a5676515 + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: attributed_text - sha256: "892b9517ba27f78ebee526424a91d1aba44d729e610f06a0dd9a3a43d3d81f6d" + sha256: e43495051b63e6cdbe96aa62123974074cca109d9c56f74ce2ffaec8060e044e url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.2.2" boolean_selector: dependency: transitive description: @@ -69,10 +69,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" convert: dependency: transitive description: @@ -85,18 +85,18 @@ packages: dependency: transitive description: name: coverage - sha256: d2494157c32b303f47dedee955b1479f2979c4ff66934eb7c0def44fd9e0267a + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" url: "https://pub.dev" source: hosted - version: "1.6.1" + version: "1.6.3" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" fake_async: dependency: transitive description: @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.0" flutter: dependency: "direct main" description: flutter @@ -143,10 +143,10 @@ packages: dependency: transitive description: name: glob - sha256: c51b4fdfee4d281f49b8c957f1add91b815473597f76bcf07377987f66a55729 + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" http_multi_server: dependency: transitive description: @@ -167,10 +167,10 @@ packages: dependency: transitive description: name: io - sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" js: dependency: transitive description: @@ -191,26 +191,26 @@ packages: dependency: transitive description: name: logging - sha256: c0bbfe94d46aedf9b8b3e695cf3bd48c8e14b35e3b2c639e0aa7755d589ba946 + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: @@ -223,18 +223,18 @@ packages: dependency: transitive description: name: mime - sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.0.4" node_preamble: dependency: transitive description: name: node_preamble - sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" package_config: dependency: transitive description: @@ -263,42 +263,42 @@ packages: dependency: transitive description: name: pub_semver - sha256: b959af0a045c3484c4a8f4997731f5bfe4cac60d732fd8ce35b351f2d6a459fe + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" shelf: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - sha256: aef74dc9195746a384843102142ab65b6a4735bb3beea791e63527b88cc83306 + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" sky_engine: dependency: transitive description: flutter @@ -316,18 +316,18 @@ packages: dependency: transitive description: name: source_maps - sha256: "490098075234dcedb83c5d949b4c93dad5e6b7702748de000be2b57b8e6b2427" + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" url: "https://pub.dev" source: hosted - version: "0.10.11" + version: "0.10.12" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -358,7 +358,7 @@ packages: path: ".." relative: true source: path - version: "0.1.5" + version: "0.1.6" term_glyph: dependency: transitive description: @@ -371,34 +371,34 @@ packages: dependency: transitive description: name: test - sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" url: "https://pub.dev" source: hosted - version: "1.24.1" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.5.3" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" vector_math: dependency: transitive description: @@ -411,26 +411,26 @@ packages: dependency: transitive description: name: vm_service - sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + sha256: f3743ca475e0c9ef71df4ba15eb2d7684eecd5c8ba20a462462e4e8b561b2e11 url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "11.6.0" watcher: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.0" webkit_inspection_protocol: dependency: transitive description: @@ -443,10 +443,10 @@ packages: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=3.0.0-0 <4.0.0" + dart: ">=3.0.0 <4.0.0" flutter: ">=1.17.0" diff --git a/website/analysis_options.yaml b/website/analysis_options.yaml index 26128b951e..55309e9e03 100644 --- a/website/analysis_options.yaml +++ b/website/analysis_options.yaml @@ -1 +1 @@ -include: package:lint/analysis_options.yaml \ No newline at end of file +include: package:lint/analysis_options.yaml diff --git a/website/lib/homepage/call_to_action.dart b/website/lib/homepage/call_to_action.dart index 3d3a7a25a3..b3c716eef1 100644 --- a/website/lib/homepage/call_to_action.dart +++ b/website/lib/homepage/call_to_action.dart @@ -43,8 +43,10 @@ class _DocumentationButton extends StatelessWidget { return MaterialButton( color: const Color(0xFFFAE74F), - onPressed: () => launch( - 'https://github.com/superlistapp/super_editor/blob/main/super_editor/README.md', + onPressed: () => launchUrl( + Uri.parse( + 'https://github.com/superlistapp/super_editor/blob/main/super_editor/README.md', + ), ), padding: singleColumnLayout ? const EdgeInsets.symmetric(horizontal: 32, vertical: 20) diff --git a/website/lib/homepage/editor_toolbar.dart b/website/lib/homepage/editor_toolbar.dart index bdab5ba948..79c50be250 100644 --- a/website/lib/homepage/editor_toolbar.dart +++ b/website/lib/homepage/editor_toolbar.dart @@ -14,6 +14,7 @@ class EditorToolbar extends StatefulWidget { const EditorToolbar({ Key? key, required this.anchor, + required this.doc, required this.editor, required this.composer, required this.closeToolbar, @@ -26,11 +27,13 @@ class EditorToolbar extends StatefulWidget { /// reposition itself as the [Offset] value changes. final ValueNotifier anchor; + final MutableDocument doc; + /// The [editor] is used to alter document content, such as /// when the user selects a different block format for a /// text blob, e.g., paragraph, header, blockquote, or /// to apply styles to text. - final DocumentEditor editor; + final Editor editor; /// The [composer] provides access to the user's current /// selection within the document, which dictates the @@ -75,7 +78,7 @@ class _EditorToolbarState extends State { return false; } - final selectedNode = widget.editor.document.getNodeById(selection.extent.nodeId); + final selectedNode = widget.doc.getNodeById(selection.extent.nodeId); return selectedNode is ParagraphNode || selectedNode is ListItemNode; } @@ -84,7 +87,7 @@ class _EditorToolbarState extends State { /// Throws an exception if the currently selected node is not a text node. _TextType _getCurrentTextType() { final selection = widget.composer.selection!; - final selectedNode = widget.editor.document.getNodeById(selection.extent.nodeId); + final selectedNode = widget.doc.getNodeById(selection.extent.nodeId); if (selectedNode is ParagraphNode) { final type = selectedNode.metadata['blockType']; @@ -111,7 +114,7 @@ class _EditorToolbarState extends State { /// Throws an exception if the currently selected node is not a text node. TextAlign _getCurrentTextAlignment() { final selection = widget.composer.selection!; - final selectedNode = widget.editor.document.getNodeById(selection.extent.nodeId); + final selectedNode = widget.doc.getNodeById(selection.extent.nodeId); if (selectedNode is ParagraphNode) { final align = selectedNode.metadata['textAlign'] as String?; switch (align) { @@ -139,7 +142,7 @@ class _EditorToolbarState extends State { return false; } - final selectedNode = widget.editor.document.getNodeById(selection.extent.nodeId); + final selectedNode = widget.doc.getNodeById(selection.extent.nodeId); return selectedNode is ParagraphNode; } @@ -161,32 +164,38 @@ class _EditorToolbarState extends State { } if (_isListItem(existingTextType) && _isListItem(newType)) { - widget.editor.executeCommand( - ChangeListItemTypeCommand( - nodeId: widget.composer.selection!.extent.nodeId, - newType: newType == _TextType.orderedListItem ? ListItemType.ordered : ListItemType.unordered, - ), + widget.editor.execute( + [ + ChangeListItemTypeRequest( + nodeId: widget.composer.selection!.extent.nodeId, + newType: newType == _TextType.orderedListItem ? ListItemType.ordered : ListItemType.unordered, + ), + ], ); } else if (_isListItem(existingTextType) && !_isListItem(newType)) { - widget.editor.executeCommand( - ConvertListItemToParagraphCommand( - nodeId: widget.composer.selection!.extent.nodeId, - paragraphMetadata: { - 'blockType': _getBlockTypeAttribution(newType), - }, - ), + widget.editor.execute( + [ + ConvertListItemToParagraphRequest( + nodeId: widget.composer.selection!.extent.nodeId, + paragraphMetadata: { + 'blockType': _getBlockTypeAttribution(newType), + }, + ), + ], ); } else if (!_isListItem(existingTextType) && _isListItem(newType)) { - widget.editor.executeCommand( - ConvertParagraphToListItemCommand( - nodeId: widget.composer.selection!.extent.nodeId, - type: newType == _TextType.orderedListItem ? ListItemType.ordered : ListItemType.unordered, - ), + widget.editor.execute( + [ + ConvertParagraphToListItemRequest( + nodeId: widget.composer.selection!.extent.nodeId, + type: newType == _TextType.orderedListItem ? ListItemType.ordered : ListItemType.unordered, + ), + ], ); } else { // Apply a new block type to an existing paragraph node. - final existingNode = widget.editor.document.getNodeById(widget.composer.selection!.extent.nodeId)!; - (existingNode as ParagraphNode).metadata['blockType'] = _getBlockTypeAttribution(newType); + final existingNode = widget.doc.getNodeById(widget.composer.selection!.extent.nodeId); + (existingNode! as ParagraphNode).metadata['blockType'] = _getBlockTypeAttribution(newType); // Merely changing the blockType of the ParagraphNode does not trigger any of the document listeners. // @@ -224,31 +233,37 @@ class _EditorToolbarState extends State { /// Toggles bold styling for the current selected text. void _toggleBold() { - widget.editor.executeCommand( - ToggleTextAttributionsCommand( - documentSelection: widget.composer.selection!, - attributions: {boldAttribution}, - ), + widget.editor.execute( + [ + ToggleTextAttributionsRequest( + documentSelection: widget.composer.selection!, + attributions: {boldAttribution}, + ), + ], ); } /// Toggles italic styling for the current selected text. void _toggleItalics() { - widget.editor.executeCommand( - ToggleTextAttributionsCommand( - documentSelection: widget.composer.selection!, - attributions: {italicsAttribution}, - ), + widget.editor.execute( + [ + ToggleTextAttributionsRequest( + documentSelection: widget.composer.selection!, + attributions: {italicsAttribution}, + ), + ], ); } /// Toggles strikethrough styling for the current selected text. void _toggleStrikethrough() { - widget.editor.executeCommand( - ToggleTextAttributionsCommand( - documentSelection: widget.composer.selection!, - attributions: {strikethroughAttribution}, - ), + widget.editor.execute( + [ + ToggleTextAttributionsRequest( + documentSelection: widget.composer.selection!, + attributions: {strikethroughAttribution}, + ), + ], ); } @@ -275,7 +290,7 @@ class _EditorToolbarState extends State { final selectionEnd = max(baseOffset, extentOffset); final selectionRange = SpanRange(start: selectionStart, end: selectionEnd - 1); - final textNode = widget.editor.document.getNodeById(selection.extent.nodeId)! as TextNode; + final textNode = widget.doc.getNodeById(selection.extent.nodeId)! as TextNode; final text = textNode.text; final overlappingLinkAttributions = text.getAttributionSpansInRange( @@ -296,7 +311,7 @@ class _EditorToolbarState extends State { final selectionEnd = max(baseOffset, extentOffset); final selectionRange = SpanRange(start: selectionStart, end: selectionEnd - 1); - final textNode = widget.editor.document.getNodeById(selection.extent.nodeId)! as TextNode; + final textNode = widget.doc.getNodeById(selection.extent.nodeId)! as TextNode; final text = textNode.text; final overlappingLinkAttributions = text.getAttributionSpansInRange( @@ -349,7 +364,7 @@ class _EditorToolbarState extends State { final selectionEnd = max(baseOffset, extentOffset); final selectionRange = SpanRange(start: selectionStart, end: selectionEnd - 1); - final textNode = widget.editor.document.getNodeById(selection.extent.nodeId)! as TextNode; + final textNode = widget.doc.getNodeById(selection.extent.nodeId)! as TextNode; final text = textNode.text; final trimmedRange = _trimTextRangeWhitespace(text, selectionRange); @@ -410,7 +425,7 @@ class _EditorToolbarState extends State { return; } - final selectedNode = widget.editor.document.getNodeById(widget.composer.selection!.extent.nodeId)! as ParagraphNode; + final selectedNode = widget.doc.getNodeById(widget.composer.selection!.extent.nodeId)! as ParagraphNode; selectedNode.metadata['textAlign'] = newAlignmentValue; } @@ -491,28 +506,27 @@ class _EditorToolbarState extends State { // Only allow the user to select a new type of text node if // the currently selected node can be converted. if (_isConvertibleNode()) ...[ - Tooltip( - message: 'Text block type', - child: DropdownButton<_TextType>( - value: _getCurrentTextType(), - items: _TextType.values - .map((textType) => DropdownMenuItem<_TextType>( - value: textType, - child: Padding( - padding: const EdgeInsets.only(left: 16.0), - child: Text(_getTextTypeName(textType)), - ), - )) - .toList(), - icon: const Icon(Icons.arrow_drop_down), - style: const TextStyle( - color: Colors.black, - fontSize: 12, - ), - underline: const SizedBox(), - elevation: 0, - onChanged: _convertTextToNewType, + DropdownButton<_TextType>( + value: _getCurrentTextType(), + items: _TextType.values + .map( + (textType) => DropdownMenuItem<_TextType>( + value: textType, + child: Padding( + padding: const EdgeInsets.only(left: 16.0), + child: Text(_getTextTypeName(textType)), + ), + ), + ) + .toList(), + icon: const Icon(Icons.arrow_drop_down), + style: const TextStyle( + color: Colors.black, + fontSize: 12, ), + underline: const SizedBox(), + elevation: 0, + onChanged: _convertTextToNewType, ), _buildVerticalDivider(), ], @@ -555,28 +569,27 @@ class _EditorToolbarState extends State { // node respects alignment. List items, for example, do not. if (_isTextAlignable()) ...[ _buildVerticalDivider(), - Tooltip( - message: 'Text Alignment', - child: DropdownButton( - value: _getCurrentTextAlignment(), - items: [TextAlign.left, TextAlign.center, TextAlign.right, TextAlign.justify] - .map((textAlign) => DropdownMenuItem( - value: textAlign, - child: Padding( - padding: const EdgeInsets.only(left: 8.0), - child: Icon(_buildTextAlignIcon(textAlign)), - ), - )) - .toList(), - icon: const Icon(Icons.arrow_drop_down), - style: const TextStyle( - color: Colors.black, - fontSize: 12, - ), - underline: const SizedBox(), - elevation: 0, - onChanged: _changeAlignment, + DropdownButton( + value: _getCurrentTextAlignment(), + items: [TextAlign.left, TextAlign.center, TextAlign.right, TextAlign.justify] + .map( + (textAlign) => DropdownMenuItem( + value: textAlign, + child: Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Icon(_buildTextAlignIcon(textAlign)), + ), + ), + ) + .toList(), + icon: const Icon(Icons.arrow_drop_down), + style: const TextStyle( + color: Colors.black, + fontSize: 12, ), + underline: const SizedBox(), + elevation: 0, + onChanged: _changeAlignment, ), ], ], diff --git a/website/lib/homepage/featured_editor.dart b/website/lib/homepage/featured_editor.dart index c11caa3fcb..ba72b34fc1 100644 --- a/website/lib/homepage/featured_editor.dart +++ b/website/lib/homepage/featured_editor.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:super_editor/super_editor.dart'; - -import 'editor_toolbar.dart'; +import 'package:website/homepage/editor_toolbar.dart'; /// A Super Editor that displays itself on top of a white sheet of paper /// with a popup editor toolbar. @@ -27,8 +26,8 @@ class _FeaturedEditorState extends State { final _docLayoutKey = GlobalKey(); late final MutableDocument _doc; - late final DocumentEditor _docEditor; - late final DocumentComposer _composer; + late final Editor _docEditor; + late final MutableDocumentComposer _composer; late final FocusNode _editorFocusNode; late final ScrollController _scrollController; @@ -41,11 +40,7 @@ class _FeaturedEditorState extends State { super.initState(); // Create the initial document content. - _doc = _createInitialDocument()..addListener(_updateToolbarDisplay); - - // Create the DocumentEditor, which is responsible for applying all - // content changes to the Document. - _docEditor = DocumentEditor(document: _doc); + _doc = _createInitialDocument()..addListener(_onDocumentChange); // Create the DocumentComposer, which keeps track of the user's text // selection and the current input styles, e.g., bold or italics. @@ -54,7 +49,7 @@ class _FeaturedEditorState extends State { // over the initial caret position. If you don't need any external // control over content selection then you don't need to create your // own DocumentComposer. The Editor widget will do that on your behalf. - _composer = DocumentComposer( + _composer = MutableDocumentComposer( initialSelection: DocumentSelection.collapsed( position: DocumentPosition( nodeId: _doc.nodes.last.id, // Place caret at end of document @@ -63,6 +58,10 @@ class _FeaturedEditorState extends State { ), )..addListener(_updateToolbarDisplay); + // Create the DocumentEditor, which is responsible for applying all + // content changes to the Document. + _docEditor = createDefaultDocumentEditor(document: _doc, composer: _composer); + // Create a FocusNode so that we can explicitly toggle editor focus. _editorFocusNode = FocusNode(); @@ -87,6 +86,7 @@ class _FeaturedEditorState extends State { _formatBarOverlayEntry ??= OverlayEntry( builder: (context) { return EditorToolbar( + doc: _doc, anchor: _selectionAnchor, editor: _docEditor, composer: _composer, @@ -97,7 +97,7 @@ class _FeaturedEditorState extends State { // Display the toolbar in the application overlay. final overlay = Overlay.of(context); - overlay!.insert(_formatBarOverlayEntry!); + overlay.insert(_formatBarOverlayEntry!); // Schedule a callback after this frame to locate the selection // bounds on the screen and display the toolbar near the selected @@ -153,6 +153,10 @@ class _FeaturedEditorState extends State { _editorFocusNode.requestFocus(); } + void _onDocumentChange(_) { + _updateToolbarDisplay(); + } + void _updateToolbarDisplay() { final selection = _composer.selection; if (selection == null) { @@ -198,6 +202,7 @@ class _FeaturedEditorState extends State { Widget build(BuildContext context) { return SuperEditor( editor: _docEditor, + document: _doc, composer: _composer, documentLayoutKey: _docLayoutKey, focusNode: _editorFocusNode, @@ -232,7 +237,7 @@ MutableDocument _createInitialDocument() { return MutableDocument( nodes: [ ParagraphNode( - id: DocumentEditor.createNodeId(), + id: Editor.createNodeId(), text: AttributedText( text: 'A supercharged rich text editor for Flutter', ), @@ -242,7 +247,7 @@ MutableDocument _createInitialDocument() { }, ), ParagraphNode( - id: DocumentEditor.createNodeId(), + id: Editor.createNodeId(), text: AttributedText( text: 'The missing WYSIWYG editor for Flutter.', spans: AttributedSpans( @@ -262,7 +267,7 @@ MutableDocument _createInitialDocument() { ), ), ParagraphNode( - id: DocumentEditor.createNodeId(), + id: Editor.createNodeId(), text: AttributedText( text: 'Open source and written entirely in Dart. Comes with a modular architecture that allows you to customize it to your needs.', @@ -283,7 +288,7 @@ MutableDocument _createInitialDocument() { ), ), ParagraphNode( - id: DocumentEditor.createNodeId(), + id: Editor.createNodeId(), text: AttributedText( text: 'Try it right here >>', ), diff --git a/website/lib/homepage/footer.dart b/website/lib/homepage/footer.dart index b6db9612ef..afdeff045f 100644 --- a/website/lib/homepage/footer.dart +++ b/website/lib/homepage/footer.dart @@ -14,16 +14,16 @@ class Footer extends StatelessWidget { margin: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(vertical: 24), child: singleColumnLayout - ? Column( - children: const [ + ? const Column( + children: [ _LeftPart(), SizedBox(height: 28), _RightPart(), ], ) - : Row( + : const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ _LeftPart(), _RightPart(), ], @@ -144,7 +144,7 @@ class _Link extends StatelessWidget { cursor: SystemMouseCursors.click, child: GestureDetector( behavior: HitTestBehavior.opaque, - onTap: () => launch(url), + onTap: () => launchUrl(Uri.parse(url)), child: IntrinsicWidth( child: Stack( clipBehavior: Clip.none, diff --git a/website/lib/homepage/header.dart b/website/lib/homepage/header.dart index 6542b8068e..4bb68a3fb6 100644 --- a/website/lib/homepage/header.dart +++ b/website/lib/homepage/header.dart @@ -30,8 +30,8 @@ class Header extends StatelessWidget { } Widget _buildNavBar() { - return Row( - children: const [ + return const Row( + children: [ _Link( url: 'https://github.com/superlistapp/super_editor', child: Text('Github'), @@ -122,8 +122,8 @@ class _DrawerLayoutState extends State { height: 44, ), ), - Column( - children: const [ + const Column( + children: [ SizedBox(height: 16), _Link( url: 'https://github.com/superlistapp/super_editor', @@ -166,7 +166,7 @@ class _Link extends StatelessWidget { @override Widget build(BuildContext context) { return TextButton( - onPressed: () => launch(url), + onPressed: () => launchUrl(Uri.parse(url)), style: ButtonStyle( foregroundColor: MaterialStateProperty.all(Colors.white), minimumSize: MaterialStateProperty.all(const Size(72, 48)), @@ -189,7 +189,7 @@ class _DownloadButton extends StatelessWidget { Widget build(BuildContext context) { return MaterialButton( color: const Color(0xFFFAE74F), - onPressed: () => launch('https://pub.dev/packages/super_editor'), + onPressed: () => launchUrl(Uri.parse('https://pub.dev/packages/super_editor')), padding: const EdgeInsets.symmetric(horizontal: 32), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(64)), height: 52, diff --git a/website/lib/homepage/home_page.dart b/website/lib/homepage/home_page.dart index fb4262ef3b..934bb6c1e6 100644 --- a/website/lib/homepage/home_page.dart +++ b/website/lib/homepage/home_page.dart @@ -1,14 +1,13 @@ import 'package:flutter/material.dart'; +import 'package:website/breakpoints.dart'; +import 'package:website/homepage/call_to_action.dart'; +import 'package:website/homepage/editor_video_showcase.dart'; import 'package:website/homepage/featured_editor.dart'; +import 'package:website/homepage/features.dart'; +import 'package:website/homepage/footer.dart'; +import 'package:website/homepage/header.dart'; import 'package:website/homepage/inside_the_toolbox.dart'; -import '../breakpoints.dart'; -import 'call_to_action.dart'; -import 'editor_video_showcase.dart'; -import 'features.dart'; -import 'footer.dart'; -import 'header.dart'; - class HomePage extends StatelessWidget { const HomePage(); @@ -107,7 +106,7 @@ class HomePage extends StatelessWidget { ), child: SingleChildScrollView( child: FeaturedEditor( - displayMode: displayMode, + displayMode: displayMode, ), ), ), diff --git a/website/lib/homepage/inside_the_toolbox.dart b/website/lib/homepage/inside_the_toolbox.dart index 57bf2c5744..45796852a6 100644 --- a/website/lib/homepage/inside_the_toolbox.dart +++ b/website/lib/homepage/inside_the_toolbox.dart @@ -96,10 +96,10 @@ class InsideTheToolbox extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(4), - ), + ), child: SuperTextWithSelection.single( richText: const TextSpan( - text: 'This text is selectable. The caret and selection rendering is custom.', + text: 'This text is selectable. The caret and selection rendering is custom.', style: TextStyle( color: Colors.black, fontSize: 16, @@ -110,9 +110,8 @@ class InsideTheToolbox extends StatelessWidget { baseOffset: 13, extentOffset: 23, ), - ), - ), + ), ), ), ); @@ -195,22 +194,22 @@ class _AttributedTextDemoState extends State<_AttributedTextDemo> { } void _computeStyledText() { - final _text = AttributedText( + final text = AttributedText( text: 'This is some text styled with AttributedText', ); for (final range in _boldRanges) { - _text.addAttribution(boldAttribution, range); + text.addAttribution(boldAttribution, range); } for (final range in _italicsRanges) { - _text.addAttribution(italicsAttribution, range); + text.addAttribution(italicsAttribution, range); } for (final range in _strikethroughRanges) { - _text.addAttribution(strikethroughAttribution, range); + text.addAttribution(strikethroughAttribution, range); } setState(() { - _richText = _text.computeTextSpan((Set attributions) { + _richText = text.computeTextSpan((Set attributions) { TextStyle newStyle = const TextStyle( color: Colors.white, fontSize: 30, @@ -272,21 +271,23 @@ class _AttributedTextDemoState extends State<_AttributedTextDemo> { } Widget _buildCellSelector(List rangesToUpdate) { - return LayoutBuilder(builder: (context, constraints) { - final cellWidth = constraints.maxWidth / _plainText.length; - - return TextRangeSelector( - cellCount: _plainText.length, - cellWidth: cellWidth, - cellHeight: 20, - onRangesChange: (newRanges) { - rangesToUpdate - ..clear() - ..addAll(newRanges); - _computeStyledText(); - }, - ); - }); + return LayoutBuilder( + builder: (context, constraints) { + final cellWidth = constraints.maxWidth / _plainText.length; + + return TextRangeSelector( + cellCount: _plainText.length, + cellWidth: cellWidth, + cellHeight: 20, + onRangesChange: (newRanges) { + rangesToUpdate + ..clear() + ..addAll(newRanges); + _computeStyledText(); + }, + ); + }, + ); } } @@ -344,7 +345,7 @@ class _TextRangeSelectorState extends State { } int _getCellIndexFromLocalOffset(Offset localOffset) { - return ((localOffset.dx / widget.cellWidth).floor()).clamp(0.0, widget.cellCount - 1).toInt(); + return (localOffset.dx / widget.cellWidth).floor().clamp(0.0, widget.cellCount - 1).toInt(); } void _reportSelectedRanges() { diff --git a/website/pubspec.lock b/website/pubspec.lock index 2341401d9b..ec64dd99fd 100644 --- a/website/pubspec.lock +++ b/website/pubspec.lock @@ -5,112 +5,120 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" source: hosted - version: "31.0.0" + version: "61.0.0" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" source: hosted - version: "2.8.0" + version: "5.13.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "37a4264b0b7fb930e94c0c47558f3b6c4f4e9cb7e655a3ea373131d79b2dc0cc" + url: "https://pub.dev" source: hosted version: "2.0.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" attributed_text: dependency: transitive description: name: attributed_text - url: "https://pub.dartlang.org" + sha256: e43495051b63e6cdbe96aa62123974074cca109d9c56f74ce2ffaec8060e044e + url: "https://pub.dev" source: hosted - version: "0.1.1" + version: "0.2.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.5" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.17.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + sha256: f08428ad63615f96a27e34221c65e1a451439b5f26030f78d790f461c686d65d + url: "https://pub.dev" source: hosted version: "3.0.1" coverage: dependency: transitive description: name: coverage - url: "https://pub.dartlang.org" + sha256: ad538fa2e8f6b828d54c04a438af816ce814de404690136d3b9dfb3a436cd01c + url: "https://pub.dev" source: hosted version: "1.0.3" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + url: "https://pub.dev" source: hosted version: "6.1.2" flutter: @@ -118,203 +126,238 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_lints: - dependency: transitive - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_test_robots: + dependency: transitive + description: + name: flutter_test_robots + sha256: e43d82bce5c17813b1b47b8228a2369936cfe7d73981002bc919b510de350d08 + url: "https://pub.dev" + source: hosted + version: "0.0.18" flutter_web_plugins: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + follow_the_leader: + dependency: transitive + description: + name: follow_the_leader + sha256: "4e74bcf1ed3b4ce9c6743ee9f24bc68c0cf017ca3731d849018eb083c60687fe" + url: "https://pub.dev" + source: hosted + version: "0.0.4+2" frontend_server_client: dependency: transitive description: name: frontend_server_client - url: "https://pub.dartlang.org" + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "3.2.0" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + sha256: "8321dd2c0ab0683a91a51307fa844c6db4aa8e3981219b78961672aaab434658" + url: "https://pub.dev" source: hosted version: "2.0.2" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "2e8cf3a1b5a97ec9f88ec74fce83a3e05196df027f382ba3f94403b75292fabf" + url: "https://pub.dev" source: hosted version: "0.13.1" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.dartlang.org" + sha256: ab298ef2b2acd283bd36837df7801dcf6e6b925f8da6e09efb81111230aa9037 + url: "https://pub.dev" source: hosted version: "3.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" io: dependency: transitive description: name: io - url: "https://pub.dartlang.org" + sha256: "0d4c73c3653ab85bf696d51a9657604c900a370549196a91f33e4c39af760852" + url: "https://pub.dev" source: hosted version: "1.0.3" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" linkify: dependency: transitive description: name: linkify - url: "https://pub.dartlang.org" + sha256: f27f2930577bb65a5d8f2b0676404f3c89a1f354fcb1cf14b96df34e50cddf43 + url: "https://pub.dev" source: hosted version: "4.0.0" lint: dependency: "direct dev" description: name: lint - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.3" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" + sha256: f4bd4dbaa39f4ae8836f2d1275f2f32bc68b3a8cce0a0735dd1f7a601f06682a + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.1.2" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + sha256: "293ae2d49fd79d4c04944c3a26dfd313382d5f52e821ec57119230ae16031ad4" + url: "https://pub.dev" source: hosted version: "1.0.2" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.5.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.9.1" mime: dependency: transitive description: name: mime - url: "https://pub.dartlang.org" + sha256: dab22e92b41aa1255ea90ddc4bc2feaf35544fd0728e209638cad041a6e3928a + url: "https://pub.dev" source: hosted version: "1.0.2" node_preamble: dependency: transitive description: name: node_preamble - url: "https://pub.dartlang.org" + sha256: "8ebdbaa3b96d5285d068f80772390d27c21e1fa10fb2df6627b1b9415043608d" + url: "https://pub.dev" source: hosted version: "2.0.1" + overlord: + dependency: transitive + description: + name: overlord + sha256: "7fa6a83455b7da5c66a16320c02783d110c574a6e6c511750c662dbadfe9399f" + url: "https://pub.dev" + source: hosted + version: "0.0.3+2" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + sha256: a4d5ede5ca9c3d88a2fef1147a078570c861714c806485c596b109819135bc12 + url: "https://pub.dev" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "8f6460c77a98ad2807cd3b98c67096db4286f56166852d0ce5951bb600a63594" + url: "https://pub.dev" source: hosted version: "1.11.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.4" pool: dependency: transitive description: name: pool - url: "https://pub.dartlang.org" + sha256: "05955e3de2683e1746222efd14b775df7131139e07695dc8e24650f6b4204504" + url: "https://pub.dev" source: hosted version: "1.5.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + sha256: "816c1a640e952d213ddd223b3e7aafae08cd9f8e1f6864eed304cc13b0272b07" + url: "https://pub.dev" source: hosted version: "2.1.1" shelf: dependency: transitive description: name: shelf - url: "https://pub.dartlang.org" + sha256: "4592f6cb6c417632ebdfb63e4db42a7e3ad49d1bd52d9f93b6eb883035ddc0c3" + url: "https://pub.dev" source: hosted version: "1.3.0" shelf_packages_handler: dependency: transitive description: name: shelf_packages_handler - url: "https://pub.dartlang.org" + sha256: e0b44ebddec91e70a713e13adf93c1b2100821303b86a18e1ef1d082bd8bd9b8 + url: "https://pub.dev" source: hosted version: "3.0.0" shelf_static: dependency: transitive description: name: shelf_static - url: "https://pub.dartlang.org" + sha256: "4a0d12cd512aa4fc55fed5f6280f02ef183f47ba29b4b0dfd621b1c99b7e6361" + url: "https://pub.dev" source: hosted version: "1.1.0" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.dartlang.org" + sha256: fd84910bf7d58db109082edf7326b75322b8f186162028482f53dc892f00332d + url: "https://pub.dev" source: hosted version: "1.0.1" sky_engine: @@ -326,184 +369,225 @@ packages: dependency: transitive description: name: source_map_stack_trace - url: "https://pub.dartlang.org" + sha256: "8c463326277f68a628abab20580047b419c2ff66756fd0affd451f73f9508c11" + url: "https://pub.dev" source: hosted version: "2.1.0" source_maps: dependency: transitive description: name: source_maps - url: "https://pub.dartlang.org" + sha256: "52de2200bb098de739794c82d09c41ac27b2e42fd7e23cce7b9c74bf653c7296" + url: "https://pub.dev" source: hosted version: "0.10.10" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" super_editor: dependency: "direct main" description: path: "../super_editor" relative: true source: path - version: "0.2.0" + version: "0.2.6-dev.1" super_text_layout: dependency: "direct main" description: name: super_text_layout - url: "https://pub.dartlang.org" + sha256: "8afed48db5e15c9c3488ca9f24b24cd24a4867a6d9d2dd2ba540ac363f50b60d" + url: "https://pub.dev" source: hosted - version: "0.1.0" + version: "0.1.6" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test: dependency: transitive description: name: test - url: "https://pub.dartlang.org" + sha256: "13b41f318e2a5751c3169137103b60c584297353d4b1761b66029bae6411fe46" + url: "https://pub.dev" source: hosted - version: "1.19.5" + version: "1.24.3" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + url: "https://pub.dev" source: hosted - version: "0.4.8" + version: "0.6.0" test_core: dependency: transitive description: name: test_core - url: "https://pub.dartlang.org" + sha256: "99806e9e6d95c7b059b7a0fc08f07fc53fabe54a829497f0d9676299f1e8637e" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.5.3" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 + url: "https://pub.dev" + source: hosted + version: "6.1.11" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: eed4e6a1164aa9794409325c3b707ff424d4d1c2a785e7db67f8bbda00e36e51 + url: "https://pub.dev" source: hosted - version: "6.0.3" + version: "6.0.35" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" + url: "https://pub.dev" + source: hosted + version: "6.1.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: "86f3f393cde6bed2a05bfc7f05e52aeaf4f9911a3ad9ff78a42e89e57e5a264a" + url: "https://pub.dev" source: hosted version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: f72b523da791d519aed53c12fd99c7dc50fdd1e4913da904081f3666d06334b5 + url: "https://pub.dev" source: hosted version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: "057e3458dfcc4276d171ae70cd98efc6d2485bf39b93a015349754e5dec0f657" + url: "https://pub.dev" source: hosted version: "2.0.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: f98b970a12236957881fa28df0c6700f03d9dc5f471cf5ca6d205b77e7ad92d2 + url: "https://pub.dev" source: hosted version: "2.0.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + sha256: "0ea20bfc625477e17f08a92d112272a071609b275ce4ca10ad853e1426ca3758" + url: "https://pub.dev" source: hosted version: "3.0.4" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.4" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: "35ef1bbae978d7158e09c98dcdfe8673b58a30eb53e82833cc027e0aab2d5213" + url: "https://pub.dev" source: hosted version: "7.5.0" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + sha256: e42dfcc48f67618344da967b10f62de57e04bae01d9d3af4c2596f3712a88c99 + url: "https://pub.dev" source: hosted version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "3a969ddcc204a3e34e863d204b29c0752716f78b6f9cc8235083208d268a4ccd" + url: "https://pub.dev" source: hosted version: "2.2.0" webkit_inspection_protocol: dependency: transitive description: name: webkit_inspection_protocol - url: "https://pub.dartlang.org" + sha256: c2893560a21d25570c488831d455654ea057e20a9c3bdd3015ad200513701c5e + url: "https://pub.dev" source: hosted version: "1.0.1" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "3cee79b1715110341012d27756d9bae38e650588acd38d3f3c610822e1337ace" + url: "https://pub.dev" source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0 <3.0.0" - flutter: ">=1.22.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.3.0" diff --git a/website/pubspec.yaml b/website/pubspec.yaml index 85a0559f7a..b1029941d7 100644 --- a/website/pubspec.yaml +++ b/website/pubspec.yaml @@ -1,6 +1,6 @@ name: website description: The marketing website for SuperEditor. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: sdk: ">=2.12.0 <3.0.0" @@ -17,7 +17,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - lint: ^1.0.0 + lint: ^2.1.2 flutter: uses-material-design: true @@ -33,4 +33,4 @@ flutter: - asset: assets/fonts/Aeonik-Light.woff weight: 300 - asset: assets/fonts/Aeonik-Thin.woff - weight: 100 \ No newline at end of file + weight: 100