Updated onboarding, reformatted files, improved referenced documents view, updated error handling

This commit is contained in:
Anton Stubenbord
2022-11-03 22:15:36 +01:00
parent 2f2312d5f3
commit 40133b6e0e
117 changed files with 1788 additions and 1021 deletions

View File

@@ -5,7 +5,10 @@ class BottomNavBar extends StatelessWidget {
final int selectedIndex;
final void Function(int) onNavigationChanged;
const BottomNavBar({Key? key, required this.selectedIndex, required this.onNavigationChanged})
const BottomNavBar(
{Key? key,
required this.selectedIndex,
required this.onNavigationChanged})
: super(key: key);
@override

View File

@@ -1,5 +1,8 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:paperless_mobile/core/bloc/global_error_cubit.dart';
import 'package:paperless_mobile/features/settings/bloc/application_settings_cubit.dart';
import 'package:paperless_mobile/di_initializer.dart';
import 'package:paperless_mobile/features/labels/correspondent/bloc/correspondents_cubit.dart';
@@ -11,12 +14,12 @@ import 'package:paperless_mobile/features/scan/bloc/document_scanner_cubit.dart'
import 'package:paperless_mobile/features/labels/tags/bloc/tags_cubit.dart';
import 'package:paperless_mobile/generated/l10n.dart';
import 'package:paperless_mobile/util.dart';
import 'package:url_launcher/link.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
class InfoDrawer extends StatelessWidget {
const InfoDrawer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Drawer(
@@ -37,10 +40,9 @@ class InfoDrawer extends StatelessWidget {
).padded(const EdgeInsets.only(right: 8.0)),
Text(
S.of(context).appTitleText,
style: Theme.of(context)
.textTheme
.headline5!
.copyWith(color: Theme.of(context).colorScheme.onPrimaryContainer),
style: Theme.of(context).textTheme.headline5!.copyWith(
color:
Theme.of(context).colorScheme.onPrimaryContainer),
),
],
),
@@ -49,9 +51,14 @@ class InfoDrawer extends StatelessWidget {
child: BlocBuilder<AuthenticationCubit, AuthenticationState>(
builder: (context, state) {
return Text(
state.authentication?.serverUrl.replaceAll(RegExp(r'https?://'), "") ?? "",
state.authentication?.serverUrl
.replaceAll(RegExp(r'https?://'), "") ??
"",
textAlign: TextAlign.end,
style: TextStyle(color: Theme.of(context).colorScheme.onPrimaryContainer),
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onPrimaryContainer),
);
},
),
@@ -81,17 +88,39 @@ class InfoDrawer extends StatelessWidget {
leading: const Icon(Icons.bug_report),
title: Text(S.of(context).appDrawerReportBugLabel),
onTap: () {
launchUrlString("https://github.com/astubenbord/paperless-mobile/issues/new");
launchUrlString(
"https://github.com/astubenbord/paperless-mobile/issues/new");
},
),
const Divider(),
AboutListTile(
icon: const Icon(Icons.info),
applicationIcon: const ImageIcon(AssetImage("assets/logos/paperless_logo_green.png")),
applicationIcon: const ImageIcon(
AssetImage("assets/logos/paperless_logo_green.png")),
applicationName: "Paperless Mobile",
applicationVersion: kPackageInfo.version + "+" + kPackageInfo.buildNumber,
applicationVersion:
kPackageInfo.version + "+" + kPackageInfo.buildNumber,
aboutBoxChildren: [
Text('${S.of(context).aboutDialogDevelopedByText} Anton Stubenbord'),
Text(
'${S.of(context).aboutDialogDevelopedByText} Anton Stubenbord'),
Link(
uri: Uri.parse(
"https://github.com/astubenbord/paperless-mobile"),
builder: (context, followLink) => GestureDetector(
onTap: followLink,
child: Text(
"https://github.com/astubenbord/paperless-mobile",
style: TextStyle(
color: Theme.of(context).colorScheme.tertiary),
),
),
),
const SizedBox(height: 16),
Text(
"Credits",
style: Theme.of(context).textTheme.titleMedium,
),
_buildOnboardingImageCredits(),
],
child: Text(S.of(context).appDrawerAboutLabel),
),
@@ -107,6 +136,7 @@ class InfoDrawer extends StatelessWidget {
getIt<DocumentTypeCubit>().reset();
getIt<TagCubit>().reset();
getIt<DocumentScannerCubit>().reset();
getIt<GlobalErrorCubit>().reset();
},
),
const Divider(),
@@ -114,4 +144,24 @@ class InfoDrawer extends StatelessWidget {
),
);
}
Link _buildOnboardingImageCredits() {
return Link(
uri: Uri.parse(
"https://www.freepik.com/free-vector/business-team-working-cogwheel-mechanism-together_8270974.htm#query=setting&position=4&from_view=author"),
builder: (context, followLink) => Wrap(
children: [
const Text("Onboarding images by "),
GestureDetector(
onTap: followLink,
child: Text(
"pch.vector",
style: TextStyle(color: Theme.of(context).colorScheme.tertiary),
),
),
const Text(" on Freepik.")
],
),
);
}
}