Browse Source

Merge pull request #301 from Leptopoda/fix/#297

neon: fix LoginPage overflow
pull/292/head
Kate 2 years ago committed by GitHub
parent
commit
6bf1e6981f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 114
      packages/neon/neon/lib/src/pages/login.dart

114
packages/neon/neon/lib/src/pages/login.dart

@ -165,74 +165,64 @@ class _LoginPageState extends State<LoginPage> {
: Center(
child: Scrollbar(
interactive: true,
child: ListView(
primary: true,
shrinkWrap: true,
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20),
children: [
SizedBox(
height: MediaQuery.of(context).size.height / 2,
child: Column(
children: [
SvgPicture.asset(
'assets/logo.svg',
width: 100,
height: 100,
),
Text(
Provider.of<Branding>(context, listen: false).name,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(
height: 30,
),
Text(AppLocalizations.of(context).loginWorksWith),
const SizedBox(
height: 20,
),
const NextcloudLogo(),
],
primary: true,
child: Column(
children: [
SvgPicture.asset(
'assets/logo.svg',
width: 100,
height: 100,
),
Text(
Provider.of<Branding>(context, listen: false).name,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(
height: 30,
),
),
Form(
key: _formKey,
child: TextFormField(
focusNode: _focusNode,
decoration: const InputDecoration(
hintText: 'https://...',
Text(AppLocalizations.of(context).loginWorksWith),
const SizedBox(
height: 20,
),
const NextcloudLogo(),
Form(
key: _formKey,
child: TextFormField(
focusNode: _focusNode,
decoration: const InputDecoration(
hintText: 'https://...',
),
keyboardType: TextInputType.url,
initialValue: widget.serverURL,
validator: (final input) => validateHttpUrl(context, input),
onFieldSubmitted: (final input) {
if (_formKey.currentState!.validate()) {
_loginBloc.setServerURL(input);
} else {
_focusNode.requestFocus();
}
},
),
keyboardType: TextInputType.url,
initialValue: widget.serverURL,
validator: (final input) => validateHttpUrl(context, input),
onFieldSubmitted: (final input) {
if (_formKey.currentState!.validate()) {
_loginBloc.setServerURL(input);
} else {
_focusNode.requestFocus();
}
},
),
),
Column(
children: [
NeonLinearProgressIndicator(
visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading,
NeonLinearProgressIndicator(
visible: serverConnectionStateSnapshot.data == ServerConnectionState.loading,
),
if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[
NeonException(
AppLocalizations.of(context).errorUnableToReachServer,
onRetry: _loginBloc.refresh,
),
],
if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[
NeonException(
AppLocalizations.of(context).errorServerInMaintenanceMode,
onRetry: _loginBloc.refresh,
),
if (serverConnectionStateSnapshot.data == ServerConnectionState.unreachable) ...[
NeonException(
AppLocalizations.of(context).errorUnableToReachServer,
onRetry: _loginBloc.refresh,
),
],
if (serverConnectionStateSnapshot.data == ServerConnectionState.maintenanceMode) ...[
NeonException(
AppLocalizations.of(context).errorServerInMaintenanceMode,
onRetry: _loginBloc.refresh,
),
],
],
),
],
],
),
),
),
),

Loading…
Cancel
Save