feat: rework account management page, add tooltip to settings

This commit is contained in:
Anton Stubenbord
2023-04-21 18:56:36 +02:00
parent 95dd0a2405
commit 1b9e4fbb81
14 changed files with 246 additions and 196 deletions

View File

@@ -170,6 +170,7 @@ class AuthenticationCubit extends Cubit<AuthenticationState> {
}) async {
assert(credentials.password != null && credentials.username != null);
final userId = "${credentials.username}@$serverUrl";
final userAccountsBox = Hive.box<UserAccount>(HiveBoxes.userAccount);
final userSettingsBox = Hive.box<UserSettings>(HiveBoxes.userSettings);

View File

@@ -28,11 +28,13 @@ class LoginPage extends StatefulWidget {
) onSubmit;
final String submitText;
final String titleString;
const LoginPage({
Key? key,
required this.onSubmit,
required this.submitText,
required this.titleString,
}) : super(key: key);
@override
@@ -47,7 +49,7 @@ class _LoginPageState extends State<LoginPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false, // appBar: AppBar(
resizeToAvoidBottomInset: false,
body: FormBuilder(
key: _formKey,
child: PageView(
@@ -55,6 +57,7 @@ class _LoginPageState extends State<LoginPage> {
scrollBehavior: NeverScrollableScrollBehavior(),
children: [
ServerConnectionPage(
titleString: widget.titleString,
formBuilderKey: _formKey,
onContinue: () {
_pageController.nextPage(

View File

@@ -15,11 +15,13 @@ import 'package:provider/provider.dart';
class ServerConnectionPage extends StatefulWidget {
final GlobalKey<FormBuilderState> formBuilderKey;
final void Function() onContinue;
final String titleString;
const ServerConnectionPage({
super.key,
required this.formBuilderKey,
required this.onContinue,
required this.titleString,
});
@override
@@ -35,7 +37,7 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
return Scaffold(
appBar: AppBar(
toolbarHeight: kToolbarHeight - 4,
title: Text(S.of(context)!.connectToPaperless),
title: Text(widget.titleString),
bottom: PreferredSize(
child:
_isCheckingConnection ? const LinearProgressIndicator() : const SizedBox(height: 4.0),