Server selection and login are on different pages. #33
2 changed files with 12 additions and 9 deletions
Fixed inconsistency with focus change in error case on login page.
commit
28be105552
|
|
@ -81,6 +81,14 @@ class LoginPage extends HookConsumerWidget {
|
|||
},
|
||||
decoration: InputDecoration(
|
||||
label: Text("Username"),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
width: hasError.value ? 4 : 2,
|
||||
color: hasError.value
|
||||
? theme.colorScheme.error
|
||||
: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
width: hasError.value ? 4 : 2,
|
||||
|
|
|
|||
|
|
@ -49,20 +49,15 @@ class SelectServerPage extends HookConsumerWidget {
|
|||
);
|
||||
} else {
|
||||
homeserverUrl.text = newHomeserver!.origin;
|
||||
|
Henry-Hiles marked this conversation as resolved
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => LoginPage(homeserver: Uri.parse(newUrl)),
|
||||
),
|
||||
await Navigator.of(context).push(
|
||||
|
Henry-Hiles marked this conversation as resolved
Outdated
Henry-Hiles
commented
Might be nice to do that Might be nice to do that `Uri.parse` in `client.discoverHomeserver`, and have that return a Uri.
istalri
commented
Yeah I don't mind. If you feel that's cleaner I will do so. Yeah I don't mind. If you feel that's cleaner I will do so.
Henry-Hiles
commented
Also, you should use Also, you should use `Navigator.of(context).push`, and await it.
istalri
commented
Makes sense, will do Makes sense, will do
|
||||
MaterialPageRoute(builder: (_) => LoginPage(homeserver: newUrl)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (context.mounted) {
|
||||
homeserverFocusNode.requestFocus();
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: Appbar(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue
Instead of setting homeserver in client state controller, can we just
Navigator.of(context).pushtheLoginPage, passing in ahomeserveras an argument?