feat: bugfixes, finished go_router migration, implemented better visibility of states

This commit is contained in:
Anton Stubenbord
2023-10-06 01:17:08 +02:00
parent ad23df4f89
commit a2c5ced3b7
102 changed files with 1512 additions and 3090 deletions

View File

@@ -40,7 +40,6 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
static const fkContent = 'content';
final GlobalKey<FormBuilderState> _formKey = GlobalKey();
bool _isSubmitLoading = false;
@override
Widget build(BuildContext context) {
@@ -314,18 +313,13 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
tags: (values[fkTags] as IdsTagsQuery?)?.include,
content: values[fkContent],
);
setState(() {
_isSubmitLoading = true;
});
try {
await context.read<DocumentEditCubit>().updateDocument(mergedDocument);
showSnackBar(context, S.of(context)!.documentSuccessfullyUpdated);
} on PaperlessApiException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
} finally {
setState(() {
_isSubmitLoading = false;
});
context.pop();
}
}