mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-15 00:12:22 -06:00
fix: Improve receiving shares
This commit is contained in:
@@ -57,72 +57,76 @@ class _AddAccountPageState extends State<AddAccountPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localAccounts =
|
||||
Hive.box<LocalUserAccount>(HiveBoxes.localUserAccount);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: FormBuilder(
|
||||
key: _formKey,
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
scrollBehavior: NeverScrollableScrollBehavior(),
|
||||
children: [
|
||||
if (widget.showLocalAccounts && localAccounts.isNotEmpty)
|
||||
Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context)!.logInToExistingAccount),
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
FilledButton(
|
||||
child: Text(S.of(context)!.goToLogin),
|
||||
onPressed: () {
|
||||
_pageController.nextPage(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
},
|
||||
return ValueListenableBuilder(
|
||||
valueListenable:
|
||||
Hive.box<LocalUserAccount>(HiveBoxes.localUserAccount).listenable(),
|
||||
builder: (context, localAccounts, child) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: FormBuilder(
|
||||
key: _formKey,
|
||||
child: PageView(
|
||||
controller: _pageController,
|
||||
scrollBehavior: NeverScrollableScrollBehavior(),
|
||||
children: [
|
||||
if (widget.showLocalAccounts && localAccounts.isNotEmpty)
|
||||
Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context)!.logInToExistingAccount),
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
FilledButton(
|
||||
child: Text(S.of(context)!.goToLogin),
|
||||
onPressed: () {
|
||||
_pageController.nextPage(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
final account = localAccounts.values.elementAt(index);
|
||||
return Card(
|
||||
child: UserAccountListTile(
|
||||
account: account,
|
||||
onTap: () {
|
||||
context
|
||||
.read<AuthenticationCubit>()
|
||||
.switchAccount(account.id);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: localAccounts.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
final account = localAccounts.values.elementAt(index);
|
||||
return Card(
|
||||
child: UserAccountListTile(
|
||||
account: account,
|
||||
onTap: () {
|
||||
context
|
||||
.read<AuthenticationCubit>()
|
||||
.switchAccount(account.id);
|
||||
},
|
||||
),
|
||||
ServerConnectionPage(
|
||||
titleText: widget.titleString,
|
||||
formBuilderKey: _formKey,
|
||||
onContinue: () {
|
||||
_pageController.nextPage(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
},
|
||||
itemCount: localAccounts.length,
|
||||
),
|
||||
),
|
||||
ServerConnectionPage(
|
||||
titleText: widget.titleString,
|
||||
formBuilderKey: _formKey,
|
||||
onContinue: () {
|
||||
_pageController.nextPage(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
},
|
||||
ServerLoginPage(
|
||||
formBuilderKey: _formKey,
|
||||
submitText: widget.submitText,
|
||||
onSubmit: _login,
|
||||
),
|
||||
],
|
||||
),
|
||||
ServerLoginPage(
|
||||
formBuilderKey: _formKey,
|
||||
submitText: widget.submitText,
|
||||
onSubmit: _login,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:hive_flutter/adapters.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
|
||||
import 'package:paperless_mobile/core/database/tables/global_settings.dart';
|
||||
import 'package:paperless_mobile/core/model/info_message_exception.dart';
|
||||
import 'package:paperless_mobile/features/app_intro/application_intro_slideshow.dart';
|
||||
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
||||
import 'package:paperless_mobile/features/login/model/client_certificate.dart';
|
||||
@@ -71,6 +72,8 @@ class LoginPage extends StatelessWidget {
|
||||
stackTrace,
|
||||
); //TODO: Check if we can show error message directly on field here.
|
||||
}
|
||||
} on InfoMessageException catch (error) {
|
||||
showInfoMessage(context, error);
|
||||
} catch (unknownError, stackTrace) {
|
||||
showGenericError(context, unknownError.toString(), stackTrace);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user