mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-25 07:07:32 -04:00
chore: open next page when current page get deleted
This commit is contained in:
parent
bdf4e60b48
commit
37f85cebde
25 changed files with 312 additions and 178 deletions
|
@ -14,9 +14,14 @@ import 'application/doc_bloc.dart';
|
|||
import 'styles.dart';
|
||||
|
||||
class DocumentPage extends StatefulWidget {
|
||||
final VoidCallback onDeleted;
|
||||
final ViewPB view;
|
||||
|
||||
DocumentPage({Key? key, required this.view}) : super(key: ValueKey(view.id));
|
||||
DocumentPage({
|
||||
required this.view,
|
||||
required this.onDeleted,
|
||||
Key? key,
|
||||
}) : super(key: ValueKey(view.id));
|
||||
|
||||
@override
|
||||
State<DocumentPage> createState() => _DocumentPageState();
|
||||
|
@ -49,7 +54,8 @@ class _DocumentPageState extends State<DocumentPage> {
|
|||
finish: (result) => result.successOrFail.fold(
|
||||
(_) {
|
||||
if (state.forceClose) {
|
||||
return _renderAppPage();
|
||||
widget.onDeleted();
|
||||
return const SizedBox();
|
||||
} else {
|
||||
return _renderDocument(context, state);
|
||||
}
|
||||
|
@ -134,10 +140,4 @@ class _DocumentPageState extends State<DocumentPage> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _renderAppPage() {
|
||||
return Container(
|
||||
color: Colors.black,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue