1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 04:48:51 +00:00

Fix issue on create account route

This commit is contained in:
Pierre HUBERT 2020-05-04 20:11:36 +02:00
parent 5c76f6e0a6
commit 86c89e782c

View File

@ -78,103 +78,109 @@ class __CreateAccountRouteBodyState extends State<_CreateAccountRouteBody> {
child: CircularProgressIndicator(),
);
return Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(
children: <Widget>[
_createAccountResult != null
? buildErrorCard(errorMessage)
: Container(),
return Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 370),
child: ListView(
children: <Widget>[
_createAccountResult != null
? buildErrorCard(errorMessage)
: Container(),
// First name
_InputEntry(
controller: _firstNameController,
label: tr("First name"),
onEdited: _updateUI,
icon: Icon(Icons.perm_identity),
error: _showErrors && !_isFirstNameValid
? tr("Invalid first name!")
: null,
),
// First name
_InputEntry(
controller: _firstNameController,
label: tr("First name"),
onEdited: _updateUI,
icon: Icon(Icons.perm_identity),
error: _showErrors && !_isFirstNameValid
? tr("Invalid first name!")
: null,
),
// Last name
_InputEntry(
controller: _lastNameController,
label: tr("Last name"),
onEdited: _updateUI,
icon: Icon(Icons.perm_identity),
error: _showErrors && !_isLastNameValid
? tr("Invalid last name!")
: null,
),
// Last name
_InputEntry(
controller: _lastNameController,
label: tr("Last name"),
onEdited: _updateUI,
icon: Icon(Icons.perm_identity),
error: _showErrors && !_isLastNameValid
? tr("Invalid last name!")
: null,
),
// Email address
_InputEntry(
controller: _emailController,
label: tr("Email address"),
onEdited: _updateUI,
icon: Icon(Icons.email),
keyboard: TextInputType.emailAddress,
error: _showErrors && !_isEmailValid
? tr("Invalid email address!")
: null,
),
// Email address
_InputEntry(
controller: _emailController,
label: tr("Email address"),
onEdited: _updateUI,
icon: Icon(Icons.email),
keyboard: TextInputType.emailAddress,
error: _showErrors && !_isEmailValid
? tr("Invalid email address!")
: null,
),
// Password
_InputEntry(
controller: _passwordController,
label: tr("Password"),
onEdited: _updateUI,
icon: Icon(Icons.lock),
isPassword: true,
error: _showErrors && !_isPasswordValid
? tr("Invalid password!")
: null,
),
// Password
_InputEntry(
controller: _passwordController,
label: tr("Password"),
onEdited: _updateUI,
icon: Icon(Icons.lock),
isPassword: true,
error: _showErrors && !_isPasswordValid
? tr("Invalid password!")
: null,
),
// Verify password
_InputEntry(
controller: _verifyPasswordController,
label: tr("Confirm your password"),
onEdited: _updateUI,
icon: Icon(Icons.lock_outline),
isPassword: true,
error: _showErrors && !_isPasswordConfirmationValid
? tr("The password and its confirmation do not match!")
: null,
),
// Verify password
_InputEntry(
controller: _verifyPasswordController,
label: tr("Confirm your password"),
onEdited: _updateUI,
icon: Icon(Icons.lock_outline),
isPassword: true,
error: _showErrors && !_isPasswordConfirmationValid
? tr("The password and its confirmation do not match!")
: null,
),
// TOS
CheckboxListTile(
title: Text(tr("I have read and accepted the Terms Of Service.")),
value: _acceptedTOS,
onChanged: (b) {
_acceptedTOS = b;
_updateUI();
},
subtitle: _showErrors && !_acceptedTOS
? Text(
tr("You must accept the Terms Of Service to continue."),
style: TextStyle(color: Colors.redAccent),
)
: null,
controlAffinity: ListTileControlAffinity.leading,
secondary: IconButton(
icon: Icon(Icons.open_in_new),
onPressed: _openTOS,
),
),
// TOS
CheckboxListTile(
title:
Text(tr("I have read and accepted the Terms Of Service.")),
value: _acceptedTOS,
onChanged: (b) {
_acceptedTOS = b;
_updateUI();
},
subtitle: _showErrors && !_acceptedTOS
? Text(
tr("You must accept the Terms Of Service to continue."),
style: TextStyle(color: Colors.redAccent),
)
: null,
controlAffinity: ListTileControlAffinity.leading,
secondary: IconButton(
icon: Icon(Icons.open_in_new),
onPressed: _openTOS,
),
),
// Submit button
Center(
child: RaisedButton(
color: Colors.blue,
textColor: Colors.white,
onPressed: _submitForm,
child: Text("Submit"),
),
// Submit button
Center(
child: RaisedButton(
color: Colors.blue,
textColor: Colors.white,
onPressed: _submitForm,
child: Text("Submit"),
),
),
],
),
],
),
),
);
}