diff --git a/lib/views/login.dart b/lib/views/login.dart index 5d4e358..9f0827e 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -13,7 +13,7 @@ import 'package:flutter/material.dart'; import 'chat_list.dart'; class Login extends StatefulWidget { - Login({Key key, String this.username: null}) : super(key:key); + Login({Key key, String this.username: null}) : super(key: key); final String username; @@ -105,7 +105,7 @@ class _LoginState extends State { } } - @override + @override void initState() { super.initState(); usernameController.text = widget?.username; @@ -136,14 +136,10 @@ class _LoginState extends State { 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: [ 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 { onChanged: (t) => _checkWellKnownWithCoolDown(t, context), controller: usernameController, decoration: InputDecoration( - hintText: - '@${L10n.of(context).username.toLowerCase()}:domain', - errorText: usernameError, - labelText: L10n.of(context).username), + icon: Icon(Icons.person_outline), + hintText: + '@${L10n.of(context).username.toLowerCase()}:domain', + errorText: usernameError, + 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 { obscureText: !showPassword, onSubmitted: (t) => login(context), decoration: InputDecoration( - hintText: '****', - errorText: passwordError, - suffixIcon: IconButton( - icon: Icon(showPassword - ? Icons.visibility_off - : Icons.visibility), - onPressed: () => - setState(() => showPassword = !showPassword), - ), - labelText: L10n.of(context).password), + icon: Icon(Icons.lock_outline), + hintText: '****', + errorText: passwordError, + suffixIcon: IconButton( + icon: Icon( + showPassword ? Icons.visibility_off : Icons.visibility), + onPressed: () => + setState(() => showPassword = !showPassword), + ), + labelText: L10n.of(context).password, + border: OutlineInputBorder(), + ), ), ), SizedBox(height: 20), diff --git a/lib/views/sign_up.dart b/lib/views/sign_up.dart index 9be825e..00c81ca 100644 --- a/lib/views/sign_up.dart +++ b/lib/views/sign_up.dart @@ -86,10 +86,6 @@ class _SignUpState extends State { horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0)), children: [ - 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 { Icons.close, color: Colors.red, ), - title: Text(avatar == null - ? L10n.of(context).setAProfilePicture - : L10n.of(context).discardPicture), + 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), @@ -131,9 +130,11 @@ class _SignUpState extends State { controller: usernameController, onSubmitted: (s) => signUpAction(context), decoration: InputDecoration( - hintText: L10n.of(context).username, - errorText: usernameError, - labelText: L10n.of(context).chooseAUsername), + hintText: L10n.of(context).username, + errorText: usernameError, + labelText: L10n.of(context).chooseAUsername, + border: OutlineInputBorder(), + ), ), ), SizedBox(height: 20), diff --git a/lib/views/sign_up_password.dart b/lib/views/sign_up_password.dart index 16fc5c8..e261fc6 100644 --- a/lib/views/sign_up_password.dart +++ b/lib/views/sign_up_password.dart @@ -127,11 +127,8 @@ class _SignUpPasswordState extends State { padding: EdgeInsets.symmetric( horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0)), children: [ + 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 { autocorrect: false, onSubmitted: (t) => _signUpAction(context), decoration: InputDecoration( - hintText: '****', - errorText: passwordError, - suffixIcon: IconButton( - icon: Icon( - showPassword ? Icons.visibility_off : Icons.visibility), - onPressed: () => - setState(() => showPassword = !showPassword), - ), - labelText: L10n.of(context).password), + icon: Icon(Icons.lock_outline), + hintText: '****', + errorText: passwordError, + suffixIcon: IconButton( + icon: Icon( + showPassword ? Icons.visibility_off : Icons.visibility), + onPressed: () => setState(() => showPassword = !showPassword), + ), + labelText: L10n.of(context).password, + border: OutlineInputBorder(), + ), ), ), SizedBox(height: 20),