fix: Add owner to labels

This commit is contained in:
Anton Stubenbord
2023-05-11 16:23:15 +02:00
parent f388f77d63
commit fd1c0ced35
11 changed files with 155 additions and 226 deletions

View File

@@ -12,6 +12,7 @@ import 'package:paperless_mobile/core/service/file_description.dart';
import 'package:paperless_mobile/core/service/file_service.dart';
import 'package:paperless_mobile/features/notifications/services/local_notification_service.dart';
import 'package:share_plus/share_plus.dart';
import 'package:cross_file/cross_file.dart';
part 'document_details_cubit.freezed.dart';
part 'document_details_state.dart';

View File

@@ -79,7 +79,7 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
break;
}
if (Platform.isAndroid && androidInfo!.version.sdkInt! <= 29) {
if (Platform.isAndroid && androidInfo!.version.sdkInt <= 29) {
final isGranted = await askForPermission(Permission.storage);
if (!isGranted) {
return;

View File

@@ -78,7 +78,7 @@ class _DocumentShareButtonState extends State<DocumentShareButton> {
break;
}
if (Platform.isAndroid && androidInfo!.version.sdkInt! < 30) {
if (Platform.isAndroid && androidInfo!.version.sdkInt < 30) {
final isGranted = await askForPermission(Permission.storage);
if (!isGranted) {
return;

View File

@@ -196,14 +196,15 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
),
label: S.of(context)!.documents,
),
RouteDescription(
icon: const Icon(Icons.document_scanner_outlined),
selectedIcon: Icon(
Icons.document_scanner,
color: Theme.of(context).colorScheme.primary,
if (LocalUserAccount.current.paperlessUser.hasPermission(UserPermissions.addDocument))
RouteDescription(
icon: const Icon(Icons.document_scanner_outlined),
selectedIcon: Icon(
Icons.document_scanner,
color: Theme.of(context).colorScheme.primary,
),
label: S.of(context)!.scanner,
),
label: S.of(context)!.scanner,
),
RouteDescription(
icon: const Icon(Icons.sell_outlined),
selectedIcon: Icon(
@@ -234,8 +235,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
];
final routes = <Widget>[
const DocumentsPage(),
if (LocalUserAccount.current.paperlessUser.hasPermission(UserPermissions.changeDocument))
const ScannerPage(),
if (LocalUserAccount.current.paperlessUser.hasPermission(UserPermissions.addDocument))
const ScannerPage(),
const LabelsPage(),
const InboxPage(),
];