From e05d7c4395b5fa3dde3d80a047a71652d597a11b Mon Sep 17 00:00:00 2001 From: "1147192855@qq.com" <1147192855@qq.com> Date: Thu, 13 Jun 2024 17:23:07 +0800 Subject: [PATCH] no message --- marking_app/lib/pages/login/index.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/marking_app/lib/pages/login/index.dart b/marking_app/lib/pages/login/index.dart index 046757e..c3de4b0 100644 --- a/marking_app/lib/pages/login/index.dart +++ b/marking_app/lib/pages/login/index.dart @@ -120,9 +120,9 @@ class _TheLoginState extends ConsumerState with CommonMixin { // 获取用户学校数据 void getSchoolData(String loginName) async { - var _client = await getClient(); if (loginName.length != 0) { try { + var _client = await getClient(); var res = await _client.toLoginGetSchools(loginName); if (res.success) { schools = res.data ?? []; @@ -344,9 +344,7 @@ class _TheLoginState extends ConsumerState with CommonMixin { spreadRadius: 0.5, //阴影扩散程度 ) ], - borderRadius: BorderRadius.all( - Radius.circular(8.w), - ), + borderRadius: BorderRadius.all(Radius.circular(8.w)), ), alignment: Alignment.center, width: double.infinity, @@ -430,14 +428,13 @@ class _TheLoginState extends ConsumerState with CommonMixin { void toLogin() async { if (!canLogin) return; - setState(() => canLogin = false); - void toMsg(msg) { - ToastUtils.showError(msg); + Future.delayed(Duration.zero, () => ToastUtils.showError(msg)); setState(() => canLogin = true); } try { + setState(() => canLogin = false); FocusScope.of(context).requestFocus(_theFocus); if (!readAgreement) { var resFlag = await showDialog(