Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
chore: format code
Lucas.Xuc4b3c54a7c11
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/service/editor_service.dart b/frontend/app_flowy/packages/flowy_editor/lib/service/editor_service.dartindex 1eceb099f2..de5667fa10 100644--- a/frontend/app_flowy/packages/flowy_editor/lib/service/editor_service.dart+++ b/frontend/app_flowy/packages/flowy_editor/lib/service/editor_service.dart@@ -30,6 +30,14 @@ NodeWidgetBuilders defaultBuilders = {'text/quote': QuotedTextNodeWidgetBuilder(),};+List<FlowyKeyEventHandler> defaultKeyEventHandler = [+ slashShortcutHandler,+ flowyDeleteNodesHandler,+ deleteSingleTextNodeHandler,+ arrowKeysHandler,+ enterInEdgeOfTextNodeHandler,+];+class FlowyEditor extends StatefulWidget {const FlowyEditor({Key? key,@@ -68,7 +76,9 @@ class _FlowyEditorState extends State<FlowyEditor> {void didUpdateWidget(covariant FlowyEditor oldWidget) {super.didUpdateWidget(oldWidget);- editorState.service.renderPluginService = _createRenderPlugin();+ if (editorState.service != oldWidget.editorState.service) {+ editorState.service.renderPluginService = _createRenderPlugin();+ }}@override@@ -82,11 +92,7 @@ class _FlowyEditorState extends State<FlowyEditor> {child: FlowyKeyboard(key: editorState.service.keyboardServiceKey,handlers: [- slashShortcutHandler,- flowyDeleteNodesHandler,- deleteSingleTextNodeHandler,- arrowKeysHandler,- enterInEdgeOfTextNodeHandler,+ ...defaultKeyEventHandler,...widget.keyEventHandlers,],editorState: editorState,diff --git a/frontend/app_flowy/packages/flowy_editor/lib/service/input_service.dart b/frontend/app_flowy/packages/flowy_editor/lib/service/input_service.dartindex 38309414f4..9bc35f10ab 100644--- a/frontend/app_flowy/packages/flowy_editor/lib/service/input_service.dart+++ b/frontend/app_flowy/packages/flowy_editor/lib/service/input_service.dart@@ -1,10 +1,11 @@+import 'package:flutter/material.dart';+import 'package:flutter/services.dart';++import 'package:flowy_editor/document/node.dart';import 'package:flowy_editor/document/position.dart';import 'package:flowy_editor/document/selection.dart';import 'package:flowy_editor/editor_state.dart';-import 'package:flowy_editor/document/node.dart';import 'package:flowy_editor/operation/transaction_builder.dart';-import 'package:flutter/material.dart';-import 'package:flutter/services.dart';mixin FlowyInputService {void attach(TextEditingValue textEditingValue);