From 865195f8c6b2d1a32661707594238c4d656c3229 Mon Sep 17 00:00:00 2001 From: Ali Hassan <71745182+alihassan143@users.noreply.github.com> Date: Fri, 14 Apr 2023 07:10:03 +0500 Subject: [PATCH] feat : allow developer to change toolbar color as well as option to show default toolbar items and html to document converter added (#58) * change toolbar and added export so developer can modify according to its need * revert some chages from examples * html to document convertion added * test added * code formated * node to html added image parameter * toolbar color and elevation added in editor stylee * code formated * remove duplicated exports * fix test improts and formating --- lib/appflowy_editor.dart | 7 +++++-- lib/src/extensions/extensions.dart | 9 +++++++++ lib/src/infra/html_converter.dart | 18 ++++++++++++++++++ .../render/action_menu/action_menu_item.dart | 1 - lib/src/render/rich_text/checkbox_text.dart | 1 - lib/src/render/style/editor_style.dart | 14 ++++++++++++++ lib/src/render/style/plugin_styles.dart | 1 - lib/src/render/toolbar/toolbar_item.dart | 5 ----- lib/src/render/toolbar/toolbar_widget.dart | 5 ++++- .../format_rich_text_style.dart | 1 - lib/src/service/editor_service.dart | 4 +++- .../copy_paste_handler.dart | 1 - .../markdown_syntax_to_styled_text.dart | 2 -- lib/src/service/toolbar_service.dart | 8 +++++--- test/commands/command_extension_test.dart | 1 + test/commands/text_commands_test.dart | 1 - test/extensions/node_extension_test.dart | 2 +- test/infra/flowy_svg_test.dart | 1 - test/infra/html_converter_test.dart | 8 ++++++++ .../action_menu/action_menu_item_test.dart | 2 -- test/render/image/image_node_builder_test.dart | 1 - .../render/image/image_upload_widget_test.dart | 1 - test/render/rich_text/checkbox_text_test.dart | 2 +- .../rich_text/toolbar_rich_text_test.dart | 1 - test/render/style/plugin_styles_test.dart | 1 - .../format_rich_text_style_test.dart | 1 - test/service/editor_service_test.dart | 1 - .../arrow_keys_handler_test.dart | 1 + .../checkbox_event_handler_test.dart | 1 + .../format_style_handler_test.dart | 1 - .../markdown_syntax_to_styled_text_test.dart | 1 - .../redo_undo_handler_test.dart | 1 - 32 files changed, 71 insertions(+), 34 deletions(-) create mode 100644 lib/src/extensions/extensions.dart diff --git a/lib/appflowy_editor.dart b/lib/appflowy_editor.dart index 39eca0b90..7fcb63f69 100644 --- a/lib/appflowy_editor.dart +++ b/lib/appflowy_editor.dart @@ -27,7 +27,6 @@ export 'src/service/input_service.dart'; export 'src/service/shortcut_event/keybinding.dart'; export 'src/service/shortcut_event/shortcut_event.dart'; export 'src/service/shortcut_event/shortcut_event_handler.dart'; -export 'src/extensions/attributes_extension.dart'; export 'src/render/rich_text/default_selectable.dart'; export 'src/render/rich_text/flowy_rich_text.dart'; export 'src/render/selection_menu/selection_menu_widget.dart'; @@ -45,7 +44,11 @@ export 'src/plugins/quill_delta/delta_document_encoder.dart'; export 'src/commands/text/text_commands.dart'; export 'src/commands/command_extension.dart'; export 'src/render/toolbar/toolbar_item.dart'; -export 'src/extensions/node_extensions.dart'; export 'src/render/action_menu/action_menu.dart'; export 'src/render/action_menu/action_menu_item.dart'; export 'src/core/document/node_iterator.dart'; +export 'src/infra/flowy_svg.dart'; +export 'src/extensions/extensions.dart'; +export 'src/service/default_text_operations/format_rich_text_style.dart'; +export 'src/infra/html_converter.dart'; +export 'src/service/internal_key_event_handlers/copy_paste_handler.dart'; diff --git a/lib/src/extensions/extensions.dart b/lib/src/extensions/extensions.dart new file mode 100644 index 000000000..28c34c20f --- /dev/null +++ b/lib/src/extensions/extensions.dart @@ -0,0 +1,9 @@ +export 'attributes_extension.dart'; +export 'color_extension.dart'; +export 'editor_state_extensions.dart'; +export 'node_extensions.dart'; +export 'object_extensions.dart'; +export 'text_node_extensions.dart'; + +export 'text_style_extension.dart'; +export 'url_launcher_extension.dart'; diff --git a/lib/src/infra/html_converter.dart b/lib/src/infra/html_converter.dart index fe544ae5a..c114a1d40 100644 --- a/lib/src/infra/html_converter.dart +++ b/lib/src/infra/html_converter.dart @@ -10,6 +10,8 @@ import 'package:html/parser.dart' show parse; import 'package:html/dom.dart' as html; import 'package:appflowy_editor/src/core/legacy/built_in_attribute_keys.dart'; +import '../core/document/document.dart'; + class HTMLTag { static const h1 = "h1"; static const h2 = "h2"; @@ -60,6 +62,16 @@ class HTMLToNodesConverter { return _handleContainer(childNodes); } + Document toDocument() { + final childNodes = _document.body?.nodes.toList() ?? []; + return Document.fromJson({ + "document": { + "type": "editor", + "children": _handleContainer(childNodes).map((e) => e.toJson()).toList() + } + }); + } + List _handleContainer(List childNodes) { final delta = Delta(); final result = []; @@ -432,6 +444,12 @@ class NodesToHTMLConverter { } else { _addTextNode(textNode); } + } else if (node.type == "image") { + final textNode = node; + final anchor = html.Element.tag(HTMLTag.image); + anchor.attributes["src"] = textNode.attributes["image_src"]; + + _result.add(anchor); } // TODO: handle image and other blocks } diff --git a/lib/src/render/action_menu/action_menu_item.dart b/lib/src/render/action_menu/action_menu_item.dart index ec4104d52..2e59b6db9 100644 --- a/lib/src/render/action_menu/action_menu_item.dart +++ b/lib/src/render/action_menu/action_menu_item.dart @@ -1,5 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/infra/flowy_svg.dart'; import 'package:flutter/material.dart'; /// Represents a single action inside an action menu. diff --git a/lib/src/render/rich_text/checkbox_text.dart b/lib/src/render/rich_text/checkbox_text.dart index c8682272c..956ab66c5 100644 --- a/lib/src/render/rich_text/checkbox_text.dart +++ b/lib/src/render/rich_text/checkbox_text.dart @@ -1,7 +1,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/render/rich_text/built_in_text_widget.dart'; -import 'package:appflowy_editor/src/extensions/text_style_extension.dart'; import 'package:flutter/material.dart'; import 'package:appflowy_editor/src/extensions/theme_extension.dart'; diff --git a/lib/src/render/style/editor_style.dart b/lib/src/render/style/editor_style.dart index 85733f9ab..1cf160ef5 100644 --- a/lib/src/render/style/editor_style.dart +++ b/lib/src/render/style/editor_style.dart @@ -22,6 +22,8 @@ class EditorStyle extends ThemeExtension { final Color? selectionMenuItemSelectedTextColor; final Color? selectionMenuItemSelectedIconColor; final Color? selectionMenuItemSelectedColor; + final Color? toolbarColor; + final double toolbarElevation; // Text styles final EdgeInsets? textPadding; @@ -49,6 +51,8 @@ class EditorStyle extends ThemeExtension { required this.selectionMenuItemSelectedTextColor, required this.selectionMenuItemSelectedIconColor, required this.selectionMenuItemSelectedColor, + required this.toolbarColor, + required this.toolbarElevation, required this.textPadding, required this.textStyle, required this.placeholderTextStyle, @@ -74,6 +78,8 @@ class EditorStyle extends ThemeExtension { Color? selectionMenuItemSelectedTextColor, Color? selectionMenuItemSelectedIconColor, Color? selectionMenuItemSelectedColor, + Color? toolbarColor, + double? toolbarElevation, TextStyle? textStyle, TextStyle? placeholderTextStyle, TextStyle? bold, @@ -102,6 +108,8 @@ class EditorStyle extends ThemeExtension { this.selectionMenuItemSelectedIconColor, selectionMenuItemSelectedColor: selectionMenuItemSelectedColor ?? this.selectionMenuItemSelectedColor, + toolbarColor: toolbarColor ?? this.toolbarColor, + toolbarElevation: toolbarElevation ?? this.toolbarElevation, textPadding: textPadding ?? textPadding, textStyle: textStyle ?? this.textStyle, placeholderTextStyle: placeholderTextStyle ?? this.placeholderTextStyle, @@ -160,6 +168,8 @@ class EditorStyle extends ThemeExtension { other.selectionMenuItemSelectedColor, t, ), + toolbarColor: Color.lerp(toolbarColor, other.toolbarColor, t), + toolbarElevation: toolbarElevation, textStyle: TextStyle.lerp(textStyle, other.textStyle, t), placeholderTextStyle: TextStyle.lerp(placeholderTextStyle, other.placeholderTextStyle, t), @@ -189,6 +199,8 @@ class EditorStyle extends ThemeExtension { selectionMenuItemSelectedTextColor: const Color.fromARGB(255, 56, 91, 247), selectionMenuItemSelectedIconColor: const Color.fromARGB(255, 56, 91, 247), selectionMenuItemSelectedColor: const Color(0xFFE0F8FF), + toolbarColor: const Color(0xFF333333), + toolbarElevation: 0.0, textPadding: const EdgeInsets.symmetric(vertical: 8.0), textStyle: const TextStyle(fontSize: 16.0, color: Colors.black), placeholderTextStyle: const TextStyle(fontSize: 16.0, color: Colors.grey), @@ -222,5 +234,7 @@ class EditorStyle extends ThemeExtension { selectionMenuItemSelectedTextColor: const Color(0xFF131720), selectionMenuItemSelectedIconColor: const Color(0xFF131720), selectionMenuItemSelectedColor: const Color(0xFF00BCF0), + toolbarColor: const Color(0xFF131720), + toolbarElevation: 0.0, ); } diff --git a/lib/src/render/style/plugin_styles.dart b/lib/src/render/style/plugin_styles.dart index 745bf4378..9ab9e589d 100644 --- a/lib/src/render/style/plugin_styles.dart +++ b/lib/src/render/style/plugin_styles.dart @@ -1,5 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/infra/flowy_svg.dart'; import 'package:flutter/material.dart'; Iterable> get lightPluginStyleExtension => [ diff --git a/lib/src/render/toolbar/toolbar_item.dart b/lib/src/render/toolbar/toolbar_item.dart index 16f95ce67..79bbf6482 100644 --- a/lib/src/render/toolbar/toolbar_item.dart +++ b/lib/src/render/toolbar/toolbar_item.dart @@ -1,13 +1,8 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/url_launcher_extension.dart'; import 'package:appflowy_editor/src/flutter/overlay.dart'; import 'package:appflowy_editor/src/infra/clipboard.dart'; -import 'package:appflowy_editor/src/infra/flowy_svg.dart'; import 'package:appflowy_editor/src/render/color_menu/color_picker.dart'; import 'package:appflowy_editor/src/render/link_menu/link_menu.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; -import 'package:appflowy_editor/src/extensions/editor_state_extensions.dart'; -import 'package:appflowy_editor/src/service/default_text_operations/format_rich_text_style.dart'; import 'package:flutter/foundation.dart'; import 'dart:io' show Platform; diff --git a/lib/src/render/toolbar/toolbar_widget.dart b/lib/src/render/toolbar/toolbar_widget.dart index fc9df7346..905dc3466 100644 --- a/lib/src/render/toolbar/toolbar_widget.dart +++ b/lib/src/render/toolbar/toolbar_widget.dart @@ -22,7 +22,9 @@ class ToolbarWidget extends StatefulWidget { final EditorState editorState; final LayerLink layerLink; final Offset offset; + final List items; + final Alignment alignment; @override @@ -56,7 +58,8 @@ class _ToolbarWidgetState extends State with ToolbarMixin { Widget _buildToolbar(BuildContext context) { return Material( borderRadius: BorderRadius.circular(8.0), - color: const Color(0xFF333333), + color: widget.editorState.editorStyle.toolbarColor, + elevation: widget.editorState.editorStyle.toolbarElevation, child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: SizedBox( diff --git a/lib/src/service/default_text_operations/format_rich_text_style.dart b/lib/src/service/default_text_operations/format_rich_text_style.dart index ea13ba53d..b835b1579 100644 --- a/lib/src/service/default_text_operations/format_rich_text_style.dart +++ b/lib/src/service/default_text_operations/format_rich_text_style.dart @@ -1,5 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; void insertHeadingAfterSelection(EditorState editorState, String heading) { insertTextNodeAfterSelection(editorState, { diff --git a/lib/src/service/editor_service.dart b/lib/src/service/editor_service.dart index 4ecf0d699..66d6264e9 100644 --- a/lib/src/service/editor_service.dart +++ b/lib/src/service/editor_service.dart @@ -34,6 +34,7 @@ class AppFlowyEditor extends StatefulWidget { this.autoFocus = false, this.focusedSelection, this.customActionMenuBuilder, + this.showDefaultToolbar = true, this.shrinkWrap = false, ThemeData? themeData, }) : super(key: key) { @@ -53,7 +54,7 @@ class AppFlowyEditor extends StatefulWidget { /// Keyboard event handlers. final List shortcutEvents; - + final bool showDefaultToolbar; final List selectionMenuItems; final List toolbarItems; @@ -170,6 +171,7 @@ class _AppFlowyEditorState extends State { ], editorState: editorState, child: FlowyToolbar( + showDefaultToolbar: widget.showDefaultToolbar, key: editorState.service.toolbarServiceKey, editorState: editorState, child: diff --git a/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart b/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart index 3aec3e994..f29195769 100644 --- a/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart +++ b/lib/src/service/internal_key_event_handlers/copy_paste_handler.dart @@ -1,6 +1,5 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/infra/clipboard.dart'; -import 'package:appflowy_editor/src/infra/html_converter.dart'; import 'package:appflowy_editor/src/service/internal_key_event_handlers/number_list_helper.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/service/internal_key_event_handlers/markdown_syntax_to_styled_text.dart b/lib/src/service/internal_key_event_handlers/markdown_syntax_to_styled_text.dart index c3af14e7e..8532fde24 100644 --- a/lib/src/service/internal_key_event_handlers/markdown_syntax_to_styled_text.dart +++ b/lib/src/service/internal_key_event_handlers/markdown_syntax_to_styled_text.dart @@ -1,6 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; -import 'package:appflowy_editor/src/service/default_text_operations/format_rich_text_style.dart'; import 'package:flutter/material.dart'; diff --git a/lib/src/service/toolbar_service.dart b/lib/src/service/toolbar_service.dart index 2d63ac815..3b4e14a19 100644 --- a/lib/src/service/toolbar_service.dart +++ b/lib/src/service/toolbar_service.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart' hide Overlay, OverlayEntry; import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/render/toolbar/toolbar_widget.dart'; -import 'package:appflowy_editor/src/extensions/object_extensions.dart'; abstract class AppFlowyToolbarService { /// Show the toolbar widget beside the offset. @@ -25,8 +24,9 @@ class FlowyToolbar extends StatefulWidget { Key? key, required this.editorState, required this.child, + required this.showDefaultToolbar, }) : super(key: key); - + final bool showDefaultToolbar; final EditorState editorState; final Widget child; @@ -44,7 +44,9 @@ class _FlowyToolbarState extends State void initState() { super.initState(); - toolbarItems = [...defaultToolbarItems, ...widget.editorState.toolbarItems] + toolbarItems = widget.showDefaultToolbar + ? [...defaultToolbarItems, ...widget.editorState.toolbarItems] + : [...widget.editorState.toolbarItems] ..sort((a, b) => a.type.compareTo(b.type)); } diff --git a/test/commands/command_extension_test.dart b/test/commands/command_extension_test.dart index 272c52fac..dc4a9cf81 100644 --- a/test/commands/command_extension_test.dart +++ b/test/commands/command_extension_test.dart @@ -1,5 +1,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter_test/flutter_test.dart'; + import '../infra/test_editor.dart'; void main() { diff --git a/test/commands/text_commands_test.dart b/test/commands/text_commands_test.dart index ad369eeaf..ba1e0fe21 100644 --- a/test/commands/text_commands_test.dart +++ b/test/commands/text_commands_test.dart @@ -1,6 +1,5 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../infra/test_editor.dart'; void main() { diff --git a/test/extensions/node_extension_test.dart b/test/extensions/node_extension_test.dart index f5da3e2cd..e1d404967 100644 --- a/test/extensions/node_extension_test.dart +++ b/test/extensions/node_extension_test.dart @@ -2,8 +2,8 @@ import 'dart:collection'; import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter_test/flutter_test.dart'; -import '../infra/test_editor.dart'; import 'package:mockito/mockito.dart'; +import '../infra/test_editor.dart'; class MockNode extends Mock implements Node {} diff --git a/test/infra/flowy_svg_test.dart b/test/infra/flowy_svg_test.dart index 3b24c8df5..6dc99cfdb 100644 --- a/test/infra/flowy_svg_test.dart +++ b/test/infra/flowy_svg_test.dart @@ -2,7 +2,6 @@ import 'package:appflowy_editor/src/infra/flowy_svg.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../test_helper.dart'; void main() { diff --git a/test/infra/html_converter_test.dart b/test/infra/html_converter_test.dart index c81cd6da9..6e34e8158 100644 --- a/test/infra/html_converter_test.dart +++ b/test/infra/html_converter_test.dart @@ -25,6 +25,14 @@ void main() { expect(html.isNotEmpty, true); }); }); + group('HTMLConverterDocument tests', () { + test('HTMLToNodesConverter', () { + final converter = HTMLToNodesConverter(rawHTML); + final document = converter.toDocument(); + + expect(document.root.children.isNotEmpty, true); + }); + }); } const rawHTML = """

AppFlowyEditor

diff --git a/test/render/action_menu/action_menu_item_test.dart b/test/render/action_menu/action_menu_item_test.dart index 8719b1b8f..21cdd68f9 100644 --- a/test/render/action_menu/action_menu_item_test.dart +++ b/test/render/action_menu/action_menu_item_test.dart @@ -1,8 +1,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/infra/flowy_svg.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../../test_helper.dart'; void main() { diff --git a/test/render/image/image_node_builder_test.dart b/test/render/image/image_node_builder_test.dart index 779e025ae..b8bd1862d 100644 --- a/test/render/image/image_node_builder_test.dart +++ b/test/render/image/image_node_builder_test.dart @@ -4,7 +4,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:network_image_mock/network_image_mock.dart'; - import '../../infra/test_editor.dart'; void main() async { diff --git a/test/render/image/image_upload_widget_test.dart b/test/render/image/image_upload_widget_test.dart index dd55f8f23..715e59adb 100644 --- a/test/render/image/image_upload_widget_test.dart +++ b/test/render/image/image_upload_widget_test.dart @@ -1,7 +1,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/render/image/image_upload_widget.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../../infra/test_editor.dart'; void main() { diff --git a/test/render/rich_text/checkbox_text_test.dart b/test/render/rich_text/checkbox_text_test.dart index b8da2511a..53d363763 100644 --- a/test/render/rich_text/checkbox_text_test.dart +++ b/test/render/rich_text/checkbox_text_test.dart @@ -1,7 +1,7 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; + import '../../infra/test_editor.dart'; void main() async { diff --git a/test/render/rich_text/toolbar_rich_text_test.dart b/test/render/rich_text/toolbar_rich_text_test.dart index 2e9bcf084..aa23167eb 100644 --- a/test/render/rich_text/toolbar_rich_text_test.dart +++ b/test/render/rich_text/toolbar_rich_text_test.dart @@ -1,5 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; import 'package:appflowy_editor/src/render/toolbar/toolbar_item_widget.dart'; import 'package:appflowy_editor/src/render/toolbar/toolbar_widget.dart'; import 'package:flutter/material.dart'; diff --git a/test/render/style/plugin_styles_test.dart b/test/render/style/plugin_styles_test.dart index aefb14d2b..d7b1f0290 100644 --- a/test/render/style/plugin_styles_test.dart +++ b/test/render/style/plugin_styles_test.dart @@ -1,7 +1,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../../infra/test_editor.dart'; void main() { diff --git a/test/service/default_text_operations/format_rich_text_style_test.dart b/test/service/default_text_operations/format_rich_text_style_test.dart index ccece4102..cb3ef681a 100644 --- a/test/service/default_text_operations/format_rich_text_style_test.dart +++ b/test/service/default_text_operations/format_rich_text_style_test.dart @@ -1,6 +1,5 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/render/rich_text/quoted_text.dart'; -import 'package:appflowy_editor/src/service/default_text_operations/format_rich_text_style.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../infra/test_editor.dart'; diff --git a/test/service/editor_service_test.dart b/test/service/editor_service_test.dart index c7b3816b2..5ae3d36a9 100644 --- a/test/service/editor_service_test.dart +++ b/test/service/editor_service_test.dart @@ -1,6 +1,5 @@ import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter_test/flutter_test.dart'; - import '../infra/test_editor.dart'; void main() { diff --git a/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart b/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart index d72695509..c5eb1dcc4 100644 --- a/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart +++ b/test/service/internal_key_event_handlers/arrow_keys_handler_test.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; + import '../../infra/test_editor.dart'; void main() async { diff --git a/test/service/internal_key_event_handlers/checkbox_event_handler_test.dart b/test/service/internal_key_event_handlers/checkbox_event_handler_test.dart index 03d5c78d0..d5bd4ab92 100644 --- a/test/service/internal_key_event_handlers/checkbox_event_handler_test.dart +++ b/test/service/internal_key_event_handlers/checkbox_event_handler_test.dart @@ -5,6 +5,7 @@ import 'package:appflowy_editor/src/service/shortcut_event/built_in_shortcut_eve import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; + import '../../infra/test_editor.dart'; void main() async { diff --git a/test/service/internal_key_event_handlers/format_style_handler_test.dart b/test/service/internal_key_event_handlers/format_style_handler_test.dart index c9341b232..9dc76e95b 100644 --- a/test/service/internal_key_event_handlers/format_style_handler_test.dart +++ b/test/service/internal_key_event_handlers/format_style_handler_test.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/src/render/link_menu/link_menu.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; import 'package:appflowy_editor/src/render/toolbar/toolbar_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/test/service/internal_key_event_handlers/markdown_syntax_to_styled_text_test.dart b/test/service/internal_key_event_handlers/markdown_syntax_to_styled_text_test.dart index facde8419..6d93e6dd1 100644 --- a/test/service/internal_key_event_handlers/markdown_syntax_to_styled_text_test.dart +++ b/test/service/internal_key_event_handlers/markdown_syntax_to_styled_text_test.dart @@ -1,5 +1,4 @@ import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../infra/test_editor.dart'; diff --git a/test/service/internal_key_event_handlers/redo_undo_handler_test.dart b/test/service/internal_key_event_handlers/redo_undo_handler_test.dart index 1dc1097d2..2d9dd292a 100644 --- a/test/service/internal_key_event_handlers/redo_undo_handler_test.dart +++ b/test/service/internal_key_event_handlers/redo_undo_handler_test.dart @@ -1,7 +1,6 @@ import 'dart:io'; import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:appflowy_editor/src/extensions/text_node_extensions.dart'; import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../infra/test_editor.dart';