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