Better login UX

This commit is contained in:
Christian Pauly 2020-02-16 08:44:56 +01:00
parent 81ae064db7
commit 8d4469ebde
2 changed files with 5 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class _LoginState extends State<Login> {
} }
String homeserver = serverController.text; String homeserver = serverController.text;
if (homeserver.isEmpty) homeserver = "matrix-client.matrix.org"; if (homeserver.isEmpty) homeserver = "tchncs.de";
if (!homeserver.startsWith("https://")) { if (!homeserver.startsWith("https://")) {
homeserver = "https://" + homeserver; homeserver = "https://" + homeserver;
} }
@ -91,6 +91,7 @@ class _LoginState extends State<Login> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: loading ? Container() : null,
title: TextField( title: TextField(
autocorrect: false, autocorrect: false,
controller: serverController, controller: serverController,
@ -124,6 +125,7 @@ class _LoginState extends State<Login> {
color: Theme.of(context).primaryColor), color: Theme.of(context).primaryColor),
), ),
title: TextField( title: TextField(
readOnly: loading,
autocorrect: false, autocorrect: false,
controller: usernameController, controller: usernameController,
decoration: InputDecoration( decoration: InputDecoration(
@ -139,6 +141,7 @@ class _LoginState extends State<Login> {
child: Icon(Icons.lock, color: Theme.of(context).primaryColor), child: Icon(Icons.lock, color: Theme.of(context).primaryColor),
), ),
title: TextField( title: TextField(
readOnly: loading,
autocorrect: false, autocorrect: false,
controller: passwordController, controller: passwordController,
obscureText: !showPassword, obscureText: !showPassword,

View File

@ -52,7 +52,7 @@ class _SignUpState extends State<SignUp> {
usernameController.text.toLowerCase().replaceAll(" ", "-"); usernameController.text.toLowerCase().replaceAll(" ", "-");
String homeserver = serverController.text; String homeserver = serverController.text;
if (homeserver.isEmpty) homeserver = "matrix-client.matrix.org"; if (homeserver.isEmpty) homeserver = "tchncs.de";
if (!homeserver.startsWith("https://")) { if (!homeserver.startsWith("https://")) {
homeserver = "https://" + homeserver; homeserver = "https://" + homeserver;
} }