mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-25 16:30:03 +00:00
fix: continue writing edge case (#7535)
This commit is contained in:
parent
36bf90e81b
commit
6ac9ad1cac
@ -55,6 +55,8 @@ class _DocumentPageState extends State<DocumentPage>
|
||||
Selection? initialSelection;
|
||||
late final documentBloc = DocumentBloc(documentId: widget.view.id)
|
||||
..add(const DocumentEvent.initial());
|
||||
late final viewBloc = ViewBloc(view: widget.view)
|
||||
..add(const ViewEvent.initial());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -66,6 +68,7 @@ class _DocumentPageState extends State<DocumentPage>
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
documentBloc.close();
|
||||
viewBloc.close();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@ -88,14 +91,9 @@ class _DocumentPageState extends State<DocumentPage>
|
||||
BlocProvider.value(value: documentBloc),
|
||||
BlocProvider.value(
|
||||
value: ViewLockStatusBloc(view: widget.view)
|
||||
..add(
|
||||
ViewLockStatusEvent.initial(),
|
||||
),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (_) =>
|
||||
ViewBloc(view: widget.view)..add(const ViewEvent.initial()),
|
||||
..add(ViewLockStatusEvent.initial()),
|
||||
),
|
||||
BlocProvider.value(value: viewBloc),
|
||||
],
|
||||
child: BlocConsumer<ViewLockStatusBloc, ViewLockStatusState>(
|
||||
listenWhen: (prev, curr) => curr.isLocked != prev.isLocked,
|
||||
|
Loading…
x
Reference in New Issue
Block a user