Преглед на файлове

[flutter]: quill editor events flow

appflowy преди 3 години
родител
ревизия
8e5cbfb84e
променени са 1 файла, в които са добавени 42 реда и са изтрити 0 реда
  1. 42 0
      doc/EDITOR.md

+ 42 - 0
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
+//                                                                                                                      └────────────┘
+
+
+```