Slight login/sighup redesign
This commit is contained in:
parent
d4d9a28067
commit
3b42992fa2
|
@ -136,14 +136,10 @@ class _LoginState extends State<Login> {
|
|||
body: Builder(builder: (context) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
max((MediaQuery.of(context).size.width - 600) / 2, 0)),
|
||||
horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0),
|
||||
vertical: 8.0),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Icon(Icons.account_box,
|
||||
color: Theme.of(context).primaryColor),
|
||||
),
|
||||
title: TextField(
|
||||
readOnly: loading,
|
||||
autocorrect: false,
|
||||
|
@ -151,19 +147,19 @@ class _LoginState extends State<Login> {
|
|||
onChanged: (t) => _checkWellKnownWithCoolDown(t, context),
|
||||
controller: usernameController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(Icons.person_outline),
|
||||
hintText:
|
||||
'@${L10n.of(context).username.toLowerCase()}:domain',
|
||||
errorText: usernameError,
|
||||
labelText: L10n.of(context).username),
|
||||
labelText: L10n.of(context).username,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).brightness == Brightness.dark
|
||||
? Color(0xff121212)
|
||||
: Colors.white,
|
||||
child: Icon(Icons.lock, color: Theme.of(context).primaryColor),
|
||||
),
|
||||
title: TextField(
|
||||
readOnly: loading,
|
||||
autocorrect: false,
|
||||
|
@ -172,16 +168,18 @@ class _LoginState extends State<Login> {
|
|||
obscureText: !showPassword,
|
||||
onSubmitted: (t) => login(context),
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(Icons.lock_outline),
|
||||
hintText: '****',
|
||||
errorText: passwordError,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(showPassword
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility),
|
||||
icon: Icon(
|
||||
showPassword ? Icons.visibility_off : Icons.visibility),
|
||||
onPressed: () =>
|
||||
setState(() => showPassword = !showPassword),
|
||||
),
|
||||
labelText: L10n.of(context).password),
|
||||
labelText: L10n.of(context).password,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
|
|
|
@ -86,10 +86,6 @@ class _SignUpState extends State<SignUp> {
|
|||
horizontal:
|
||||
max((MediaQuery.of(context).size.width - 600) / 2, 0)),
|
||||
children: <Widget>[
|
||||
Hero(
|
||||
tag: 'loginBanner',
|
||||
child: Image.asset('assets/fluffychat-banner.png'),
|
||||
),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: avatar == null ? null : FileImage(avatar),
|
||||
|
@ -109,9 +105,12 @@ class _SignUpState extends State<SignUp> {
|
|||
Icons.close,
|
||||
color: Colors.red,
|
||||
),
|
||||
title: Text(avatar == null
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.all(11.0),
|
||||
child: Text(avatar == null
|
||||
? L10n.of(context).setAProfilePicture
|
||||
: L10n.of(context).discardPicture),
|
||||
),
|
||||
onTap: avatar == null
|
||||
? setAvatarAction
|
||||
: () => setState(() => avatar = null),
|
||||
|
@ -133,7 +132,9 @@ class _SignUpState extends State<SignUp> {
|
|||
decoration: InputDecoration(
|
||||
hintText: L10n.of(context).username,
|
||||
errorText: usernameError,
|
||||
labelText: L10n.of(context).chooseAUsername),
|
||||
labelText: L10n.of(context).chooseAUsername,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
|
|
|
@ -127,11 +127,8 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
|||
padding: EdgeInsets.symmetric(
|
||||
horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0)),
|
||||
children: <Widget>[
|
||||
SizedBox(height: 10),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(Icons.lock, color: Theme.of(context).primaryColor),
|
||||
),
|
||||
title: TextField(
|
||||
controller: passwordController,
|
||||
obscureText: !showPassword,
|
||||
|
@ -139,15 +136,17 @@ class _SignUpPasswordState extends State<SignUpPassword> {
|
|||
autocorrect: false,
|
||||
onSubmitted: (t) => _signUpAction(context),
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(Icons.lock_outline),
|
||||
hintText: '****',
|
||||
errorText: passwordError,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
showPassword ? Icons.visibility_off : Icons.visibility),
|
||||
onPressed: () =>
|
||||
setState(() => showPassword = !showPassword),
|
||||
onPressed: () => setState(() => showPassword = !showPassword),
|
||||
),
|
||||
labelText: L10n.of(context).password,
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
labelText: L10n.of(context).password),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
|
|
Loading…
Reference in a new issue