From 8e5cbfb84e2232f9a6f34c4b46360b02c9e2baf9 Mon Sep 17 00:00:00 2001 From: appflowy Date: Fri, 22 Oct 2021 11:42:25 +0800 Subject: [PATCH] [flutter]: quill editor events flow --- doc/EDITOR.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/doc/EDITOR.md b/doc/EDITOR.md index f24f432344..d4700bfee5 100644 --- a/doc/EDITOR.md +++ b/doc/EDITOR.md @@ -31,3 +31,45 @@ // // ``` + + +``` +// ┌────────────────────────┐ ┌──────────────────┐ +// │ RawGestureDetector │─▶│ RenderEditor │──┐ +// └────────────────────────┘ └──────────────────┘ │ +// │ +// 1. pass the gesture event │ +// │ +// │ +// ┌───────────────────────────────────┐ │ ┌────────────────┐ ┌──────────────────┐ ┌──────────────────────────────┐ +// │RawEditorStateTextInputClientMixin │──┼──▶│QuillController │◀──listen────│ RenderState │──▶│ _didChangeTextEditingValue │ +// └───────────────────────────────────┘ │ └────────────────┘ └──────────────────┘ └──────────────────────────────┘ +// │ │ ▲ │ +// 1. pass the text input event │ │ │ ▼ +// │ └─────2. notify change──────────┘ ┌─────────────────────────────────┐ +// │ │ _onChangeTextEditingValue │ +// ┌─────────────────────────────┐ │ └─────────────────────────────────┘ +// │ RawEditorStateKeyboardMixin │───┘ │ +// └─────────────────────────────┘ ▼ +// ┌──────────────────────┐ Update the ScrollController's pos after +// 1. pass the keyboard cur/ delete/ shortcut event │ _showCaretOnScreen │ post frame +// └──────────────────────┘ +// │ +// ▼ +// ┌──────────────────────┐ +// │ Config cursor timer │ +// └──────────────────────┘ +// │ +// ▼ +// ┌───────────────────────┐ ┌───────────────────────────────────┐ +// │ addPostFrameCallback │─▶│_updateOrDisposeSelectionOverlayIfN│ +// └───────────────────────┘ └───────────────────────────────────┘ +// │ +// │ +// ▼ +// ┌────────────┐ +// │ setState │ make the RenderState to rebuild +// └────────────┘ + + +``` \ No newline at end of file