feat: support mention page on mobile (#5158)

* feat: support mention page on mobile

* chore: clean up toggle notifier

* fix: changes after merge

* fix: depends on inherited widget error

* fix: amend after merge

* feat: add icon to search

* chore: slight style changes

* chore: revert podfile change

* ci: fix disposal
This commit is contained in:
Mathias Mogensen 2024-05-02 02:10:56 +02:00 committed by GitHub
parent 6bfac6b80a
commit e1e8747f15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 425 additions and 333 deletions

View file

@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/application/page_style/document_page_style_bloc.dart';
import 'package:appflowy/plugins/document/application/document_bloc.dart';
@ -16,7 +18,6 @@ import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class DocumentPage extends StatefulWidget {
@ -153,9 +154,9 @@ class _DocumentPageState extends State<DocumentPage>
onRestore: () => context.read<DocumentBloc>().add(
const DocumentEvent.restorePage(),
),
onDelete: () => context.read<DocumentBloc>().add(
const DocumentEvent.deletePermanently(),
),
onDelete: () => context
.read<DocumentBloc>()
.add(const DocumentEvent.deletePermanently()),
);
}
@ -178,12 +179,10 @@ class _DocumentPageState extends State<DocumentPage>
node: page,
editorState: editorState,
view: widget.view,
onIconChanged: (icon) async {
await ViewBackendService.updateViewIcon(
viewId: widget.view.id,
viewIcon: icon,
);
},
onIconChanged: (icon) async => ViewBackendService.updateViewIcon(
viewId: widget.view.id,
viewIcon: icon,
),
);
}
@ -196,10 +195,9 @@ class _DocumentPageState extends State<DocumentPage>
undoCommand.execute(editorState);
} else if (type == EditorNotificationType.redo) {
redoCommand.execute(editorState);
} else if (type == EditorNotificationType.exitEditing) {
if (editorState.selection != null) {
editorState.selection = null;
}
} else if (type == EditorNotificationType.exitEditing &&
editorState.selection != null) {
editorState.selection = null;
}
}