|
|
|
@ -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, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|