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