mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 08:08:00 -06:00
feat: Further migrations to go_router, add onclick to document previews
This commit is contained in:
@@ -72,6 +72,7 @@ class _FullscreenTagsFormState extends State<FullscreenTagsForm> {
|
||||
return Scaffold(
|
||||
floatingActionButton: widget.allowCreation
|
||||
? FloatingActionButton(
|
||||
heroTag: "fab_tags_form",
|
||||
onPressed: _onAddTag,
|
||||
child: const Icon(Icons.add),
|
||||
)
|
||||
|
||||
@@ -66,15 +66,19 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
child: Scaffold(
|
||||
drawer: const AppDrawer(),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
heroTag: "fab_labels_page",
|
||||
onPressed: [
|
||||
if (user.canViewCorrespondents)
|
||||
() => CreateLabelRoute<Correspondent>().push(context),
|
||||
() => CreateLabelRoute(LabelType.correspondent)
|
||||
.push(context),
|
||||
if (user.canViewDocumentTypes)
|
||||
() => CreateLabelRoute<DocumentType>().push(context),
|
||||
() => CreateLabelRoute(LabelType.documentType)
|
||||
.push(context),
|
||||
if (user.canViewTags)
|
||||
() => CreateLabelRoute<Tag>().push(context),
|
||||
() => CreateLabelRoute(LabelType.tag).push(context),
|
||||
if (user.canViewStoragePaths)
|
||||
() => CreateLabelRoute<StoragePath>().push(context),
|
||||
() => CreateLabelRoute(LabelType.storagePath)
|
||||
.push(context),
|
||||
][_currentIndex],
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
@@ -247,7 +251,8 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
},
|
||||
emptyStateActionButtonLabel: S.of(context)!.addNewCorrespondent,
|
||||
emptyStateDescription: S.of(context)!.noCorrespondentsSetUp,
|
||||
onAddNew: () => CreateLabelRoute<Correspondent>().push(context),
|
||||
onAddNew: () =>
|
||||
CreateLabelRoute(LabelType.correspondent).push(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -274,7 +279,8 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
},
|
||||
emptyStateActionButtonLabel: S.of(context)!.addNewDocumentType,
|
||||
emptyStateDescription: S.of(context)!.noDocumentTypesSetUp,
|
||||
onAddNew: () => CreateLabelRoute<DocumentType>().push(context),
|
||||
onAddNew: () =>
|
||||
CreateLabelRoute(LabelType.documentType).push(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -310,7 +316,7 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
),
|
||||
emptyStateActionButtonLabel: S.of(context)!.addNewTag,
|
||||
emptyStateDescription: S.of(context)!.noTagsSetUp,
|
||||
onAddNew: () => CreateLabelRoute<Tag>().push(context),
|
||||
onAddNew: () => CreateLabelRoute(LabelType.tag).push(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -338,7 +344,8 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
contentBuilder: (path) => Text(path.path),
|
||||
emptyStateActionButtonLabel: S.of(context)!.addNewStoragePath,
|
||||
emptyStateDescription: S.of(context)!.noStoragePathsSetUp,
|
||||
onAddNew: () => CreateLabelRoute<StoragePath>().push(context),
|
||||
onAddNew: () =>
|
||||
CreateLabelRoute(LabelType.storagePath).push(context),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -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/navigation/push_routes.dart';
|
||||
import 'package:paperless_mobile/helpers/format_helpers.dart';
|
||||
import 'package:paperless_mobile/routes/typed/branches/labels_route.dart';
|
||||
|
||||
class LabelItem<T extends Label> extends StatelessWidget {
|
||||
final T label;
|
||||
@@ -44,7 +45,7 @@ class LabelItem<T extends Label> extends StatelessWidget {
|
||||
onPressed: canOpen
|
||||
? () {
|
||||
final filter = filterBuilder(label);
|
||||
pushLinkedDocumentsView(context, filter: filter);
|
||||
LinkedDocumentsRoute(filter).push(context);
|
||||
}
|
||||
: null,
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ class LabelText<T extends Label> extends StatelessWidget {
|
||||
const LabelText({
|
||||
super.key,
|
||||
this.style,
|
||||
this.placeholder = "",
|
||||
this.placeholder = "-",
|
||||
required this.label,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user