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

@@ -247,8 +247,13 @@ class _DocumentsPageState extends State<DocumentsPage> {
resizeToAvoidBottomInset: true,
body: WillPopScope(
onWillPop: () async {
if (context.read<DocumentsCubit>().state.selection.isNotEmpty) {
context.read<DocumentsCubit>().resetSelection();
final cubit = context.read<DocumentsCubit>();
if (cubit.state.selection.isNotEmpty) {
cubit.resetSelection();
return false;
}
if (cubit.state.filter.appliedFiltersCount > 0 || cubit.state.filter.selectedView != null) {
await _onResetFilter();
return false;
}
return true;

View File

@@ -31,16 +31,19 @@ class DocumentPreview extends StatelessWidget {
Widget build(BuildContext context) {
return ConnectivityAwareActionWrapper(
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: isClickable
? () => DocumentPreviewRoute($extra: document).push(context)
: null,
child: HeroMode(
enabled: enableHero,
child: Hero(
tag: "thumb_${document.id}",
child: _buildPreview(context),
),
),
child: Builder(builder: (context) {
if (enableHero) {
return Hero(
tag: "thumb_${document.id}",
child: _buildPreview(context),
);
}
return _buildPreview(context);
}),
),
);
}

View File

@@ -1,11 +0,0 @@
import 'package:flutter/material.dart';
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
class NewItemsLoadingWidget extends StatelessWidget {
const NewItemsLoadingWidget({super.key});
@override
Widget build(BuildContext context) {
return Center(child: const CircularProgressIndicator().padded());
}
}

View File

@@ -6,7 +6,6 @@ import 'package:paperless_api/paperless_api.dart';
import 'package:paperless_mobile/features/documents/view/pages/documents_page.dart';
import 'package:paperless_mobile/features/documents/view/widgets/search/document_filter_form.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
enum DateRangeSelection { before, after }