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

View File

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