From 5d2160b0bb3e39a8955371fbc500e9e544625dcd Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 6 Sep 2022 13:00:39 +0800 Subject: [PATCH] chore: rename keyEventHandlers to shortcutEvents --- .../packages/appflowy_editor/example/lib/main.dart | 2 +- .../appflowy_editor/lib/src/service/editor_service.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart b/frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart index 80e1813e89..921628ff21 100644 --- a/frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart +++ b/frontend/app_flowy/packages/appflowy_editor/example/lib/main.dart @@ -96,7 +96,7 @@ class _MyHomePageState extends State { child: AppFlowyEditor( editorState: _editorState, editorStyle: const EditorStyle.defaultStyle(), - keyEventHandlers: [ + shortcutEvents: [ underscoreToItalicEvent, ], ), diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart index 9465d44de4..ba9c45732b 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/service/editor_service.dart @@ -36,7 +36,7 @@ class AppFlowyEditor extends StatefulWidget { Key? key, required this.editorState, this.customBuilders = const {}, - this.keyEventHandlers = const [], + this.shortcutEvents = const [], this.selectionMenuItems = const [], this.editorStyle = const EditorStyle.defaultStyle(), }) : super(key: key); @@ -47,7 +47,7 @@ class AppFlowyEditor extends StatefulWidget { final NodeWidgetBuilders customBuilders; /// Keyboard event handlers. - final List keyEventHandlers; + final List shortcutEvents; final List selectionMenuItems; @@ -96,7 +96,7 @@ class _AppFlowyEditorState extends State { key: editorState.service.keyboardServiceKey, shortcutEvents: [ ...builtInShortcutEvents, - ...widget.keyEventHandlers, + ...widget.shortcutEvents, ], editorState: editorState, child: FlowyToolbar(