feat: adjust math_equation block and image block on mobile platform (#3890)

* feat: add image toolbar entry

* feat: add ... buttos on math_equation and image block

* fix: review issues

* feat: add copy link and save image to gallery

* feat: support redo / undo on mobile toolbar
This commit is contained in:
Lucas.Xu 2023-11-07 15:24:32 +08:00 committed by GitHub
parent 3e6529aeb8
commit 8116ea1dba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 928 additions and 201 deletions

View file

@ -26,6 +26,22 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:path/path.dart' as p;
enum EditorNotificationType {
undo,
redo,
}
class EditorNotification extends Notification {
const EditorNotification({
required this.type,
});
EditorNotification.undo() : type = EditorNotificationType.undo;
EditorNotification.redo() : type = EditorNotificationType.redo;
final EditorNotificationType type;
}
class DocumentPage extends StatefulWidget {
const DocumentPage({
super.key,
@ -95,7 +111,10 @@ class _DocumentPageState extends State<DocumentPage> {
);
} else {
editorState = documentBloc.editorState!;
return _buildEditorPage(context, state);
return _buildEditorPage(
context,
state,
);
}
},
),
@ -116,6 +135,7 @@ class _DocumentPageState extends State<DocumentPage> {
),
header: _buildCoverAndIcon(context),
);
return Column(
children: [
if (state.isDeleted) _buildBanner(context),