feat: mobile notifications screen (#4100)

* fix: update username on mobile header on change

* feat: notifications page

* feat: refactor and refinement

* fix: code review
This commit is contained in:
Mathias Mogensen 2023-12-08 15:04:09 +02:00 committed by GitHub
parent 2a421034d9
commit 649545cdf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 828 additions and 473 deletions

View file

@ -87,39 +87,37 @@ class _DocumentPageState extends State<DocumentPage> {
child: BlocListener<NotificationActionBloc, NotificationActionState>(
listener: _onNotificationAction,
child: BlocBuilder<DocumentBloc, DocumentState>(
builder: (context, state) {
return state.loadingState.when(
loading: () =>
const Center(child: CircularProgressIndicator.adaptive()),
finish: (result) => result.fold(
(error) {
Log.error(error);
return FlowyErrorPage.message(
error.toString(),
howToFix: LocaleKeys.errorDialog_howToFixFallback.tr(),
builder: (context, state) => state.loadingState.when(
loading: () =>
const Center(child: CircularProgressIndicator.adaptive()),
finish: (result) => result.fold(
(error) {
Log.error(error);
return FlowyErrorPage.message(
error.toString(),
howToFix: LocaleKeys.errorDialog_howToFixFallback.tr(),
);
},
(data) {
if (state.forceClose) {
widget.onDeleted();
return const SizedBox.shrink();
} else if (documentBloc.editorState == null) {
return Center(
child: ExportPageWidget(
onTap: () async => await _exportPage(data),
),
);
},
(data) {
if (state.forceClose) {
widget.onDeleted();
return const SizedBox.shrink();
} else if (documentBloc.editorState == null) {
return Center(
child: ExportPageWidget(
onTap: () async => await _exportPage(data),
),
);
} else {
editorState = documentBloc.editorState!;
return _buildEditorPage(
context,
state,
);
}
},
),
);
},
} else {
editorState = documentBloc.editorState!;
return _buildEditorPage(
context,
state,
);
}
},
),
),
),
),
);