Updated onboarding, reformatted files, improved referenced documents view, updated error handling

This commit is contained in:
Anton Stubenbord
2022-11-03 22:15:36 +01:00
parent 2f2312d5f3
commit 40133b6e0e
117 changed files with 1788 additions and 1021 deletions

View File

@@ -23,19 +23,16 @@ class EditCorrespondentPage extends StatelessWidget {
);
}
Future<void> _onDelete(Correspondent correspondent, BuildContext context) async {
try {
await BlocProvider.of<CorrespondentCubit>(context).remove(correspondent);
final cubit = BlocProvider.of<DocumentsCubit>(context);
if (cubit.state.filter.correspondent.id == correspondent.id) {
cubit.updateFilter(
filter: cubit.state.filter.copyWith(correspondent: const CorrespondentQuery.unset()),
);
}
} on ErrorMessage catch (e) {
showSnackBar(context, translateError(context, e.code));
} finally {
Navigator.pop(context);
Future<void> _onDelete(
Correspondent correspondent, BuildContext context) async {
await BlocProvider.of<CorrespondentCubit>(context).remove(correspondent);
final cubit = BlocProvider.of<DocumentsCubit>(context);
if (cubit.state.filter.correspondent.id == correspondent.id) {
cubit.updateFilter(
filter: cubit.state.filter
.copyWith(correspondent: const CorrespondentQuery.unset()),
);
}
Navigator.pop(context);
}
}