diff --git a/lib/ui/routes/create_account_route.dart b/lib/ui/routes/create_account_route.dart index 6fb215b..6bdb6e0 100644 --- a/lib/ui/routes/create_account_route.dart +++ b/lib/ui/routes/create_account_route.dart @@ -78,103 +78,109 @@ class __CreateAccountRouteBodyState extends State<_CreateAccountRouteBody> { child: CircularProgressIndicator(), ); - return Padding( - padding: const EdgeInsets.all(8.0), - child: ListView( - children: [ - _createAccountResult != null - ? buildErrorCard(errorMessage) - : Container(), + return Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 370), + child: ListView( + children: [ + _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"), + ), + ), + ], ), - ], + ), ), ); }