mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-08 06:07:48 -06:00
chore: Update go_router configuration to use go_router_builder
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:paperless_mobile/features/sharing/cubit/receive_share_cubit.dart
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/upload_queue_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/upload_queue_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/settings_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/settings_route.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ class DocumentDetailsCubit extends Cubit<DocumentDetailsState> {
|
|||||||
throw Exception("An error occurred while downloading the document.");
|
throw Exception("An error occurred while downloading the document.");
|
||||||
}
|
}
|
||||||
Printing.layoutPdf(
|
Printing.layoutPdf(
|
||||||
name: state.document.title,
|
name: state.document.title ?? 'Document',
|
||||||
onLayout: (format) => file.readAsBytesSync(),
|
onLayout: (format) => file.readAsBytesSync(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
|||||||
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
|
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class DocumentDetailsPage extends StatefulWidget {
|
class DocumentDetailsPage extends StatefulWidget {
|
||||||
final bool isLabelClickable;
|
final bool isLabelClickable;
|
||||||
@@ -48,6 +49,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
|||||||
final hasMultiUserSupport =
|
final hasMultiUserSupport =
|
||||||
context.watch<LocalUserAccount>().hasMultiUserSupport;
|
context.watch<LocalUserAccount>().hasMultiUserSupport;
|
||||||
final tabLength = 4 + (hasMultiUserSupport && false ? 1 : 0);
|
final tabLength = 4 + (hasMultiUserSupport && false ? 1 : 0);
|
||||||
|
final title = context.watch<DocumentDetailsCubit>().state.document.title;
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
Navigator.of(context)
|
Navigator.of(context)
|
||||||
@@ -74,11 +76,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
|||||||
handle:
|
handle:
|
||||||
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
NestedScrollView.sliverOverlapAbsorberHandleFor(context),
|
||||||
sliver: SliverAppBar(
|
sliver: SliverAppBar(
|
||||||
title: Text(context
|
title: title != null ? Text(title) : null,
|
||||||
.watch<DocumentDetailsCubit>()
|
|
||||||
.state
|
|
||||||
.document
|
|
||||||
.title),
|
|
||||||
leading: const BackButton(),
|
leading: const BackButton(),
|
||||||
pinned: true,
|
pinned: true,
|
||||||
forceElevated: innerBoxIsScrolled,
|
forceElevated: innerBoxIsScrolled,
|
||||||
@@ -103,6 +101,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
|||||||
enableHero: false,
|
enableHero: false,
|
||||||
document: state.document,
|
document: state.document,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
|
alignment: Alignment.topCenter,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
@@ -221,10 +220,6 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
|||||||
document: state.document,
|
document: state.document,
|
||||||
itemSpacing: _itemSpacing,
|
itemSpacing: _itemSpacing,
|
||||||
queryString: widget.titleAndContentQueryString,
|
queryString: widget.titleAndContentQueryString,
|
||||||
availableCorrespondents: state.correspondents,
|
|
||||||
availableDocumentTypes: state.documentTypes,
|
|
||||||
availableTags: state.tags,
|
|
||||||
availableStoragePaths: state.storagePaths,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:paperless_api/paperless_api.dart';
|
import 'package:paperless_api/paperless_api.dart';
|
||||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||||
|
import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||||
import 'package:paperless_mobile/core/widgets/highlighted_text.dart';
|
import 'package:paperless_mobile/core/widgets/highlighted_text.dart';
|
||||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||||
import 'package:paperless_mobile/features/document_details/view/widgets/details_item.dart';
|
import 'package:paperless_mobile/features/document_details/view/widgets/details_item.dart';
|
||||||
@@ -12,31 +13,27 @@ import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
|||||||
|
|
||||||
class DocumentOverviewWidget extends StatelessWidget {
|
class DocumentOverviewWidget extends StatelessWidget {
|
||||||
final DocumentModel document;
|
final DocumentModel document;
|
||||||
final Map<int, Correspondent> availableCorrespondents;
|
|
||||||
final Map<int, DocumentType> availableDocumentTypes;
|
|
||||||
final Map<int, Tag> availableTags;
|
|
||||||
final Map<int, StoragePath> availableStoragePaths;
|
|
||||||
final String? queryString;
|
final String? queryString;
|
||||||
final double itemSpacing;
|
final double itemSpacing;
|
||||||
|
|
||||||
const DocumentOverviewWidget({
|
const DocumentOverviewWidget({
|
||||||
super.key,
|
super.key,
|
||||||
required this.document,
|
required this.document,
|
||||||
this.queryString,
|
this.queryString,
|
||||||
required this.itemSpacing,
|
required this.itemSpacing,
|
||||||
required this.availableCorrespondents,
|
|
||||||
required this.availableDocumentTypes,
|
|
||||||
required this.availableTags,
|
|
||||||
required this.availableStoragePaths,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final user = context.watch<LocalUserAccount>().paperlessUser;
|
||||||
|
final availableLabels = context.watch<LabelRepository>().state;
|
||||||
return SliverList.list(
|
return SliverList.list(
|
||||||
children: [
|
children: [
|
||||||
|
if (document.title != null)
|
||||||
DetailsItem(
|
DetailsItem(
|
||||||
label: S.of(context)!.title,
|
label: S.of(context)!.title,
|
||||||
content: HighlightedText(
|
content: HighlightedText(
|
||||||
text: document.title,
|
text: document.title!,
|
||||||
highlights: queryString?.split(" ") ?? [],
|
highlights: queryString?.split(" ") ?? [],
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
),
|
),
|
||||||
@@ -46,47 +43,38 @@ class DocumentOverviewWidget extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
label: S.of(context)!.createdAt,
|
label: S.of(context)!.createdAt,
|
||||||
).paddedOnly(bottom: itemSpacing),
|
).paddedOnly(bottom: itemSpacing),
|
||||||
if (document.documentType != null &&
|
if (document.documentType != null && user.canViewDocumentTypes)
|
||||||
context
|
|
||||||
.watch<LocalUserAccount>()
|
|
||||||
.paperlessUser
|
|
||||||
.canViewDocumentTypes)
|
|
||||||
DetailsItem(
|
DetailsItem(
|
||||||
label: S.of(context)!.documentType,
|
label: S.of(context)!.documentType,
|
||||||
content: LabelText<DocumentType>(
|
content: LabelText<DocumentType>(
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
label: availableDocumentTypes[document.documentType],
|
label: availableLabels.documentTypes[document.documentType],
|
||||||
),
|
),
|
||||||
).paddedOnly(bottom: itemSpacing),
|
).paddedOnly(bottom: itemSpacing),
|
||||||
if (document.correspondent != null &&
|
if (document.correspondent != null && user.canViewCorrespondents)
|
||||||
context
|
|
||||||
.watch<LocalUserAccount>()
|
|
||||||
.paperlessUser
|
|
||||||
.canViewCorrespondents)
|
|
||||||
DetailsItem(
|
DetailsItem(
|
||||||
label: S.of(context)!.correspondent,
|
label: S.of(context)!.correspondent,
|
||||||
content: LabelText<Correspondent>(
|
content: LabelText<Correspondent>(
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
label: availableCorrespondents[document.correspondent],
|
label: availableLabels.correspondents[document.correspondent],
|
||||||
),
|
),
|
||||||
).paddedOnly(bottom: itemSpacing),
|
).paddedOnly(bottom: itemSpacing),
|
||||||
if (document.storagePath != null &&
|
if (document.storagePath != null && user.canViewStoragePaths)
|
||||||
context.watch<LocalUserAccount>().paperlessUser.canViewStoragePaths)
|
|
||||||
DetailsItem(
|
DetailsItem(
|
||||||
label: S.of(context)!.storagePath,
|
label: S.of(context)!.storagePath,
|
||||||
content: LabelText<StoragePath>(
|
content: LabelText<StoragePath>(
|
||||||
label: availableStoragePaths[document.storagePath],
|
label: availableLabels.storagePaths[document.storagePath],
|
||||||
),
|
),
|
||||||
).paddedOnly(bottom: itemSpacing),
|
).paddedOnly(bottom: itemSpacing),
|
||||||
if (document.tags.isNotEmpty &&
|
if (document.tags.isNotEmpty && user.canViewTags)
|
||||||
context.watch<LocalUserAccount>().paperlessUser.canViewTags)
|
|
||||||
DetailsItem(
|
DetailsItem(
|
||||||
label: S.of(context)!.tags,
|
label: S.of(context)!.tags,
|
||||||
content: Padding(
|
content: Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: TagsWidget(
|
child: TagsWidget(
|
||||||
isClickable: false,
|
isClickable: false,
|
||||||
tags: document.tags.map((e) => availableTags[e]!).toList(),
|
tags:
|
||||||
|
document.tags.map((e) => availableLabels.tags[e]!).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).paddedOnly(bottom: itemSpacing),
|
).paddedOnly(bottom: itemSpacing),
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart'
|
|||||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||||
import 'package:paperless_mobile/helpers/permission_helpers.dart';
|
import 'package:paperless_mobile/helpers/permission_helpers.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:pdf/pdf.dart';
|
import 'package:pdf/pdf.dart';
|
||||||
import 'package:pdf/widgets.dart' as pw;
|
import 'package:pdf/widgets.dart' as pw;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:paperless_mobile/features/documents/view/widgets/adaptive_docume
|
|||||||
import 'package:paperless_mobile/features/documents/view/widgets/selection/view_type_selection_widget.dart';
|
import 'package:paperless_mobile/features/documents/view/widgets/selection/view_type_selection_widget.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class DocumentSearchPage extends StatefulWidget {
|
class DocumentSearchPage extends StatefulWidget {
|
||||||
const DocumentSearchPage({super.key});
|
const DocumentSearchPage({super.key});
|
||||||
|
|||||||
@@ -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/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:sliver_tools/sliver_tools.dart';
|
import 'package:sliver_tools/sliver_tools.dart';
|
||||||
|
|
||||||
class DocumentFilterIntent {
|
class DocumentFilterIntent {
|
||||||
@@ -620,7 +621,7 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
|||||||
final cubit = context.read<DocumentsCubit>();
|
final cubit = context.read<DocumentsCubit>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch (cubit.state.filter.storagePath){
|
switch (cubit.state.filter.storagePath) {
|
||||||
case SetIdQueryParameter(id: var id):
|
case SetIdQueryParameter(id: var id):
|
||||||
if (id == pathId) {
|
if (id == pathId) {
|
||||||
cubit.updateCurrentFilter(
|
cubit.updateCurrentFilter(
|
||||||
@@ -641,7 +642,6 @@ class _DocumentsPageState extends State<DocumentsPage> {
|
|||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} on PaperlessApiException catch (error, stackTrace) {
|
} on PaperlessApiException catch (error, stackTrace) {
|
||||||
showErrorMessage(context, error, stackTrace);
|
showErrorMessage(context, error, stackTrace);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
document.title,
|
document.title ?? document.originalFileName ?? '-',
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
|||||||
import 'package:paperless_api/paperless_api.dart';
|
import 'package:paperless_api/paperless_api.dart';
|
||||||
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shimmer/shimmer.dart';
|
import 'package:shimmer/shimmer.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class DocumentDetailedItem extends DocumentItem {
|
|||||||
],
|
],
|
||||||
).paddedLTRB(8, 8, 8, 4),
|
).paddedLTRB(8, 8, 8, 4),
|
||||||
Text(
|
Text(
|
||||||
document.title,
|
document.title ?? '-',
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class DocumentGridItem extends DocumentItem {
|
|||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 8.0),
|
padding: const EdgeInsets.only(bottom: 8.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
document.title,
|
document.title ?? '-',
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class DocumentListItem extends DocumentItem {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
document.title,
|
document.title ?? '-',
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
doc.title,
|
doc.title ?? doc.originalFileName ?? '-',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|||||||
@@ -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/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class DocumentSelectionSliverAppBar extends StatelessWidget {
|
class DocumentSelectionSliverAppBar extends StatelessWidget {
|
||||||
final DocumentsState state;
|
final DocumentsState state;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import 'package:paperless_mobile/features/labels/view/widgets/label_text.dart';
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class InboxItemPlaceholder extends StatelessWidget {
|
class InboxItemPlaceholder extends StatelessWidget {
|
||||||
const InboxItemPlaceholder({super.key});
|
const InboxItemPlaceholder({super.key});
|
||||||
@@ -350,7 +351,7 @@ class _InboxItemState extends State<InboxItem> {
|
|||||||
|
|
||||||
Text _buildTitle() {
|
Text _buildTitle() {
|
||||||
return Text(
|
return Text(
|
||||||
widget.document.title,
|
widget.document.title ?? '-',
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import 'package:paperless_mobile/features/labels/view/widgets/label_tab_view.dar
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
|
import 'package:paperless_mobile/helpers/connectivity_aware_action_wrapper.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class LabelsPage extends StatefulWidget {
|
class LabelsPage extends StatefulWidget {
|
||||||
const LabelsPage({Key? key}) : super(key: key);
|
const LabelsPage({Key? key}) : super(key: key);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:paperless_api/paperless_api.dart';
|
|||||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||||
import 'package:paperless_mobile/helpers/format_helpers.dart';
|
import 'package:paperless_mobile/helpers/format_helpers.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class LabelItem<T extends Label> extends StatelessWidget {
|
class LabelItem<T extends Label> extends StatelessWidget {
|
||||||
final T label;
|
final T label;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import 'package:paperless_mobile/features/saved_view_details/view/saved_view_pre
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/inbox_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/inbox_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class LandingPage extends StatefulWidget {
|
class LandingPage extends StatefulWidget {
|
||||||
const LandingPage({super.key});
|
const LandingPage({super.key});
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:paperless_mobile/features/linked_documents/cubit/linked_document
|
|||||||
import 'package:paperless_mobile/features/paged_document_view/view/document_paging_view_mixin.dart';
|
import 'package:paperless_mobile/features/paged_document_view/view/document_paging_view_mixin.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class LinkedDocumentsPage extends StatefulWidget {
|
class LinkedDocumentsPage extends StatefulWidget {
|
||||||
const LinkedDocumentsPage({super.key});
|
const LinkedDocumentsPage({super.key});
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import 'package:paperless_mobile/features/login/model/login_form_credentials.dar
|
|||||||
import 'package:paperless_mobile/features/login/view/add_account_page.dart';
|
import 'package:paperless_mobile/features/login/view/add_account_page.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
||||||
|
|
||||||
class LoginPage extends StatelessWidget {
|
class LoginPage extends StatelessWidget {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:paperless_mobile/core/config/hive/hive_extensions.dart';
|
|||||||
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
||||||
import 'package:paperless_mobile/features/users/view/widgets/user_account_list_tile.dart';
|
import 'package:paperless_mobile/features/users/view/widgets/user_account_list_tile.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
||||||
|
|
||||||
class LoginToExistingAccountPage extends StatelessWidget {
|
class LoginToExistingAccountPage extends StatelessWidget {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||||
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:paperless_mobile/features/landing/view/widgets/expansion_card.da
|
|||||||
import 'package:paperless_mobile/features/saved_view_details/cubit/saved_view_preview_cubit.dart';
|
import 'package:paperless_mobile/features/saved_view_details/cubit/saved_view_preview_cubit.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.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:provider/provider.dart';
|
||||||
|
|
||||||
class SavedViewPreview extends StatelessWidget {
|
class SavedViewPreview extends StatelessWidget {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import 'package:paperless_mobile/features/settings/view/dialogs/switch_account_d
|
|||||||
import 'package:paperless_mobile/features/settings/view/widgets/global_settings_builder.dart';
|
import 'package:paperless_mobile/features/settings/view/widgets/global_settings_builder.dart';
|
||||||
import 'package:paperless_mobile/features/users/view/widgets/user_account_list_tile.dart';
|
import 'package:paperless_mobile/features/users/view/widgets/user_account_list_tile.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/add_account_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/add_account_route.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -146,35 +147,7 @@ class ManageAccountsPage extends StatelessWidget {
|
|||||||
|
|
||||||
Future<void> _onAddAccount(BuildContext context, String currentUser) async {
|
Future<void> _onAddAccount(BuildContext context, String currentUser) async {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
AddAccountRoute().push<String>(context);
|
const AddAccountRoute().push<String>(context);
|
||||||
// final userId = await Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(
|
|
||||||
// builder: (context) => AddAccountPage(
|
|
||||||
// titleText: S.of(context)!.addAccount,
|
|
||||||
// onSubmit: (context, username, password, serverUrl,
|
|
||||||
// clientCertificate) async {
|
|
||||||
// try {
|
|
||||||
// final userId =
|
|
||||||
// await context.read<AuthenticationCubit>().addAccount(
|
|
||||||
// credentials: LoginFormCredentials(
|
|
||||||
// username: username,
|
|
||||||
// password: password,
|
|
||||||
// ),
|
|
||||||
// clientCertificate: clientCertificate,
|
|
||||||
// serverUrl: serverUrl,
|
|
||||||
// //TODO: Ask user whether to enable biometric authentication
|
|
||||||
// enableBiometricAuthentication: false,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// Navigator.of(context).pop<String?>(userId);
|
|
||||||
// } on PaperlessFormValidationException catch (error) {}
|
|
||||||
// },
|
|
||||||
// submitText: S.of(context)!.addAccount,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSwitchAccount(
|
void _onSwitchAccount(
|
||||||
|
|||||||
@@ -23,6 +23,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/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import 'package:paperless_mobile/features/similar_documents/cubit/similar_docume
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/helpers/message_helpers.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/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
|
|
||||||
class SimilarDocumentsView extends StatefulWidget {
|
class SimilarDocumentsView extends StatefulWidget {
|
||||||
final ScrollController pagingScrollController;
|
final ScrollController pagingScrollController;
|
||||||
|
|||||||
@@ -36,15 +36,8 @@ import 'package:paperless_mobile/features/notifications/services/local_notificat
|
|||||||
import 'package:paperless_mobile/features/settings/view/widgets/global_settings_builder.dart';
|
import 'package:paperless_mobile/features/settings/view/widgets/global_settings_builder.dart';
|
||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/branches/inbox_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/branches/landing_route.dart';
|
import 'package:paperless_mobile/routes/typed/branches/landing_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/saved_views_route.dart';
|
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/branches/upload_queue_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/shells/provider_shell_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/shells/scaffold_shell_route.dart';
|
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/add_account_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/add_account_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/logging_out_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/logging_out_route.dart';
|
||||||
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
import 'package:paperless_mobile/routes/typed/top_level/login_route.dart';
|
||||||
@@ -197,12 +190,14 @@ void main() async {
|
|||||||
value: localNotificationService),
|
value: localNotificationService),
|
||||||
Provider.value(value: DocumentChangedNotifier()),
|
Provider.value(value: DocumentChangedNotifier()),
|
||||||
],
|
],
|
||||||
child: MultiBlocProvider(
|
child: MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider<ConnectivityCubit>.value(value: connectivityCubit),
|
Provider<ConnectivityCubit>.value(value: connectivityCubit),
|
||||||
BlocProvider.value(value: authenticationCubit),
|
Provider.value(value: authenticationCubit),
|
||||||
],
|
],
|
||||||
child: GoRouterShell(apiFactory: apiFactory),
|
child: GoRouterShell(
|
||||||
|
apiFactory: apiFactory,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -221,10 +216,7 @@ void main() async {
|
|||||||
|
|
||||||
class GoRouterShell extends StatefulWidget {
|
class GoRouterShell extends StatefulWidget {
|
||||||
final PaperlessApiFactory apiFactory;
|
final PaperlessApiFactory apiFactory;
|
||||||
const GoRouterShell({
|
const GoRouterShell({super.key, required this.apiFactory});
|
||||||
super.key,
|
|
||||||
required this.apiFactory,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<GoRouterShell> createState() => _GoRouterShellState();
|
State<GoRouterShell> createState() => _GoRouterShellState();
|
||||||
@@ -267,7 +259,9 @@ class _GoRouterShellState extends State<GoRouterShell> {
|
|||||||
routes: [
|
routes: [
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
builder: (context, state, child) {
|
builder: (context, state, child) {
|
||||||
return BlocListener<AuthenticationCubit, AuthenticationState>(
|
return Provider.value(
|
||||||
|
value: widget.apiFactory,
|
||||||
|
child: BlocListener<AuthenticationCubit, AuthenticationState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case UnauthenticatedState(
|
case UnauthenticatedState(
|
||||||
@@ -311,6 +305,7 @@ class _GoRouterShellState extends State<GoRouterShell> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: child,
|
child: child,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
navigatorKey: rootNavigatorKey,
|
navigatorKey: rootNavigatorKey,
|
||||||
@@ -318,44 +313,7 @@ class _GoRouterShellState extends State<GoRouterShell> {
|
|||||||
$loginRoute,
|
$loginRoute,
|
||||||
$loggingOutRoute,
|
$loggingOutRoute,
|
||||||
$addAccountRoute,
|
$addAccountRoute,
|
||||||
ShellRoute(
|
$providerShellRoute,
|
||||||
navigatorKey: outerShellNavigatorKey,
|
|
||||||
builder: ProviderShellRoute(widget.apiFactory).build,
|
|
||||||
routes: [
|
|
||||||
$settingsRoute,
|
|
||||||
$savedViewsRoute,
|
|
||||||
$uploadQueueRoute,
|
|
||||||
StatefulShellRoute(
|
|
||||||
navigatorContainerBuilder:
|
|
||||||
(context, navigationShell, children) {
|
|
||||||
return children[navigationShell.currentIndex];
|
|
||||||
},
|
|
||||||
builder: const ScaffoldShellRoute().builder,
|
|
||||||
branches: [
|
|
||||||
StatefulShellBranch(
|
|
||||||
navigatorKey: landingNavigatorKey,
|
|
||||||
routes: [$landingRoute],
|
|
||||||
),
|
|
||||||
StatefulShellBranch(
|
|
||||||
navigatorKey: documentsNavigatorKey,
|
|
||||||
routes: [$documentsRoute],
|
|
||||||
),
|
|
||||||
StatefulShellBranch(
|
|
||||||
navigatorKey: scannerNavigatorKey,
|
|
||||||
routes: [$scannerRoute],
|
|
||||||
),
|
|
||||||
StatefulShellBranch(
|
|
||||||
navigatorKey: labelsNavigatorKey,
|
|
||||||
routes: [$labelsRoute],
|
|
||||||
),
|
|
||||||
StatefulShellBranch(
|
|
||||||
navigatorKey: inboxNavigatorKey,
|
|
||||||
routes: [$inboxRoute],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -17,35 +17,11 @@ import 'package:paperless_mobile/routes/navigation_keys.dart';
|
|||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
import 'package:paperless_mobile/theme.dart';
|
import 'package:paperless_mobile/theme.dart';
|
||||||
|
|
||||||
part 'documents_route.g.dart';
|
|
||||||
|
|
||||||
class DocumentsBranch extends StatefulShellBranchData {
|
class DocumentsBranch extends StatefulShellBranchData {
|
||||||
static final GlobalKey<NavigatorState> $navigatorKey = documentsNavigatorKey;
|
static final GlobalKey<NavigatorState> $navigatorKey = documentsNavigatorKey;
|
||||||
const DocumentsBranch();
|
const DocumentsBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<DocumentsRoute>(
|
|
||||||
path: "/documents",
|
|
||||||
name: R.documents,
|
|
||||||
routes: [
|
|
||||||
TypedGoRoute<EditDocumentRoute>(
|
|
||||||
path: "edit",
|
|
||||||
name: R.editDocument,
|
|
||||||
),
|
|
||||||
TypedGoRoute<DocumentDetailsRoute>(
|
|
||||||
path: "details",
|
|
||||||
name: R.documentDetails,
|
|
||||||
),
|
|
||||||
TypedGoRoute<DocumentPreviewRoute>(
|
|
||||||
path: "preview",
|
|
||||||
name: R.documentPreview,
|
|
||||||
),
|
|
||||||
TypedGoRoute<BulkEditDocumentsRoute>(
|
|
||||||
path: "bulk-edit",
|
|
||||||
name: R.bulkEditDocuments,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
class DocumentsRoute extends GoRouteData {
|
class DocumentsRoute extends GoRouteData {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Widget build(BuildContext context, GoRouterState state) {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import 'package:flutter/src/widgets/framework.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:paperless_mobile/features/inbox/view/pages/inbox_page.dart';
|
import 'package:paperless_mobile/features/inbox/view/pages/inbox_page.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
|
|
||||||
part 'inbox_route.g.dart';
|
class InboxBranch extends StatefulShellBranchData {
|
||||||
|
static final GlobalKey<NavigatorState> $navigatorKey = inboxNavigatorKey;
|
||||||
|
|
||||||
|
const InboxBranch();
|
||||||
|
}
|
||||||
|
|
||||||
@TypedGoRoute<InboxRoute>(
|
|
||||||
path: "/inbox",
|
|
||||||
name: R.inbox,
|
|
||||||
)
|
|
||||||
class InboxRoute extends GoRouteData {
|
class InboxRoute extends GoRouteData {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Widget build(BuildContext context, GoRouterState state) {
|
||||||
|
|||||||
@@ -14,33 +14,12 @@ import 'package:paperless_mobile/features/labels/view/pages/labels_page.dart';
|
|||||||
import 'package:paperless_mobile/features/linked_documents/cubit/linked_documents_cubit.dart';
|
import 'package:paperless_mobile/features/linked_documents/cubit/linked_documents_cubit.dart';
|
||||||
import 'package:paperless_mobile/features/linked_documents/view/linked_documents_page.dart';
|
import 'package:paperless_mobile/features/linked_documents/view/linked_documents_page.dart';
|
||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
|
||||||
|
|
||||||
part 'labels_route.g.dart';
|
|
||||||
|
|
||||||
class LabelsBranch extends StatefulShellBranchData {
|
class LabelsBranch extends StatefulShellBranchData {
|
||||||
static final GlobalKey<NavigatorState> $navigatorKey = labelsNavigatorKey;
|
static final GlobalKey<NavigatorState> $navigatorKey = labelsNavigatorKey;
|
||||||
const LabelsBranch();
|
const LabelsBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<LabelsRoute>(
|
|
||||||
path: "/labels",
|
|
||||||
name: R.labels,
|
|
||||||
routes: [
|
|
||||||
TypedGoRoute<EditLabelRoute>(
|
|
||||||
path: "edit",
|
|
||||||
name: R.editLabel,
|
|
||||||
),
|
|
||||||
TypedGoRoute<CreateLabelRoute>(
|
|
||||||
path: "create",
|
|
||||||
name: R.createLabel,
|
|
||||||
),
|
|
||||||
TypedGoRoute<LinkedDocumentsRoute>(
|
|
||||||
path: "linked-documents",
|
|
||||||
name: R.linkedDocuments,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
class LabelsRoute extends GoRouteData {
|
class LabelsRoute extends GoRouteData {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Widget build(BuildContext context, GoRouterState state) {
|
||||||
|
|||||||
@@ -4,18 +4,12 @@ import 'package:paperless_mobile/features/landing/view/landing_page.dart';
|
|||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
|
|
||||||
part 'landing_route.g.dart';
|
|
||||||
|
|
||||||
class LandingBranch extends StatefulShellBranchData {
|
class LandingBranch extends StatefulShellBranchData {
|
||||||
static final GlobalKey<NavigatorState> $navigatorKey = landingNavigatorKey;
|
static final GlobalKey<NavigatorState> $navigatorKey = landingNavigatorKey;
|
||||||
|
|
||||||
const LandingBranch();
|
const LandingBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<LandingRoute>(
|
|
||||||
path: "/landing",
|
|
||||||
name: R.landing,
|
|
||||||
)
|
|
||||||
class LandingRoute extends GoRouteData {
|
class LandingRoute extends GoRouteData {
|
||||||
const LandingRoute();
|
const LandingRoute();
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -10,38 +10,12 @@ import 'package:paperless_mobile/features/document_upload/view/document_upload_p
|
|||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
|
|
||||||
part 'scanner_route.g.dart';
|
|
||||||
|
|
||||||
// @TypedStatefulShellBranch<ScannerBranch>(
|
|
||||||
// routes: [
|
|
||||||
// TypedGoRoute<ScannerRoute>(
|
|
||||||
// path: "/scanner",
|
|
||||||
// name: R.scanner,
|
|
||||||
// routes: [
|
|
||||||
// TypedGoRoute<DocumentUploadRoute>(
|
|
||||||
// path: "upload",
|
|
||||||
// name: R.uploadDocument,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
class ScannerBranch extends StatefulShellBranchData {
|
class ScannerBranch extends StatefulShellBranchData {
|
||||||
static final GlobalKey<NavigatorState> $navigatorKey = scannerNavigatorKey;
|
static final GlobalKey<NavigatorState> $navigatorKey = scannerNavigatorKey;
|
||||||
|
|
||||||
const ScannerBranch();
|
const ScannerBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TypedGoRoute<ScannerRoute>(
|
|
||||||
path: "/scanner",
|
|
||||||
name: R.scanner,
|
|
||||||
routes: [
|
|
||||||
TypedGoRoute<DocumentUploadRoute>(
|
|
||||||
path: "upload",
|
|
||||||
name: R.uploadDocument,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
class ScannerRoute extends GoRouteData {
|
class ScannerRoute extends GoRouteData {
|
||||||
const ScannerRoute();
|
const ScannerRoute();
|
||||||
|
|
||||||
|
|||||||
155
lib/routes/typed/shells/authenticated_route.dart
Normal file
155
lib/routes/typed/shells/authenticated_route.dart
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:hive_flutter/adapters.dart';
|
||||||
|
import 'package:paperless_api/paperless_api.dart';
|
||||||
|
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
|
||||||
|
import 'package:paperless_mobile/core/database/tables/global_settings.dart';
|
||||||
|
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
||||||
|
import 'package:paperless_mobile/core/factory/paperless_api_factory.dart';
|
||||||
|
import 'package:paperless_mobile/features/home/view/home_shell_widget.dart';
|
||||||
|
import 'package:paperless_mobile/features/home/view/scaffold_with_navigation_bar.dart';
|
||||||
|
import 'package:paperless_mobile/features/sharing/cubit/receive_share_cubit.dart';
|
||||||
|
import 'package:paperless_mobile/features/sharing/view/widgets/event_listener_shell.dart';
|
||||||
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/branches/inbox_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/branches/landing_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/branches/scanner_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/shells/scaffold_shell_route.dart';
|
||||||
|
import 'package:paperless_mobile/routes/typed/top_level/settings_route.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
/// Key used to access
|
||||||
|
|
||||||
|
part 'authenticated_route.g.dart';
|
||||||
|
|
||||||
|
@TypedShellRoute<ProviderShellRoute>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<SettingsRoute>(
|
||||||
|
path: "/settings",
|
||||||
|
name: R.settings,
|
||||||
|
),
|
||||||
|
TypedStatefulShellRoute<ScaffoldShellRoute>(
|
||||||
|
branches: [
|
||||||
|
TypedStatefulShellBranch<LandingBranch>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<LandingRoute>(
|
||||||
|
path: "/landing",
|
||||||
|
name: R.landing,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TypedStatefulShellBranch<DocumentsBranch>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<DocumentsRoute>(
|
||||||
|
path: "/documents",
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<DocumentDetailsRoute>(
|
||||||
|
path: "details",
|
||||||
|
name: R.documentDetails,
|
||||||
|
),
|
||||||
|
TypedGoRoute<EditDocumentRoute>(
|
||||||
|
path: "edit",
|
||||||
|
name: R.editDocument,
|
||||||
|
),
|
||||||
|
TypedGoRoute<BulkEditDocumentsRoute>(
|
||||||
|
path: "bulk-edit",
|
||||||
|
name: R.bulkEditDocuments,
|
||||||
|
),
|
||||||
|
TypedGoRoute<DocumentPreviewRoute>(
|
||||||
|
path: 'preview',
|
||||||
|
name: R.documentPreview,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TypedStatefulShellBranch<ScannerBranch>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<ScannerRoute>(
|
||||||
|
path: "/scanner",
|
||||||
|
name: R.scanner,
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<DocumentUploadRoute>(
|
||||||
|
path: "upload",
|
||||||
|
name: R.uploadDocument,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TypedStatefulShellBranch<LabelsBranch>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<LabelsRoute>(
|
||||||
|
path: "/labels",
|
||||||
|
name: R.labels,
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<EditLabelRoute>(
|
||||||
|
path: "edit",
|
||||||
|
name: R.editLabel,
|
||||||
|
),
|
||||||
|
TypedGoRoute<CreateLabelRoute>(
|
||||||
|
path: "create",
|
||||||
|
name: R.createLabel,
|
||||||
|
),
|
||||||
|
TypedGoRoute<LinkedDocumentsRoute>(
|
||||||
|
path: "linked-documents",
|
||||||
|
name: R.linkedDocuments,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TypedStatefulShellBranch<InboxBranch>(
|
||||||
|
routes: [
|
||||||
|
TypedGoRoute<InboxRoute>(
|
||||||
|
path: "/inbox",
|
||||||
|
name: R.inbox,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
class ProviderShellRoute extends ShellRouteData {
|
||||||
|
static final GlobalKey<NavigatorState> $navigatorKey = outerShellNavigatorKey;
|
||||||
|
|
||||||
|
const ProviderShellRoute();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget builder(
|
||||||
|
BuildContext context,
|
||||||
|
GoRouterState state,
|
||||||
|
Widget navigator,
|
||||||
|
) {
|
||||||
|
final currentUserId = Hive.box<GlobalSettings>(HiveBoxes.globalSettings)
|
||||||
|
.getValue()!
|
||||||
|
.loggedInUserId;
|
||||||
|
if (currentUserId == null) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
final authenticatedUser =
|
||||||
|
Hive.box<LocalUserAccount>(HiveBoxes.localUserAccount).get(
|
||||||
|
currentUserId,
|
||||||
|
)!;
|
||||||
|
final apiFactory = context.read<PaperlessApiFactory>();
|
||||||
|
return HomeShellWidget(
|
||||||
|
localUserId: authenticatedUser.id,
|
||||||
|
paperlessApiVersion: authenticatedUser.apiVersion,
|
||||||
|
paperlessProviderFactory: apiFactory,
|
||||||
|
child: ChangeNotifierProvider(
|
||||||
|
create: (context) => ConsumptionChangeNotifier()
|
||||||
|
..loadFromConsumptionDirectory(userId: currentUserId),
|
||||||
|
child: EventListenerShell(
|
||||||
|
child: navigator,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:go_router/go_router.dart';
|
|
||||||
import 'package:hive_flutter/adapters.dart';
|
|
||||||
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
|
|
||||||
import 'package:paperless_mobile/core/database/tables/global_settings.dart';
|
|
||||||
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
|
|
||||||
import 'package:paperless_mobile/core/factory/paperless_api_factory.dart';
|
|
||||||
import 'package:paperless_mobile/features/home/view/home_shell_widget.dart';
|
|
||||||
import 'package:paperless_mobile/features/sharing/cubit/receive_share_cubit.dart';
|
|
||||||
import 'package:paperless_mobile/features/sharing/view/widgets/event_listener_shell.dart';
|
|
||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
/// Key used to access
|
|
||||||
|
|
||||||
//part 'provider_shell_route.g.dart';
|
|
||||||
//TODO: Wait for https://github.com/flutter/flutter/issues/127371 to be merged
|
|
||||||
// @TypedShellRoute<ProviderShellRoute>(
|
|
||||||
// routes: [
|
|
||||||
// TypedStatefulShellRoute(
|
|
||||||
// branches: [
|
|
||||||
// TypedStatefulShellBranch<LandingBranch>(
|
|
||||||
// routes: [
|
|
||||||
// TypedGoRoute<LandingRoute>(
|
|
||||||
// path: "/landing",
|
|
||||||
// // name: R.landing,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// TypedStatefulShellBranch<DocumentsBranch>(
|
|
||||||
// routes: [
|
|
||||||
// TypedGoRoute<DocumentsRoute>(
|
|
||||||
// path: "/documents",
|
|
||||||
// routes: [
|
|
||||||
// TypedGoRoute<DocumentDetailsRoute>(
|
|
||||||
// path: "details",
|
|
||||||
// // name: R.documentDetails,
|
|
||||||
// ),
|
|
||||||
// TypedGoRoute<DocumentEditRoute>(
|
|
||||||
// path: "edit",
|
|
||||||
// // name: R.editDocument,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
class ProviderShellRoute extends ShellRouteData {
|
|
||||||
final PaperlessApiFactory apiFactory;
|
|
||||||
static final GlobalKey<NavigatorState> $navigatorKey = outerShellNavigatorKey;
|
|
||||||
|
|
||||||
const ProviderShellRoute(this.apiFactory);
|
|
||||||
|
|
||||||
Widget build(
|
|
||||||
BuildContext context,
|
|
||||||
GoRouterState state,
|
|
||||||
Widget navigator,
|
|
||||||
) {
|
|
||||||
final currentUserId = Hive.box<GlobalSettings>(HiveBoxes.globalSettings)
|
|
||||||
.getValue()!
|
|
||||||
.loggedInUserId;
|
|
||||||
if (currentUserId == null) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
final authenticatedUser =
|
|
||||||
Hive.box<LocalUserAccount>(HiveBoxes.localUserAccount).get(
|
|
||||||
currentUserId,
|
|
||||||
)!;
|
|
||||||
|
|
||||||
return HomeShellWidget(
|
|
||||||
localUserId: authenticatedUser.id,
|
|
||||||
paperlessApiVersion: authenticatedUser.apiVersion,
|
|
||||||
paperlessProviderFactory: apiFactory,
|
|
||||||
child: ChangeNotifierProvider(
|
|
||||||
create: (context) => ConsumptionChangeNotifier()
|
|
||||||
..loadFromConsumptionDirectory(userId: currentUserId),
|
|
||||||
child: EventListenerShell(child: navigator),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,12 @@ import 'package:paperless_mobile/features/home/view/scaffold_with_navigation_bar
|
|||||||
|
|
||||||
class ScaffoldShellRoute extends StatefulShellRouteData {
|
class ScaffoldShellRoute extends StatefulShellRouteData {
|
||||||
const ScaffoldShellRoute();
|
const ScaffoldShellRoute();
|
||||||
|
|
||||||
|
static Widget $navigatorContainerBuilder(BuildContext context,
|
||||||
|
StatefulNavigationShell navigationShell, List<Widget> children) {
|
||||||
|
return children[navigationShell.currentIndex];
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget builder(
|
Widget builder(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:paperless_api/paperless_api.dart';
|
import 'package:paperless_api/paperless_api.dart';
|
||||||
@@ -23,9 +22,11 @@ class AddAccountRoute extends GoRouteData {
|
|||||||
const AddAccountRoute();
|
const AddAccountRoute();
|
||||||
|
|
||||||
static final $parentNavigatorKey = rootNavigatorKey;
|
static final $parentNavigatorKey = rootNavigatorKey;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return AddAccountPage(
|
return NoTransitionPage(
|
||||||
|
child: AddAccountPage(
|
||||||
titleText: S.of(context)!.addAccount,
|
titleText: S.of(context)!.addAccount,
|
||||||
onSubmit:
|
onSubmit:
|
||||||
(context, username, password, serverUrl, clientCertificate) async {
|
(context, username, password, serverUrl, clientCertificate) async {
|
||||||
@@ -75,6 +76,7 @@ class AddAccountRoute extends GoRouteData {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitText: S.of(context)!.addAccount,
|
submitText: S.of(context)!.addAccount,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
|
|
||||||
part 'logging_out_route.g.dart';
|
part 'logging_out_route.g.dart';
|
||||||
@@ -11,12 +10,16 @@ part 'logging_out_route.g.dart';
|
|||||||
name: R.loggingOut,
|
name: R.loggingOut,
|
||||||
)
|
)
|
||||||
class LoggingOutRoute extends GoRouteData {
|
class LoggingOutRoute extends GoRouteData {
|
||||||
|
static final $parentNavigatorKey = rootNavigatorKey;
|
||||||
const LoggingOutRoute();
|
const LoggingOutRoute();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return Scaffold(
|
return const NoTransitionPage(
|
||||||
|
child: Scaffold(
|
||||||
body: Center(
|
body: Center(
|
||||||
child: Text("Logging out..."),
|
child: Text("Logging out..."), //TODO: INTL
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import 'package:paperless_mobile/features/login/view/widgets/login_transition_pa
|
|||||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||||
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
import 'package:paperless_mobile/routes/navigation_keys.dart';
|
||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
|
|
||||||
part 'login_route.g.dart';
|
part 'login_route.g.dart';
|
||||||
|
|
||||||
@TypedGoRoute<LoginRoute>(
|
@TypedGoRoute<LoginRoute>(
|
||||||
@@ -80,10 +79,13 @@ class SwitchingAccountsRoute extends GoRouteData {
|
|||||||
static final $parentNavigatorKey = rootNavigatorKey;
|
static final $parentNavigatorKey = rootNavigatorKey;
|
||||||
|
|
||||||
const SwitchingAccountsRoute();
|
const SwitchingAccountsRoute();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return LoginTransitionPage(
|
return NoTransitionPage(
|
||||||
|
child: LoginTransitionPage(
|
||||||
text: S.of(context)!.switchingAccountsPleaseWait,
|
text: S.of(context)!.switchingAccountsPleaseWait,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,8 +95,9 @@ class AuthenticatingRoute extends GoRouteData {
|
|||||||
|
|
||||||
final String checkLoginStageName;
|
final String checkLoginStageName;
|
||||||
const AuthenticatingRoute(this.checkLoginStageName);
|
const AuthenticatingRoute(this.checkLoginStageName);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
final stage = AuthenticatingStage.values.byName(checkLoginStageName);
|
final stage = AuthenticatingStage.values.byName(checkLoginStageName);
|
||||||
final text = switch (stage) {
|
final text = switch (stage) {
|
||||||
AuthenticatingStage.authenticating => S.of(context)!.authenticatingDots,
|
AuthenticatingStage.authenticating => S.of(context)!.authenticatingDots,
|
||||||
@@ -103,8 +106,11 @@ class AuthenticatingRoute extends GoRouteData {
|
|||||||
AuthenticatingStage.fetchingUserInformation =>
|
AuthenticatingStage.fetchingUserInformation =>
|
||||||
S.of(context)!.fetchingUserInformation,
|
S.of(context)!.fetchingUserInformation,
|
||||||
};
|
};
|
||||||
|
return NoTransitionPage(
|
||||||
return LoginTransitionPage(text: text);
|
child: LoginTransitionPage(
|
||||||
|
text: text,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,8 +121,10 @@ class VerifyIdentityRoute extends GoRouteData {
|
|||||||
const VerifyIdentityRoute({required this.userId});
|
const VerifyIdentityRoute({required this.userId});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return VerifyIdentityPage(userId: userId);
|
return NoTransitionPage(
|
||||||
|
child: VerifyIdentityPage(userId: userId),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,8 +142,10 @@ class LoginToExistingAccountRoute extends GoRouteData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return const LoginToExistingAccountPage();
|
return const NoTransitionPage(
|
||||||
|
child: LoginToExistingAccountPage(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +155,11 @@ class RestoringSessionRoute extends GoRouteData {
|
|||||||
const RestoringSessionRoute();
|
const RestoringSessionRoute();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Page<void> buildPage(BuildContext context, GoRouterState state) {
|
||||||
return LoginTransitionPage(text: S.of(context)!.restoringSession);
|
return NoTransitionPage(
|
||||||
|
child: LoginTransitionPage(
|
||||||
|
text: S.of(context)!.restoringSession,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,9 @@ import 'package:paperless_mobile/routes/navigation_keys.dart';
|
|||||||
import 'package:paperless_mobile/routes/routes.dart';
|
import 'package:paperless_mobile/routes/routes.dart';
|
||||||
import 'package:paperless_mobile/theme.dart';
|
import 'package:paperless_mobile/theme.dart';
|
||||||
|
|
||||||
part 'settings_route.g.dart';
|
|
||||||
|
|
||||||
@TypedGoRoute<SettingsRoute>(
|
|
||||||
path: "/settings",
|
|
||||||
name: R.settings,
|
|
||||||
)
|
|
||||||
class SettingsRoute extends GoRouteData {
|
class SettingsRoute extends GoRouteData {
|
||||||
static final GlobalKey<NavigatorState> $parentNavigatorKey = outerShellNavigatorKey;
|
static final GlobalKey<NavigatorState> $parentNavigatorKey =
|
||||||
|
outerShellNavigatorKey;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, GoRouterState state) {
|
Widget build(BuildContext context, GoRouterState state) {
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class DocumentFilter extends Equatable {
|
|||||||
added.matches(document.added) &&
|
added.matches(document.added) &&
|
||||||
modified.matches(document.modified) &&
|
modified.matches(document.modified) &&
|
||||||
query.matches(
|
query.matches(
|
||||||
title: document.title,
|
title: document.title ?? '',
|
||||||
content: document.content,
|
content: document.content,
|
||||||
asn: document.archiveSerialNumber,
|
asn: document.archiveSerialNumber,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class DocumentModel extends Equatable {
|
|||||||
static const storagePathKey = 'storage_path';
|
static const storagePathKey = 'storage_path';
|
||||||
|
|
||||||
final int id;
|
final int id;
|
||||||
final String title;
|
final String? title;
|
||||||
final String? content;
|
final String? content;
|
||||||
final Iterable<int> tags;
|
final Iterable<int> tags;
|
||||||
final int? documentType;
|
final int? documentType;
|
||||||
@@ -71,7 +71,8 @@ class DocumentModel extends Equatable {
|
|||||||
this.permissions,
|
this.permissions,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory DocumentModel.fromJson(Map<String, dynamic> json) => _$DocumentModelFromJson(json);
|
factory DocumentModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$DocumentModelFromJson(json);
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => _$DocumentModelToJson(this);
|
Map<String, dynamic> toJson() => _$DocumentModelToJson(this);
|
||||||
|
|
||||||
@@ -94,15 +95,17 @@ class DocumentModel extends Equatable {
|
|||||||
title: title ?? this.title,
|
title: title ?? this.title,
|
||||||
content: content ?? this.content,
|
content: content ?? this.content,
|
||||||
documentType: documentType != null ? documentType() : this.documentType,
|
documentType: documentType != null ? documentType() : this.documentType,
|
||||||
correspondent: correspondent != null ? correspondent() : this.correspondent,
|
correspondent:
|
||||||
|
correspondent != null ? correspondent() : this.correspondent,
|
||||||
storagePath: storagePath != null ? storagePath() : this.storagePath,
|
storagePath: storagePath != null ? storagePath() : this.storagePath,
|
||||||
tags: tags ?? this.tags,
|
tags: tags ?? this.tags,
|
||||||
created: created ?? this.created,
|
created: created ?? this.created,
|
||||||
modified: modified ?? this.modified,
|
modified: modified ?? this.modified,
|
||||||
added: added ?? this.added,
|
added: added ?? this.added,
|
||||||
originalFileName: originalFileName ?? this.originalFileName,
|
originalFileName: originalFileName ?? this.originalFileName,
|
||||||
archiveSerialNumber:
|
archiveSerialNumber: archiveSerialNumber != null
|
||||||
archiveSerialNumber != null ? archiveSerialNumber() : this.archiveSerialNumber,
|
? archiveSerialNumber()
|
||||||
|
: this.archiveSerialNumber,
|
||||||
archivedFileName: archivedFileName ?? this.archivedFileName,
|
archivedFileName: archivedFileName ?? this.archivedFileName,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -748,10 +748,10 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: go_router_builder
|
name: go_router_builder
|
||||||
sha256: "89585f7cf2ddd35a3f05908c5bb54339d3f891fc5aac4f30e2864469d7ddc92b"
|
sha256: b004ed761578fd1326054ff9c97daaf7b94f109b24cad843ca8bd349a810f947
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.3"
|
||||||
graphs:
|
graphs:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -118,8 +118,7 @@ dev_dependencies:
|
|||||||
hive_generator: ^2.0.1
|
hive_generator: ^2.0.1
|
||||||
mock_server:
|
mock_server:
|
||||||
path: packages/mock_server
|
path: packages/mock_server
|
||||||
go_router_builder: ^2.2.4
|
go_router_builder: ^2.3.3
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
|
|||||||
5
scripts/update_translations.sh
Normal file
5
scripts/update_translations.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "Updating source language..."
|
||||||
|
crowdin download sources --identity=../crowdin_credentials.yml --config ../crowdin.yml --no-preserve-hierarchy
|
||||||
|
echo "Updating translations..."
|
||||||
|
crowdin download --identity=../crowdin_credentials.yml --config ../crowdin.yml
|
||||||
Reference in New Issue
Block a user