diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28e19d57f..303f661bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,18 +4,17 @@ on: push: branches: - "main" + - "stable" pull_request: branches: - "main" + - "stable" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - FLUTTER_VERSION: "3.10.1" - # 3 jobs are configured. # The first one runs tests on desktop OSs. # The second runs tests on iOS simulator. @@ -34,11 +33,11 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} cache: true - name: Run tests run: | + flutter --version flutter pub get flutter analyze . dart format --set-exit-if-changed . diff --git a/.gitignore b/.gitignore index 09c0bf4fb..6a741fd04 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,6 @@ app.*.symbols !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -!/dev/ci/**/Gemfile.lock \ No newline at end of file +!/dev/ci/**/Gemfile.lock + +.fvm/ diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index eb78dcb5a..48d895046 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a33..a6b826db2 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ createState() => _HomePageState(); diff --git a/example/lib/pages/editor_list.dart b/example/lib/pages/editor_list.dart index f111457bc..ff7d594a0 100644 --- a/example/lib/pages/editor_list.dart +++ b/example/lib/pages/editor_list.dart @@ -20,7 +20,7 @@ class _EditorListState extends State { for (var i = 0; i < 100; i++) { final document = Document.blank() ..insert([ - 0 + 0, ], [ headingNode(level: 3, delta: Delta()..insert('Heading $i')), paragraphNode( diff --git a/example/lib/pages/mobile_editor.dart b/example/lib/pages/mobile_editor.dart index ab13c0a2e..cd434e8ad 100644 --- a/example/lib/pages/mobile_editor.dart +++ b/example/lib/pages/mobile_editor.dart @@ -55,13 +55,17 @@ class _MobileEditorState extends State { child: MobileFloatingToolbar( editorState: editorState, editorScrollController: editorScrollController, - toolbarBuilder: (context, anchor) { + toolbarBuilder: (context, anchor, closeToolbar) { return AdaptiveTextSelectionToolbar.editable( clipboardStatus: ClipboardStatus.pasteable, - onCopy: () => copyCommand.execute(editorState), + onCopy: () { + copyCommand.execute(editorState); + closeToolbar(); + }, onCut: () => cutCommand.execute(editorState), onPaste: () => pasteCommand.execute(editorState), onSelectAll: () => selectAllCommand.execute(editorState), + onLiveTextInput: null, anchors: TextSelectionToolbarAnchors( primaryAnchor: anchor, ), diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 954ca1e07..5d7ffe8ab 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -203,7 +203,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index fb7259e17..83d887283 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { final class TextNodeV0 extends NodeV0 { TextNodeV0({ required Delta delta, - LinkedList? children, + super.children, Attributes? attributes, }) : _delta = delta, super( type: 'text', - children: children, attributes: attributes ?? {}, ); diff --git a/lib/src/editor/block_component/base_component/block_component_configuration.dart b/lib/src/editor/block_component/base_component/block_component_configuration.dart index 505ea53a0..890b2808a 100644 --- a/lib/src/editor/block_component/base_component/block_component_configuration.dart +++ b/lib/src/editor/block_component/base_component/block_component_configuration.dart @@ -71,9 +71,9 @@ EdgeInsets _padding(Node node) { EdgeInsets _indentPadding(Node node, TextDirection textDirection) { switch (textDirection) { case TextDirection.ltr: - return const EdgeInsets.only(left: 30.0); + return const EdgeInsets.only(left: 24.0); case TextDirection.rtl: - return const EdgeInsets.only(right: 30.0); + return const EdgeInsets.only(right: 24.0); } } diff --git a/lib/src/editor/block_component/base_component/widget/nested_list_widget.dart b/lib/src/editor/block_component/base_component/widget/nested_list_widget.dart index f3615a7a9..6b1d0fcd8 100644 --- a/lib/src/editor/block_component/base_component/widget/nested_list_widget.dart +++ b/lib/src/editor/block_component/base_component/widget/nested_list_widget.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class NestedListWidget extends StatelessWidget { const NestedListWidget({ super.key, - this.indentPadding = const EdgeInsets.only(left: 30), + this.indentPadding = const EdgeInsets.only(left: 28), required this.child, required this.children, }); diff --git a/lib/src/editor/block_component/image_block_component/image_upload_widget.dart b/lib/src/editor/block_component/image_block_component/image_upload_widget.dart index fc35e3756..da2b7f96b 100644 --- a/lib/src/editor/block_component/image_block_component/image_upload_widget.dart +++ b/lib/src/editor/block_component/image_block_component/image_upload_widget.dart @@ -61,13 +61,13 @@ void showImageMenu( class UploadImageMenu extends StatefulWidget { const UploadImageMenu({ - Key? key, + super.key, this.backgroundColor = Colors.white, this.headerColor = Colors.black, this.width = 300, required this.onSubmitted, required this.onUpload, - }) : super(key: key); + }); final Color backgroundColor; final Color headerColor; diff --git a/lib/src/editor/block_component/table_block_component/table_action_handler.dart b/lib/src/editor/block_component/table_block_component/table_action_handler.dart index bdb866141..c396efd2b 100644 --- a/lib/src/editor/block_component/table_block_component/table_action_handler.dart +++ b/lib/src/editor/block_component/table_block_component/table_action_handler.dart @@ -5,7 +5,7 @@ import 'dart:math' as math; class TableActionHandler extends StatefulWidget { const TableActionHandler({ - Key? key, + super.key, this.visible = false, this.height, required this.node, @@ -15,7 +15,7 @@ class TableActionHandler extends StatefulWidget { required this.transform, required this.dir, this.menuBuilder, - }) : super(key: key); + }); final bool visible; final Node node; diff --git a/lib/src/editor/block_component/table_block_component/table_add_button.dart b/lib/src/editor/block_component/table_block_component/table_add_button.dart index aefce42e3..34d450260 100644 --- a/lib/src/editor/block_component/table_block_component/table_add_button.dart +++ b/lib/src/editor/block_component/table_block_component/table_add_button.dart @@ -2,13 +2,13 @@ import 'package:flutter/material.dart'; class TableActionButton extends StatefulWidget { const TableActionButton({ - Key? key, + super.key, required this.width, required this.height, required this.padding, required this.onPressed, required this.icon, - }) : super(key: key); + }); final double width, height; final EdgeInsetsGeometry padding; diff --git a/lib/src/editor/block_component/table_block_component/table_col.dart b/lib/src/editor/block_component/table_block_component/table_col.dart index 00bb829ba..7d81ebab8 100644 --- a/lib/src/editor/block_component/table_block_component/table_col.dart +++ b/lib/src/editor/block_component/table_block_component/table_col.dart @@ -8,14 +8,14 @@ import 'package:provider/provider.dart'; class TableCol extends StatefulWidget { const TableCol({ - Key? key, + super.key, required this.tableNode, required this.editorState, required this.colIdx, required this.borderColor, required this.borderHoverColor, this.menuBuilder, - }) : super(key: key); + }); final int colIdx; final EditorState editorState; diff --git a/lib/src/editor/block_component/table_block_component/table_col_border.dart b/lib/src/editor/block_component/table_block_component/table_col_border.dart index 596cc20d1..8952c85c5 100644 --- a/lib/src/editor/block_component/table_block_component/table_col_border.dart +++ b/lib/src/editor/block_component/table_block_component/table_col_border.dart @@ -5,14 +5,14 @@ import 'package:provider/provider.dart'; class TableColBorder extends StatefulWidget { const TableColBorder({ - Key? key, + super.key, required this.tableNode, required this.editorState, required this.colIdx, required this.resizable, required this.borderColor, required this.borderHoverColor, - }) : super(key: key); + }); final bool resizable; final int colIdx; diff --git a/lib/src/editor/block_component/table_block_component/table_view.dart b/lib/src/editor/block_component/table_block_component/table_view.dart index 258a387ef..8782c59df 100644 --- a/lib/src/editor/block_component/table_block_component/table_view.dart +++ b/lib/src/editor/block_component/table_block_component/table_view.dart @@ -6,14 +6,14 @@ import 'package:appflowy_editor/src/editor/block_component/table_block_component class TableView extends StatefulWidget { const TableView({ - Key? key, + super.key, required this.editorState, required this.tableNode, required this.addIcon, required this.borderColor, required this.borderHoverColor, this.menuBuilder, - }) : super(key: key); + }); final EditorState editorState; final TableNode tableNode; diff --git a/lib/src/editor/editor_component/entry/page_block_component.dart b/lib/src/editor/editor_component/entry/page_block_component.dart index 1ebcd9480..627fcc1ba 100644 --- a/lib/src/editor/editor_component/entry/page_block_component.dart +++ b/lib/src/editor/editor_component/entry/page_block_component.dart @@ -63,14 +63,12 @@ class PageBlockComponent extends BlockComponentStatelessWidget { return Column( children: [ if (header != null) header!, - ...items - .map( - (e) => Padding( - padding: editorState.editorStyle.padding, - child: editorState.renderer.build(context, e), - ), - ) - .toList(), + ...items.map( + (e) => Padding( + padding: editorState.editorStyle.padding, + child: editorState.renderer.build(context, e), + ), + ), if (footer != null) footer!, ], ); diff --git a/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart b/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart index 92427f6bb..98d668129 100644 --- a/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart +++ b/lib/src/editor/editor_component/service/ime/non_delta_input_service.dart @@ -36,8 +36,6 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient { final String debounceKey = 'updateEditingValue'; - int skipUpdateEditingValue = 0; - @override Future apply(List deltas) async { final formattedDeltas = deltas.map((e) => e.format()).toList(); @@ -76,12 +74,6 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient { Debounce.cancel(debounceKey); - // the set editing state will update the text editing value in macOS. - // we just skip the unnecessary update. - if (PlatformExtension.isMacOS) { - skipUpdateEditingValue += 1; - } - _textInputConnection! ..setEditingState(formattedValue) ..show(); @@ -95,10 +87,6 @@ class NonDeltaTextInputService extends TextInputService with TextInputClient { @override void updateEditingValue(TextEditingValue value) { - if (PlatformExtension.isMacOS && skipUpdateEditingValue > 0) { - skipUpdateEditingValue -= 1; - return; - } if (currentTextEditingValue == value) { return; } diff --git a/lib/src/editor/editor_component/service/scroll/desktop_scroll_service.dart b/lib/src/editor/editor_component/service/scroll/desktop_scroll_service.dart index 4f1107fba..8890d5586 100644 --- a/lib/src/editor/editor_component/service/scroll/desktop_scroll_service.dart +++ b/lib/src/editor/editor_component/service/scroll/desktop_scroll_service.dart @@ -4,9 +4,9 @@ import 'package:provider/provider.dart'; class DesktopScrollService extends StatefulWidget { const DesktopScrollService({ - Key? key, + super.key, required this.child, - }) : super(key: key); + }); final Widget child; diff --git a/lib/src/editor/editor_component/service/scroll/mobile_scroll_service.dart b/lib/src/editor/editor_component/service/scroll/mobile_scroll_service.dart index 56bffeaae..eed6422c9 100644 --- a/lib/src/editor/editor_component/service/scroll/mobile_scroll_service.dart +++ b/lib/src/editor/editor_component/service/scroll/mobile_scroll_service.dart @@ -4,9 +4,9 @@ import 'package:provider/provider.dart'; class MobileScrollService extends StatefulWidget { const MobileScrollService({ - Key? key, + super.key, required this.child, - }) : super(key: key); + }); final Widget child; diff --git a/lib/src/editor/editor_component/service/scroll_service_widget.dart b/lib/src/editor/editor_component/service/scroll_service_widget.dart index e00692966..9ce7187e4 100644 --- a/lib/src/editor/editor_component/service/scroll_service_widget.dart +++ b/lib/src/editor/editor_component/service/scroll_service_widget.dart @@ -8,10 +8,10 @@ import 'package:provider/provider.dart'; class ScrollServiceWidget extends StatefulWidget { const ScrollServiceWidget({ - Key? key, + super.key, required this.editorScrollController, required this.child, - }) : super(key: key); + }); final EditorScrollController editorScrollController; diff --git a/lib/src/editor/selection_menu/selection_menu_item_widget.dart b/lib/src/editor/selection_menu/selection_menu_item_widget.dart index 1a2beb33c..71d60b354 100644 --- a/lib/src/editor/selection_menu/selection_menu_item_widget.dart +++ b/lib/src/editor/selection_menu/selection_menu_item_widget.dart @@ -5,14 +5,14 @@ import 'package:flutter/material.dart'; class SelectionMenuItemWidget extends StatefulWidget { const SelectionMenuItemWidget({ - Key? key, + super.key, required this.editorState, required this.menuService, required this.item, required this.isSelected, required this.selectionMenuStyle, this.width = 140.0, - }) : super(key: key); + }); final EditorState editorState; final SelectionMenuService menuService; diff --git a/lib/src/editor/selection_menu/selection_menu_widget.dart b/lib/src/editor/selection_menu/selection_menu_widget.dart index 1c97c7652..0439ecb49 100644 --- a/lib/src/editor/selection_menu/selection_menu_widget.dart +++ b/lib/src/editor/selection_menu/selection_menu_widget.dart @@ -187,7 +187,7 @@ class SelectionMenuStyle { class SelectionMenuWidget extends StatefulWidget { const SelectionMenuWidget({ - Key? key, + super.key, required this.items, required this.maxItemInRow, required this.editorState, @@ -197,7 +197,7 @@ class SelectionMenuWidget extends StatefulWidget { required this.selectionMenuStyle, required this.itemCountFilter, required this.deleteSlashByDefault, - }) : super(key: key); + }); final List items; final int itemCountFilter; diff --git a/lib/src/editor/toolbar/desktop/items/link/link_menu.dart b/lib/src/editor/toolbar/desktop/items/link/link_menu.dart index 9f8988f2c..74ab53c8a 100644 --- a/lib/src/editor/toolbar/desktop/items/link/link_menu.dart +++ b/lib/src/editor/toolbar/desktop/items/link/link_menu.dart @@ -5,7 +5,7 @@ import 'package:flutter/services.dart'; class LinkMenu extends StatefulWidget { const LinkMenu({ - Key? key, + super.key, this.linkText, this.editorState, required this.onSubmitted, @@ -13,7 +13,7 @@ class LinkMenu extends StatefulWidget { required this.onCopyLink, required this.onRemoveLink, required this.onDismiss, - }) : super(key: key); + }); final String? linkText; final EditorState? editorState; diff --git a/lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart b/lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart index 9837c0066..53726a97d 100644 --- a/lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart +++ b/lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart @@ -25,7 +25,11 @@ class MobileFloatingToolbar extends StatefulWidget { final EditorState editorState; final EditorScrollController editorScrollController; final Widget child; - final Widget Function(BuildContext context, Offset anchor) toolbarBuilder; + final Widget Function( + BuildContext context, + Offset anchor, + Function closeToolbar, + ) toolbarBuilder; @override State createState() => _MobileFloatingToolbarState(); @@ -154,7 +158,11 @@ class _MobileFloatingToolbarState extends State BuildContext context, Offset offset, ) { - return widget.toolbarBuilder(context, offset); + return widget.toolbarBuilder( + context, + offset, + _clear, + ); } Rect _findSuitableRect(Iterable rects) { diff --git a/lib/src/editor/toolbar/mobile/mobile_toolbar.dart b/lib/src/editor/toolbar/mobile/mobile_toolbar.dart index 807d5e717..e10a62788 100644 --- a/lib/src/editor/toolbar/mobile/mobile_toolbar.dart +++ b/lib/src/editor/toolbar/mobile/mobile_toolbar.dart @@ -219,13 +219,12 @@ class _QuitEditingBtn extends StatelessWidget { class _ToolbarItemListView extends StatelessWidget { const _ToolbarItemListView({ - Key? key, required this.itemWithMenuOnPressed, required this.toolbarItems, required this.editorState, required this.selection, required this.toolbarWidgetService, - }) : super(key: key); + }); final Function(int index) itemWithMenuOnPressed; final List toolbarItems; diff --git a/lib/src/editor/toolbar/mobile/mobile_toolbar_style.dart b/lib/src/editor/toolbar/mobile/mobile_toolbar_style.dart index a0a670c18..891a89a66 100644 --- a/lib/src/editor/toolbar/mobile/mobile_toolbar_style.dart +++ b/lib/src/editor/toolbar/mobile/mobile_toolbar_style.dart @@ -26,7 +26,7 @@ class MobileToolbarStyle extends InheritedWidget { final double buttonSelectedBorderWidth; const MobileToolbarStyle({ - Key? key, + super.key, required this.backgroundColor, required this.foregroundColor, required this.clearDiagonalLineColor, @@ -43,8 +43,8 @@ class MobileToolbarStyle extends InheritedWidget { required this.buttonSpacing, required this.buttonBorderWidth, required this.buttonSelectedBorderWidth, - required Widget child, - }) : super(key: key, child: child); + required super.child, + }); static MobileToolbarStyle of(BuildContext context) { return context.dependOnInheritedWidgetOfExactType()!; diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/color/background_color_options_widgets.dart b/lib/src/editor/toolbar/mobile/toolbar_items/color/background_color_options_widgets.dart index 746867c83..fc90b2a2f 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/color/background_color_options_widgets.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/color/background_color_options_widgets.dart @@ -1,13 +1,13 @@ -import 'package:flutter/material.dart'; import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:flutter/material.dart'; class BackgroundColorOptionsWidgets extends StatefulWidget { const BackgroundColorOptionsWidgets( this.editorState, this.selection, { this.backgroundColorOptions, - Key? key, - }) : super(key: key); + super.key, + }); final Selection selection; final EditorState editorState; @@ -82,7 +82,7 @@ class _BackgroundColorOptionsWidgetsState }, isSelected: isSelected, ); - }).toList(), + }), ], ), ); diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/color/text_and_background_color_tool_bar_item.dart b/lib/src/editor/toolbar/mobile/toolbar_items/color/text_and_background_color_tool_bar_item.dart index c2cee69c3..f61ca8e7e 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/color/text_and_background_color_tool_bar_item.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/color/text_and_background_color_tool_bar_item.dart @@ -24,8 +24,7 @@ class _TextAndBackgroundColorMenu extends StatefulWidget { this.selection, { this.textColorOptions, this.backgroundColorOptions, - Key? key, - }) : super(key: key); + }); final EditorState editorState; final Selection selection; diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/color/text_color_options_widgets.dart b/lib/src/editor/toolbar/mobile/toolbar_items/color/text_color_options_widgets.dart index 16ff0c7d5..2d7c0ece3 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/color/text_color_options_widgets.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/color/text_color_options_widgets.dart @@ -1,13 +1,13 @@ -import 'package:flutter/material.dart'; import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:flutter/material.dart'; class TextColorOptionsWidgets extends StatefulWidget { const TextColorOptionsWidgets( this.editorState, this.selection, { this.textColorOptions, - Key? key, - }) : super(key: key); + super.key, + }); final Selection selection; final EditorState editorState; @@ -80,7 +80,7 @@ class _TextColorOptionsWidgetsState extends State { }, isSelected: isSelected, ); - }).toList(), + }), ], ), ); diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/color/utils/color_button.dart b/lib/src/editor/toolbar/mobile/toolbar_items/color/utils/color_button.dart index 71e733f3b..349dac4da 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/color/utils/color_button.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/color/utils/color_button.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; class ColorButton extends StatelessWidget { const ColorButton({ - Key? key, + super.key, required this.colorOption, required this.isSelected, required this.onPressed, this.isBackgroundColor = false, - }) : super(key: key); + }); final ColorOption colorOption; final bool isBackgroundColor; diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart b/lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart index 16a06ca71..d0c4690cd 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/heading_mobile_toolbar_item.dart @@ -14,9 +14,8 @@ final headingMobileToolbarItem = MobileToolbarItem.withMenu( class _HeadingMenu extends StatefulWidget { const _HeadingMenu( this.selection, - this.editorState, { - Key? key, - }) : super(key: key); + this.editorState, + ); final Selection selection; final EditorState editorState; diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart b/lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart index 23d051810..73da51305 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/list_mobile_toolbar_item.dart @@ -11,9 +11,8 @@ final listMobileToolbarItem = MobileToolbarItem.withMenu( class _ListMenu extends StatefulWidget { const _ListMenu( this.editorState, - this.selection, { - Key? key, - }) : super(key: key); + this.selection, + ); final Selection selection; final EditorState editorState; diff --git a/lib/src/editor/toolbar/mobile/toolbar_items/text_decoration_mobile_toolbar_item.dart b/lib/src/editor/toolbar/mobile/toolbar_items/text_decoration_mobile_toolbar_item.dart index 533b2048b..97238f7ba 100644 --- a/lib/src/editor/toolbar/mobile/toolbar_items/text_decoration_mobile_toolbar_item.dart +++ b/lib/src/editor/toolbar/mobile/toolbar_items/text_decoration_mobile_toolbar_item.dart @@ -11,9 +11,8 @@ final textDecorationMobileToolbarItem = MobileToolbarItem.withMenu( class _TextDecorationMenu extends StatefulWidget { const _TextDecorationMenu( this.editorState, - this.selection, { - Key? key, - }) : super(key: key); + this.selection, + ); final EditorState editorState; final Selection selection; diff --git a/lib/src/flutter/overlay.dart b/lib/src/flutter/overlay.dart index c578d164a..6f0b6b67c 100644 --- a/lib/src/flutter/overlay.dart +++ b/lib/src/flutter/overlay.dart @@ -243,10 +243,10 @@ class Overlay extends StatefulWidget { /// Rather than creating an overlay, consider using the overlay that is /// created by the [Navigator] in a [WidgetsApp] or a [MaterialApp] for the application. const Overlay({ - Key? key, + super.key, this.initialEntries = const [], this.clipBehavior = Clip.hardEdge, - }) : super(key: key); + }); /// The entries to include in the overlay initially. /// @@ -574,13 +574,11 @@ class OverlayState extends State with TickerProviderStateMixin { /// The first [skipCount] children are considered "offstage". class _Theatre extends MultiChildRenderObjectWidget { const _Theatre({ - Key? key, this.skipCount = 0, this.clipBehavior = Clip.hardEdge, - List children = const [], + super.children, }) : assert(skipCount >= 0), - assert(children.length >= skipCount), - super(key: key, children: children); + assert(children.length >= skipCount); final int skipCount; @@ -614,7 +612,7 @@ class _Theatre extends MultiChildRenderObjectWidget { } class _TheatreElement extends MultiChildRenderObjectElement { - _TheatreElement(_Theatre widget) : super(widget); + _TheatreElement(_Theatre super.widget); @override _RenderTheatre get renderObject => super.renderObject as _RenderTheatre; diff --git a/lib/src/flutter/scrollable_positioned_list/src/element_registry.dart b/lib/src/flutter/scrollable_positioned_list/src/element_registry.dart index 886d1fb55..d73f373a3 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/element_registry.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/element_registry.dart @@ -7,8 +7,7 @@ import 'package:flutter/widgets.dart'; /// A registry to track some [Element]s in the tree. class RegistryWidget extends StatefulWidget { /// Creates a [RegistryWidget]. - const RegistryWidget({Key? key, this.elementNotifier, required this.child}) - : super(key: key); + const RegistryWidget({super.key, this.elementNotifier, required this.child}); /// The widget below this widget in the tree. final Widget child; @@ -28,8 +27,7 @@ class RegistryWidget extends StatefulWidget { /// [RegistryWidget]. class RegisteredElementWidget extends ProxyWidget { /// Creates a [RegisteredElementWidget]. - const RegisteredElementWidget({Key? key, required Widget child}) - : super(key: key, child: child); + const RegisteredElementWidget({super.key, required super.child}); @override Element createElement() => _RegisteredElement(this); @@ -49,17 +47,16 @@ class _InheritedRegistryWidget extends InheritedWidget { final _RegistryWidgetState state; const _InheritedRegistryWidget({ - Key? key, required this.state, - required Widget child, - }) : super(key: key, child: child); + required super.child, + }); @override bool updateShouldNotify(InheritedWidget oldWidget) => true; } class _RegisteredElement extends ProxyElement { - _RegisteredElement(ProxyWidget widget) : super(widget); + _RegisteredElement(super.widget); @override void notifyClients(ProxyWidget oldWidget) {} diff --git a/lib/src/flutter/scrollable_positioned_list/src/positioned_list.dart b/lib/src/flutter/scrollable_positioned_list/src/positioned_list.dart index 5a38fb5c8..9c4ef6885 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/positioned_list.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/positioned_list.dart @@ -26,7 +26,7 @@ import 'wrapping.dart'; class PositionedList extends StatefulWidget { /// Create a [PositionedList]. const PositionedList({ - Key? key, + super.key, required this.itemCount, required this.itemBuilder, this.separatorBuilder, @@ -44,8 +44,7 @@ class PositionedList extends StatefulWidget { this.addSemanticIndexes = true, this.addRepaintBoundaries = true, this.addAutomaticKeepAlives = true, - }) : assert((positionedIndex == 0) || (positionedIndex < itemCount)), - super(key: key); + }) : assert((positionedIndex == 0) || (positionedIndex < itemCount)); /// Number of items the [itemBuilder] can produce. final int itemCount; diff --git a/lib/src/flutter/scrollable_positioned_list/src/post_mount_callback.dart b/lib/src/flutter/scrollable_positioned_list/src/post_mount_callback.dart index 9ec553fa7..dde2874b8 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/post_mount_callback.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/post_mount_callback.dart @@ -7,8 +7,7 @@ import 'package:flutter/widgets.dart'; /// Widget whose [Element] calls a callback when the element is mounted. class PostMountCallback extends StatelessWidget { /// Creates a [PostMountCallback] widget. - const PostMountCallback({required this.child, this.callback, Key? key}) - : super(key: key); + const PostMountCallback({required this.child, this.callback, super.key}); /// The widget below this widget in the tree. final Widget child; @@ -24,7 +23,7 @@ class PostMountCallback extends StatelessWidget { } class _PostMountCallbackElement extends StatelessElement { - _PostMountCallbackElement(PostMountCallback widget) : super(widget); + _PostMountCallbackElement(PostMountCallback super.widget); @override void mount(Element? parent, dynamic newSlot) { diff --git a/lib/src/flutter/scrollable_positioned_list/src/scroll_view.dart b/lib/src/flutter/scrollable_positioned_list/src/scroll_view.dart index 31acda407..70b233eab 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/scroll_view.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/scroll_view.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/gestures.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; @@ -15,34 +14,23 @@ class UnboundedCustomScrollView extends CustomScrollView { final bool _shrinkWrap; const UnboundedCustomScrollView({ - Key? key, - Axis scrollDirection = Axis.vertical, - bool reverse = false, - ScrollController? controller, - bool? primary, - ScrollPhysics? physics, + super.key, + super.scrollDirection, + super.reverse, + super.controller, + super.primary, + super.physics, bool shrinkWrap = false, - Key? center, + super.center, double anchor = 0.0, - double? cacheExtent, - List slivers = const [], - int? semanticChildCount, - DragStartBehavior dragStartBehavior = DragStartBehavior.start, + super.cacheExtent, + super.slivers, + super.semanticChildCount, + super.dragStartBehavior, }) : _shrinkWrap = shrinkWrap, _anchor = anchor, super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, shrinkWrap: false, - center: center, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount, - dragStartBehavior: dragStartBehavior, - slivers: slivers, ); // [CustomScrollView] enforces constraints on [CustomScrollView.anchor], so diff --git a/lib/src/flutter/scrollable_positioned_list/src/scrollable_positioned_list.dart b/lib/src/flutter/scrollable_positioned_list/src/scrollable_positioned_list.dart index c939db14f..9e7a97c1e 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/scrollable_positioned_list.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/scrollable_positioned_list.dart @@ -40,7 +40,7 @@ class ScrollablePositionedList extends StatefulWidget { const ScrollablePositionedList.builder({ required this.itemCount, required this.itemBuilder, - Key? key, + super.key, this.itemScrollController, this.shrinkWrap = false, ItemPositionsListener? itemPositionsListener, @@ -59,8 +59,7 @@ class ScrollablePositionedList extends StatefulWidget { this.minCacheExtent, }) : itemPositionsNotifier = itemPositionsListener as ItemPositionsNotifier?, scrollOffsetNotifier = scrollOffsetListener as ScrollOffsetNotifier?, - separatorBuilder = null, - super(key: key); + separatorBuilder = null; /// Create a [ScrollablePositionedList] whose items are provided by /// [itemBuilder] and separators provided by [separatorBuilder]. @@ -68,7 +67,7 @@ class ScrollablePositionedList extends StatefulWidget { required this.itemCount, required this.itemBuilder, required this.separatorBuilder, - Key? key, + super.key, this.shrinkWrap = false, this.itemScrollController, ItemPositionsListener? itemPositionsListener, @@ -87,8 +86,7 @@ class ScrollablePositionedList extends StatefulWidget { this.minCacheExtent, }) : assert(separatorBuilder != null), itemPositionsNotifier = itemPositionsListener as ItemPositionsNotifier?, - scrollOffsetNotifier = scrollOffsetListener as ScrollOffsetNotifier?, - super(key: key); + scrollOffsetNotifier = scrollOffsetListener as ScrollOffsetNotifier?; /// Number of items the [itemBuilder] can produce. final int itemCount; diff --git a/lib/src/flutter/scrollable_positioned_list/src/viewport.dart b/lib/src/flutter/scrollable_positioned_list/src/viewport.dart index c89a6b81c..bf143ccb3 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/viewport.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/viewport.dart @@ -14,24 +14,15 @@ import 'package:flutter/widgets.dart'; /// for more information. class UnboundedViewport extends Viewport { UnboundedViewport({ - Key? key, - AxisDirection axisDirection = AxisDirection.down, - AxisDirection? crossAxisDirection, + super.key, + super.axisDirection, + super.crossAxisDirection, double anchor = 0.0, - required ViewportOffset offset, - Key? center, - double? cacheExtent, - List slivers = const [], - }) : _anchor = anchor, - super( - key: key, - axisDirection: axisDirection, - crossAxisDirection: crossAxisDirection, - offset: offset, - center: center, - cacheExtent: cacheExtent, - slivers: slivers, - ); + required super.offset, + super.center, + super.cacheExtent, + super.slivers, + }) : _anchor = anchor; // [Viewport] enforces constraints on [Viewport.anchor], so we need our own // version. @@ -64,22 +55,14 @@ class UnboundedViewport extends Viewport { class UnboundedRenderViewport extends RenderViewport { /// Creates a viewport for [RenderSliver] objects. UnboundedRenderViewport({ - AxisDirection axisDirection = AxisDirection.down, - required AxisDirection crossAxisDirection, - required ViewportOffset offset, + super.axisDirection, + required super.crossAxisDirection, + required super.offset, double anchor = 0.0, - List? children, - RenderSliver? center, - double? cacheExtent, - }) : _anchor = anchor, - super( - axisDirection: axisDirection, - crossAxisDirection: crossAxisDirection, - offset: offset, - center: center, - cacheExtent: cacheExtent, - children: children, - ); + super.children, + super.center, + super.cacheExtent, + }) : _anchor = anchor; static const int _maxLayoutCycles = 10; diff --git a/lib/src/flutter/scrollable_positioned_list/src/wrapping.dart b/lib/src/flutter/scrollable_positioned_list/src/wrapping.dart index 53c7c4130..e09ad19a9 100644 --- a/lib/src/flutter/scrollable_positioned_list/src/wrapping.dart +++ b/lib/src/flutter/scrollable_positioned_list/src/wrapping.dart @@ -37,25 +37,16 @@ class CustomShrinkWrappingViewport extends CustomViewport { /// /// The [offset] argument must not be null. CustomShrinkWrappingViewport({ - Key? key, - AxisDirection axisDirection = AxisDirection.down, - AxisDirection? crossAxisDirection, + super.key, + super.axisDirection, + super.crossAxisDirection, double anchor = 0.0, - required ViewportOffset offset, + required super.offset, List? children, - Key? center, - double? cacheExtent, - List slivers = const [], - }) : _anchor = anchor, - super( - key: key, - axisDirection: axisDirection, - crossAxisDirection: crossAxisDirection, - offset: offset, - center: center, - cacheExtent: cacheExtent, - slivers: slivers, - ); + super.center, + super.cacheExtent, + super.slivers, + }) : _anchor = anchor; // [Viewport] enforces constraints on [Viewport.anchor], so we need our own // version. @@ -125,22 +116,14 @@ class CustomRenderShrinkWrappingViewport extends CustomRenderViewport { /// The [offset] must be specified. For testing purposes, consider passing a /// [ViewportOffset.zero] or [ViewportOffset.fixed]. CustomRenderShrinkWrappingViewport({ - AxisDirection axisDirection = AxisDirection.down, - required AxisDirection crossAxisDirection, - required ViewportOffset offset, + super.axisDirection, + required super.crossAxisDirection, + required super.offset, double anchor = 0.0, - List? children, - RenderSliver? center, - double? cacheExtent, - }) : _anchor = anchor, - super( - axisDirection: axisDirection, - crossAxisDirection: crossAxisDirection, - offset: offset, - center: center, - cacheExtent: cacheExtent, - children: children, - ); + super.children, + super.center, + super.cacheExtent, + }) : _anchor = anchor; double _anchor; @@ -420,7 +403,7 @@ abstract class CustomViewport extends MultiChildRenderObjectWidget { /// The [cacheExtent] must be specified if the [cacheExtentStyle] is /// not [CacheExtentStyle.pixel]. CustomViewport({ - Key? key, + super.key, this.axisDirection = AxisDirection.down, this.crossAxisDirection, this.anchor = 0.0, @@ -437,7 +420,7 @@ abstract class CustomViewport extends MultiChildRenderObjectWidget { assert( cacheExtentStyle != CacheExtentStyle.viewport || cacheExtent != null, ), - super(key: key, children: slivers); + super(children: slivers); /// The direction in which the [offset]'s [ViewportOffset.pixels] increases. /// @@ -581,7 +564,7 @@ abstract class CustomViewport extends MultiChildRenderObjectWidget { class ViewportElement extends MultiChildRenderObjectElement { /// Creates an element that uses the given widget as its configuration. - ViewportElement(CustomViewport widget) : super(widget); + ViewportElement(CustomViewport super.widget); @override CustomViewport get widget => super.widget as CustomViewport; @@ -681,28 +664,20 @@ abstract class CustomRenderViewport /// The [offset] must be specified. For testing purposes, consider passing a /// [ViewportOffset.zero] or [ViewportOffset.fixed]. CustomRenderViewport({ - AxisDirection axisDirection = AxisDirection.down, - required AxisDirection crossAxisDirection, - required ViewportOffset offset, + super.axisDirection, + required super.crossAxisDirection, + required super.offset, double anchor = 0.0, List? children, RenderSliver? center, - double? cacheExtent, - CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel, - Clip clipBehavior = Clip.hardEdge, + super.cacheExtent, + super.cacheExtentStyle, + super.clipBehavior, }) : assert(anchor >= 0.0 && anchor <= 1.0), assert( cacheExtentStyle != CacheExtentStyle.viewport || cacheExtent != null, ), - _center = center, - super( - axisDirection: axisDirection, - crossAxisDirection: crossAxisDirection, - offset: offset, - cacheExtent: cacheExtent, - cacheExtentStyle: cacheExtentStyle, - clipBehavior: clipBehavior, - ) { + _center = center { addAll(children); if (center == null && firstChild != null) _center = firstChild; } diff --git a/lib/src/infra/mobile/af_mobile_icon.dart b/lib/src/infra/mobile/af_mobile_icon.dart index eb353db97..2d88823b6 100644 --- a/lib/src/infra/mobile/af_mobile_icon.dart +++ b/lib/src/infra/mobile/af_mobile_icon.dart @@ -39,11 +39,11 @@ enum AFMobileIcons { /// {@end-tool} class AFMobileIcon extends StatelessWidget { const AFMobileIcon({ - Key? key, + super.key, required this.afMobileIcons, this.size = 24, this.color, - }) : super(key: key); + }); final AFMobileIcons afMobileIcons; final double? size; diff --git a/lib/src/plugins/html/html_document.dart b/lib/src/plugins/html/html_document.dart index dc359cb4d..c2fa3fd4a 100644 --- a/lib/src/plugins/html/html_document.dart +++ b/lib/src/plugins/html/html_document.dart @@ -28,7 +28,7 @@ String documentToHTML( const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), - const HtmlTableNodeParser() + const HtmlTableNodeParser(), ], ).encode(document); } diff --git a/lib/src/render/color_menu/color_picker.dart b/lib/src/render/color_menu/color_picker.dart index ee249f419..8fbed681b 100644 --- a/lib/src/render/color_menu/color_picker.dart +++ b/lib/src/render/color_menu/color_picker.dart @@ -125,15 +125,13 @@ class _ColorPickerState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ _buildCustomColorItem(colorOptionList), - ...colorOptionList.colorOptions - .map( - (colorOption) => _buildColorItem( - colorOptionList.onSubmittedAction, - colorOption, - colorOption.colorHex == colorOptionList.selectedColorHex, - ), - ) - .toList(), + ...colorOptionList.colorOptions.map( + (colorOption) => _buildColorItem( + colorOptionList.onSubmittedAction, + colorOption, + colorOption.colorHex == colorOptionList.selectedColorHex, + ), + ), ], ); } diff --git a/lib/src/render/selection/cursor.dart b/lib/src/render/selection/cursor.dart index 6d9fe076e..b7b0573ff 100644 --- a/lib/src/render/selection/cursor.dart +++ b/lib/src/render/selection/cursor.dart @@ -5,13 +5,13 @@ import 'package:flutter/material.dart'; class Cursor extends StatefulWidget { const Cursor({ - Key? key, + super.key, required this.rect, required this.color, this.blinkingInterval = 0.5, this.shouldBlink = true, this.cursorStyle = CursorStyle.verticalLine, - }) : super(key: key); + }); final double blinkingInterval; // milliseconds final bool shouldBlink; diff --git a/lib/src/render/selection/cursor_widget.dart b/lib/src/render/selection/cursor_widget.dart index a49f8344d..bfea2cadd 100644 --- a/lib/src/render/selection/cursor_widget.dart +++ b/lib/src/render/selection/cursor_widget.dart @@ -5,14 +5,14 @@ import 'package:flutter/material.dart'; class CursorWidget extends StatefulWidget { const CursorWidget({ - Key? key, + super.key, required this.layerLink, required this.rect, required this.color, this.blinkingInterval = 0.5, this.shouldBlink = true, this.cursorStyle = CursorStyle.verticalLine, - }) : super(key: key); + }); final double blinkingInterval; // milliseconds final bool shouldBlink; diff --git a/lib/src/render/selection/mobile_selection_widget.dart b/lib/src/render/selection/mobile_selection_widget.dart index 89e335745..57e670565 100644 --- a/lib/src/render/selection/mobile_selection_widget.dart +++ b/lib/src/render/selection/mobile_selection_widget.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; class MobileSelectionWidget extends StatelessWidget { const MobileSelectionWidget({ - Key? key, + super.key, required this.layerLink, required this.rect, required this.color, @@ -10,7 +10,7 @@ class MobileSelectionWidget extends StatelessWidget { this.showLeftHandler = false, this.showRightHandler = false, this.handlerColor = Colors.black, - }) : super(key: key); + }); final Color color; final Rect rect; diff --git a/lib/src/render/selection/selection_widget.dart b/lib/src/render/selection/selection_widget.dart index 3430d6a39..0a76df1c0 100644 --- a/lib/src/render/selection/selection_widget.dart +++ b/lib/src/render/selection/selection_widget.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; class SelectionWidget extends StatefulWidget { const SelectionWidget({ - Key? key, + super.key, required this.layerLink, required this.rect, required this.color, this.decoration, - }) : super(key: key); + }); final Color color; final Rect rect; diff --git a/lib/src/render/toolbar/toolbar_item_widget.dart b/lib/src/render/toolbar/toolbar_item_widget.dart index 22bcfab54..e193ca3f1 100644 --- a/lib/src/render/toolbar/toolbar_item_widget.dart +++ b/lib/src/render/toolbar/toolbar_item_widget.dart @@ -4,11 +4,11 @@ import 'toolbar_item.dart'; class ToolbarItemWidget extends StatelessWidget { const ToolbarItemWidget({ - Key? key, + super.key, required this.item, required this.isHighlight, required this.onPressed, - }) : super(key: key); + }); final ToolbarItem item; final VoidCallback onPressed; diff --git a/lib/src/render/toolbar/toolbar_widget.dart b/lib/src/render/toolbar/toolbar_widget.dart index 6d4561f19..7af883a45 100644 --- a/lib/src/render/toolbar/toolbar_widget.dart +++ b/lib/src/render/toolbar/toolbar_widget.dart @@ -10,7 +10,7 @@ mixin ToolbarMixin on State { class ToolbarWidget extends StatefulWidget { const ToolbarWidget({ - Key? key, + super.key, required this.editorState, required this.layerLink, required this.offset, @@ -18,7 +18,7 @@ class ToolbarWidget extends StatefulWidget { this.iconColor, required this.items, this.alignment = Alignment.topLeft, - }) : super(key: key); + }); final EditorState editorState; final LayerLink layerLink; diff --git a/lib/src/service/context_menu/context_menu.dart b/lib/src/service/context_menu/context_menu.dart index bd3c25cf4..99319e0d0 100644 --- a/lib/src/service/context_menu/context_menu.dart +++ b/lib/src/service/context_menu/context_menu.dart @@ -15,12 +15,12 @@ class ContextMenuItem { class ContextMenu extends StatelessWidget { const ContextMenu({ - Key? key, + super.key, required this.position, required this.editorState, required this.items, required this.onPressed, - }) : super(key: key); + }); final Offset position; final EditorState editorState; diff --git a/lib/src/service/selection/selection_gesture.dart b/lib/src/service/selection/selection_gesture.dart index 50c36ca99..c0ca0ae1e 100644 --- a/lib/src/service/selection/selection_gesture.dart +++ b/lib/src/service/selection/selection_gesture.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; @immutable class SelectionGestureDetector extends StatefulWidget { const SelectionGestureDetector({ - Key? key, + super.key, this.child, this.onTapDown, this.onDoubleTapDown, @@ -17,7 +17,7 @@ class SelectionGestureDetector extends StatefulWidget { this.onPanStart, this.onPanUpdate, this.onPanEnd, - }) : super(key: key); + }); @override State createState() => diff --git a/lib/src/service/shortcut_event/key_mapping.dart b/lib/src/service/shortcut_event/key_mapping.dart index bddbd0971..3dba81b59 100644 --- a/lib/src/service/shortcut_event/key_mapping.dart +++ b/lib/src/service/shortcut_event/key_mapping.dart @@ -1,8 +1,6 @@ /// Keyboard key to keycode mapping table /// /// Copy from flutter project, keyboard_key.dart. -/// - Map keyToCodeMapping = { 'Space': 0x00000000020, 'Exclamation': 0x00000000021, diff --git a/pubspec.yaml b/pubspec.yaml index 84060f0a4..8b02110aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: collection: ^1.17.0 nanoid: ^1.0.0 visibility_detector: ^0.4.0+2 - file_picker: ^5.3.1 + file_picker: ^6.1.1 path: ^1.8.3 path_provider: ^2.0.5 diff_match_patch: ^0.4.1 @@ -44,7 +44,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.1 network_image_mock: ^2.1.1 mockito: ^5.4.1 diff --git a/test/new/block_component/text_direction_mixin_test.dart b/test/new/block_component/text_direction_mixin_test.dart index 5a7d0920a..c6755a0f0 100644 --- a/test/new/block_component/text_direction_mixin_test.dart +++ b/test/new/block_component/text_direction_mixin_test.dart @@ -391,7 +391,7 @@ void main() { paragraphNode( text: 'س', textDirection: blockComponentTextDirectionRTL, - ) + ), ], ); final editor = tester.editor..addNode(node); diff --git a/test/new/command/text_commands_test.dart b/test/new/command/text_commands_test.dart index d616d3f3e..7f242dc76 100644 --- a/test/new/command/text_commands_test.dart +++ b/test/new/command/text_commands_test.dart @@ -348,7 +348,7 @@ void main() async { expect(delta1.toJson(), [ { "insert": "Hello", - "attributes": {"bold": true, "italic": true, "underline": true} + "attributes": {"bold": true, "italic": true, "underline": true}, } ]); @@ -366,11 +366,11 @@ void main() async { expect(delta2.toJson(), [ { "insert": "Hello", - "attributes": {"bold": true, "italic": true, "underline": true} + "attributes": {"bold": true, "italic": true, "underline": true}, }, { "insert": "World", - "attributes": {"bold": false, "italic": false, "underline": false} + "attributes": {"bold": false, "italic": false, "underline": false}, }, ]); @@ -415,7 +415,7 @@ void main() async { expect(delta1.toJson(), [ { "insert": "Hello", - "attributes": {"bold": false, "italic": false, "underline": false} + "attributes": {"bold": false, "italic": false, "underline": false}, } ]); diff --git a/test/new/service/shortcuts/command_shortcut_events/indent_command_test.dart b/test/new/service/shortcuts/command_shortcut_events/indent_command_test.dart index 13fc16e47..483429f11 100644 --- a/test/new/service/shortcuts/command_shortcut_events/indent_command_test.dart +++ b/test/new/service/shortcuts/command_shortcut_events/indent_command_test.dart @@ -17,7 +17,7 @@ void main() async { final nestedBlock = node.key.currentState! .unwrapOrNull(); - expect(nestedBlock?.indentPadding.left, 30); + expect(nestedBlock?.indentPadding.left, 24); expect(nestedBlock?.indentPadding.right, 0); await editor.dispose(); @@ -34,7 +34,7 @@ void main() async { final nestedBlock = node.key.currentState! .unwrapOrNull(); - expect(nestedBlock?.indentPadding.left, 30); + expect(nestedBlock?.indentPadding.left, 24); expect(nestedBlock?.indentPadding.right, 0); await editor.dispose(); @@ -55,7 +55,7 @@ void main() async { .unwrapOrNull(); expect(nestedBlock?.indentPadding.left, 0); - expect(nestedBlock?.indentPadding.right, 30); + expect(nestedBlock?.indentPadding.right, 24); await editor.dispose(); }); @@ -75,7 +75,7 @@ void main() async { .unwrapOrNull(); expect(nestedBlock?.indentPadding.left, 0); - expect(nestedBlock?.indentPadding.right, 30); + expect(nestedBlock?.indentPadding.right, 24); await editor.dispose(); }); @@ -95,7 +95,7 @@ void main() async { .unwrapOrNull(); expect(nestedBlock?.indentPadding.left, 0); - expect(nestedBlock?.indentPadding.right, 30); + expect(nestedBlock?.indentPadding.right, 24); await editor.dispose(); }); @@ -120,7 +120,7 @@ void main() async { .unwrapOrNull(); expect(nestedBlock?.indentPadding.left, 0); - expect(nestedBlock?.indentPadding.right, 30); + expect(nestedBlock?.indentPadding.right, 24); final selection = Selection.single( path: [0, 0], @@ -134,7 +134,7 @@ void main() async { final nestedBlockAfter = node.key.currentState! .unwrapOrNull(); - expect(nestedBlockAfter?.indentPadding.left, 30); + expect(nestedBlockAfter?.indentPadding.left, 24); expect(nestedBlockAfter?.indentPadding.right, 0); await editor.dispose(); diff --git a/test/plugins/html/encoder/document_html_encoder_test.dart b/test/plugins/html/encoder/document_html_encoder_test.dart index b499d9ac6..9450e9581 100644 --- a/test/plugins/html/encoder/document_html_encoder_test.dart +++ b/test/plugins/html/encoder/document_html_encoder_test.dart @@ -10,7 +10,7 @@ void main() async { const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), - const HtmlTableNodeParser() + const HtmlTableNodeParser(), ]; group('document_html_encoder_test.dart', () { setUpAll(() { diff --git a/test/plugins/html/encoder/parser/image_node_parser_test.dart b/test/plugins/html/encoder/parser/image_node_parser_test.dart index 5ff0e036e..03dd5dea5 100644 --- a/test/plugins/html/encoder/parser/image_node_parser_test.dart +++ b/test/plugins/html/encoder/parser/image_node_parser_test.dart @@ -10,7 +10,7 @@ void main() async { const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), - const HtmlTableNodeParser() + const HtmlTableNodeParser(), ]; group('html_image_node_parser.dart', () { test('parser image node', () { diff --git a/test/plugins/html/encoder/parser/table_node_parser_test.dart b/test/plugins/html/encoder/parser/table_node_parser_test.dart index ba7550693..e039a26ce 100644 --- a/test/plugins/html/encoder/parser/table_node_parser_test.dart +++ b/test/plugins/html/encoder/parser/table_node_parser_test.dart @@ -11,7 +11,7 @@ void main() async { const HTMLQuoteNodeParser(), const HTMLHeadingNodeParser(), const HTMLImageNodeParser(), - const HtmlTableNodeParser() + const HtmlTableNodeParser(), ]; group('html_image_node_parser.dart', () { test('table node parser test', () { diff --git a/test/plugins/html/html_document_test.dart b/test/plugins/html/html_document_test.dart index fc955e10b..320c74e6b 100644 --- a/test/plugins/html/html_document_test.dart +++ b/test/plugins/html/html_document_test.dart @@ -249,53 +249,57 @@ void main() { [ { "insert": "DTrace is a ", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, }, { "insert": "dynamic tracing", - "attributes": {"bg_color": "0xffbbdbba", "bold": true, "italic": true} + "attributes": { + "bg_color": "0xffbbdbba", + "bold": true, + "italic": true, + }, }, { "insert": " technology", - "attributes": {"bg_color": "0xffbbdbba"} + "attributes": {"bg_color": "0xffbbdbba"}, }, { "insert": " that can be used to locate ", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, }, { "insert": "system performance issues", - "attributes": {"bg_color": "0xffe8f3e8"} + "attributes": {"bg_color": "0xffe8f3e8"}, }, { "insert": ", obtain information about ", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, }, { "insert": "system function calls", - "attributes": {"bg_color": "0xffe8f3e8"} + "attributes": {"bg_color": "0xffe8f3e8"}, }, { "insert": ", or monitor system runtime information. And worth noting is that DTrace is ", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, }, { "insert": "non-intrusive", - "attributes": {"bg_color": "0xffe8f3e8", "bold": true} + "attributes": {"bg_color": "0xffe8f3e8", "bold": true}, }, { "insert": " to existing code. Also, there is no need to modify the existing code or use ", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, }, { "insert": "instrumentation technology", - "attributes": {"bg_color": "0xffe8f3e8"} + "attributes": {"bg_color": "0xffe8f3e8"}, }, { "insert": " to obtain more system information.", - "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"} + "attributes": {"bg_color": "0xffffffff", "font_color": "0xff242424"}, } ], );