feat: optimize the performance (#442)
This commit is contained in:
parent
ad55171c5b
commit
19f999f422
1 changed files with 4639 additions and 828 deletions
|
|
@ -47,6 +47,13 @@ class TestableEditor {
|
|||
if (withFloatingToolbar) {
|
||||
scrollController ??= ScrollController();
|
||||
}
|
||||
|
||||
final editorScrollController = EditorScrollController(
|
||||
editorState: editorState,
|
||||
shrinkWrap: shrinkWrap,
|
||||
scrollController: scrollController,
|
||||
);
|
||||
|
||||
Widget editor = Builder(
|
||||
builder: (context) {
|
||||
return AppFlowyEditor(
|
||||
|
|
@ -54,7 +61,7 @@ class TestableEditor {
|
|||
editable: editable,
|
||||
autoFocus: autoFocus,
|
||||
shrinkWrap: shrinkWrap,
|
||||
scrollController: scrollController,
|
||||
editorScrollController: editorScrollController,
|
||||
commandShortcutEvents: [
|
||||
...standardCommandShortcutEvents,
|
||||
...TestableFindAndReplaceCommands(context: context)
|
||||
|
|
@ -66,6 +73,7 @@ class TestableEditor {
|
|||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (withFloatingToolbar) {
|
||||
if (inMobile) {
|
||||
final items = [
|
||||
|
|
@ -83,7 +91,6 @@ class TestableEditor {
|
|||
child: AppFlowyEditor(
|
||||
editorStyle: const EditorStyle.mobile(),
|
||||
editorState: editorState,
|
||||
scrollController: scrollController,
|
||||
),
|
||||
),
|
||||
MobileToolbar(
|
||||
|
|
@ -106,7 +113,7 @@ class TestableEditor {
|
|||
buildHighlightColorItem()
|
||||
],
|
||||
editorState: editorState,
|
||||
scrollController: scrollController!,
|
||||
editorScrollController: editorScrollController,
|
||||
child: editor,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue