chore: Update go_router configuration to use go_router_builder

This commit is contained in:
Anton Stubenbord
2023-10-08 16:42:42 +02:00
parent a17b041a0d
commit d4951e1c82
44 changed files with 388 additions and 437 deletions

View File

@@ -25,6 +25,7 @@ import 'package:paperless_mobile/features/tasks/model/pending_tasks_notifier.dar
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/helpers/message_helpers.dart';
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
import 'package:sliver_tools/sliver_tools.dart';
class DocumentFilterIntent {
@@ -620,9 +621,9 @@ class _DocumentsPageState extends State<DocumentsPage> {
final cubit = context.read<DocumentsCubit>();
try {
switch (cubit.state.filter.storagePath){
case SetIdQueryParameter(id: var id):
if (id == pathId) {
switch (cubit.state.filter.storagePath) {
case SetIdQueryParameter(id: var id):
if (id == pathId) {
cubit.updateCurrentFilter(
(filter) =>
filter.copyWith(storagePath: const UnsetIdQueryParameter()),
@@ -634,14 +635,13 @@ class _DocumentsPageState extends State<DocumentsPage> {
);
}
break;
default:
cubit.updateCurrentFilter(
default:
cubit.updateCurrentFilter(
(filter) =>
filter.copyWith(storagePath: SetIdQueryParameter(id: pathId)),
filter.copyWith(storagePath: SetIdQueryParameter(id: pathId)),
);
break;
}
} on PaperlessApiException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
}

View File

@@ -20,7 +20,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
),
const SizedBox(height: 16),
Text(
document.title,
document.title ?? document.originalFileName ?? '-',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(

View File

@@ -4,6 +4,7 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:paperless_api/paperless_api.dart';
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
import 'package:provider/provider.dart';
import 'package:shimmer/shimmer.dart';

View File

@@ -110,7 +110,7 @@ class DocumentDetailedItem extends DocumentItem {
],
).paddedLTRB(8, 8, 8, 4),
Text(
document.title,
document.title ?? '-',
style: Theme.of(context).textTheme.titleMedium,
maxLines: 2,
overflow: TextOverflow.ellipsis,

View File

@@ -113,7 +113,7 @@ class DocumentGridItem extends DocumentItem {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
document.title,
document.title ?? '-',
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.titleMedium,

View File

@@ -58,7 +58,7 @@ class DocumentListItem extends DocumentItem {
],
),
Text(
document.title,
document.title ?? '-',
overflow: TextOverflow.ellipsis,
maxLines: 1,
),

View File

@@ -44,7 +44,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
return ListTile(
dense: true,
title: Text(
doc.title,
doc.title ?? doc.originalFileName ?? '-',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(

View File

@@ -7,6 +7,7 @@ import 'package:paperless_mobile/features/documents/view/widgets/selection/bulk_
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/helpers/message_helpers.dart';
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
class DocumentSelectionSliverAppBar extends StatelessWidget {
final DocumentsState state;