Initial commit

This commit is contained in:
Anton Stubenbord
2022-10-30 14:15:37 +01:00
commit cb797df7d2
272 changed files with 16278 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_paperless_mobile/di_initializer.dart';
import 'package:flutter_paperless_mobile/features/login/services/authentication.service.dart';
import 'package:flutter_paperless_mobile/features/settings/bloc/application_settings_cubit.dart';
import 'package:flutter_paperless_mobile/features/settings/model/application_settings_state.dart';
import 'package:flutter_paperless_mobile/util.dart';
class BiometricAuthenticationIntroSlide extends StatefulWidget {
const BiometricAuthenticationIntroSlide({
Key? key,
}) : super(key: key);
@override
State<BiometricAuthenticationIntroSlide> createState() =>
_BiometricAuthenticationIntroSlideState();
}
class _BiometricAuthenticationIntroSlideState extends State<BiometricAuthenticationIntroSlide> {
@override
Widget build(BuildContext context) {
//TODO: INTL
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
builder: (context, settings) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"Configure Biometric Authentication",
style: Theme.of(context).textTheme.titleLarge,
textAlign: TextAlign.center,
),
Text(
"It is highly recommended to additionally secure your local data. Do you want to enable biometric authentication?",
textAlign: TextAlign.center,
),
Column(
children: [
const Icon(
Icons.fingerprint,
size: 48,
),
const SizedBox(
height: 32,
),
Builder(builder: (context) {
if (settings.isLocalAuthenticationEnabled) {
return ElevatedButton.icon(
icon: Icon(
Icons.done,
color: Colors.green,
),
label: Text("Enabled"),
onPressed: null,
);
}
return ElevatedButton(
child: Text("Enable"),
onPressed: () {
final settings = BlocProvider.of<ApplicationSettingsCubit>(context).state;
getIt<AuthenticationService>()
.authenticateLocalUser("Please authenticate to secure Paperless Mobile")
.then((isEnabled) {
if (!isEnabled) {
showSnackBar(context,
"Could not set up biometric authentication. Please try again or skip for now.");
return;
}
BlocProvider.of<ApplicationSettingsCubit>(context)
.setIsBiometricAuthenticationEnabled(true);
});
},
);
}),
],
),
],
);
},
);
}
}

View File

@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class ConfigurationDoneIntroSlide extends StatelessWidget {
const ConfigurationDoneIntroSlide({super.key});
@override
Widget build(BuildContext context) {
return Column(
//TODO: INTL
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
"All set up!",
style: Theme.of(context).textTheme.titleLarge,
),
Icon(
Icons.emoji_emotions_outlined,
size: 64,
),
Text(
"You've successfully configured Paperless Mobile! Press 'GO' to get started managing your documents.",
textAlign: TextAlign.center,
),
],
);
}
}

View File

@@ -0,0 +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!",
style: Theme.of(context).textTheme.titleLarge,
textAlign: TextAlign.center,
),
Text(
"Manage and add your documents on the go!",
textAlign: TextAlign.center,
),
],
);
}
}