chore: Follow up design textfields
This commit is contained in:
parent
a3d15ec001
commit
aa3de2816b
13 changed files with 105 additions and 52 deletions
|
|
@ -86,7 +86,17 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||
Future<void> checkHomeserverAction([_]) async {
|
||||
homeserverController.text =
|
||||
homeserverController.text.trim().toLowerCase().replaceAll(' ', '-');
|
||||
if (homeserverController.text == _lastCheckedUrl) return;
|
||||
|
||||
if (homeserverController.text.isEmpty) {
|
||||
setState(() {
|
||||
error = loginFlows = null;
|
||||
isLoading = false;
|
||||
Matrix.of(context).getLoginClient().homeserver = null;
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (_lastCheckedUrl == homeserverController.text) return;
|
||||
|
||||
_lastCheckedUrl = homeserverController.text;
|
||||
setState(() {
|
||||
error = loginFlows = null;
|
||||
|
|
@ -102,7 +112,12 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||
final (_, _, loginFlows) = await client.checkHomeserver(homeserver);
|
||||
this.loginFlows = loginFlows;
|
||||
} catch (e) {
|
||||
setState(() => error = (e).toLocalizedString(context));
|
||||
setState(
|
||||
() => error = (e).toLocalizedString(
|
||||
context,
|
||||
ExceptionContext.checkHomeserver,
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => isLoading = false);
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
controller.tryCheckHomeserverActionWithoutCooldown,
|
||||
onTap: controller.tryCheckHomeserverActionWithCooldown,
|
||||
controller: controller.homeserverController,
|
||||
autocorrect: false,
|
||||
keyboardType: TextInputType.url,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: controller.isLoading
|
||||
? Container(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue