mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 16:07:57 -06:00
Updated onboarding, reformatted files, improved referenced documents view, updated error handling
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:introduction_screen/introduction_screen.dart';
|
||||
import 'package:paperless_mobile/di_initializer.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/app_intro/widgets/biometric_authentication_intro_slide.dart';
|
||||
import 'package:paperless_mobile/features/app_intro/widgets/configuration_done_intro_slide.dart';
|
||||
import 'package:paperless_mobile/features/app_intro/widgets/welcome_intro_slide.dart';
|
||||
import 'package:paperless_mobile/features/home/view/home_page.dart';
|
||||
import 'package:paperless_mobile/features/settings/bloc/application_settings_cubit.dart';
|
||||
import 'package:intro_slider/intro_slider.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/biometric_authentication_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/language_selection_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/theme_mode_setting.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
|
||||
class ApplicationIntroSlideshow extends StatelessWidget {
|
||||
const ApplicationIntroSlideshow({super.key});
|
||||
@@ -16,24 +15,82 @@ class ApplicationIntroSlideshow extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: IntroSlider(
|
||||
renderDoneBtn: TextButton(
|
||||
child: Text("GO"), //TODO: INTL
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
backgroundColorAllTabs: Theme.of(context).canvasColor,
|
||||
onDonePress: () => Navigator.of(context)
|
||||
.pushReplacement(MaterialPageRoute(builder: (context) => const HomePage())),
|
||||
listCustomTabs: [
|
||||
const WelcomeIntroSlide(),
|
||||
BlocProvider.value(
|
||||
value: getIt<ApplicationSettingsCubit>(),
|
||||
child: const BiometricAuthenticationIntroSlide(),
|
||||
child: BlocProvider.value(
|
||||
value: getIt<ApplicationSettingsCubit>(),
|
||||
child: IntroductionScreen(
|
||||
globalBackgroundColor: Theme.of(context).canvasColor,
|
||||
showDoneButton: true,
|
||||
next: Text(S.of(context).onboardingNextButtonLabel),
|
||||
done: Text(S.of(context).onboardingDoneButtonLabel),
|
||||
onDone: () => Navigator.pop(context),
|
||||
dotsDecorator: DotsDecorator(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
activeColor: Theme.of(context).colorScheme.primary,
|
||||
activeSize: Size(16.0, 8.0),
|
||||
activeShape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(25.0)),
|
||||
),
|
||||
),
|
||||
const ConfigurationDoneIntroSlide(),
|
||||
].padded(const EdgeInsets.all(16.0)),
|
||||
pages: [
|
||||
PageViewModel(
|
||||
titleWidget: Text(
|
||||
"Always right at your fingertip",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
image: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset("assets/images/organize_documents.png"),
|
||||
),
|
||||
bodyWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
"Organizing documents was never this easy",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PageViewModel(
|
||||
titleWidget: Text(
|
||||
"Accessible only by you",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
image: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset("assets/images/secure_documents.png"),
|
||||
),
|
||||
bodyWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
"Secure your documents with biometric authentication and client certificates",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PageViewModel(
|
||||
titleWidget: Text(
|
||||
"You're almost done",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
image: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset("assets/images/success.png"),
|
||||
),
|
||||
bodyWidget: Column(
|
||||
children: const [
|
||||
BiometricAuthenticationSetting(),
|
||||
LanguageSelectionSetting(),
|
||||
ThemeModeSetting(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ class BiometricAuthenticationIntroSlide extends StatefulWidget {
|
||||
_BiometricAuthenticationIntroSlideState();
|
||||
}
|
||||
|
||||
class _BiometricAuthenticationIntroSlideState extends State<BiometricAuthenticationIntroSlide> {
|
||||
class _BiometricAuthenticationIntroSlideState
|
||||
extends State<BiometricAuthenticationIntroSlide> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//TODO: INTL
|
||||
@@ -58,9 +59,12 @@ class _BiometricAuthenticationIntroSlideState extends State<BiometricAuthenticat
|
||||
return ElevatedButton(
|
||||
child: Text("Enable"),
|
||||
onPressed: () {
|
||||
final settings = BlocProvider.of<ApplicationSettingsCubit>(context).state;
|
||||
final settings =
|
||||
BlocProvider.of<ApplicationSettingsCubit>(context)
|
||||
.state;
|
||||
getIt<AuthenticationService>()
|
||||
.authenticateLocalUser("Please authenticate to secure Paperless Mobile")
|
||||
.authenticateLocalUser(
|
||||
"Please authenticate to secure Paperless Mobile")
|
||||
.then((isEnabled) {
|
||||
if (!isEnabled) {
|
||||
showSnackBar(context,
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/src/widgets/framework.dart';
|
||||
|
||||
class WelcomeIntroSlide extends StatelessWidget {
|
||||
const WelcomeIntroSlide({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//TODO: INTL
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Welcome to Paperless Mobile!",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
"Manage and add your documents on the go!",
|
||||
textAlign: TextAlign.center,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Text(
|
||||
"Manage, share and create documents on the go without any compromises!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Theme.of(context).hintColor),
|
||||
),
|
||||
),
|
||||
Align(child: Image.asset("assets/logos/paperless_logo_green.png")),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user