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(