Skip to content

Commit

Permalink
Update: 删除课表导入失败时的异常信息
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzqs committed Sep 3, 2022
1 parent 751ba88 commit 0169516
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/feature/edu/timetable/page/import.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import 'dart:async';

import 'package:catcher/catcher.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
Expand Down Expand Up @@ -154,21 +153,22 @@ class _TimetableImportDialogState extends State<TimetableImportDialog> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
onPressed: () async {
// 关闭用户交互
EasyLoading.instance.userInteractions = false;
EasyLoading.show(status: '正在导入', dismissOnTap: false);
_fetchTimetable().then((value) {
try {
final value = _fetchTimetable();
Navigator.of(context).pop(value);
}).onError((e, t) {
EasyLoading.showError('导入失败\n$e');
Catcher.reportCheckedError(e, t);
}).whenComplete(() {
} catch (e) {
EasyLoading.showError('导入失败');
rethrow;
} finally {
// 关闭对话框
EasyLoading.dismiss();
// 允许用户交互
EasyLoading.instance.userInteractions = true;
});
}
},
child: const Text('导入课表'),
),
Expand Down

0 comments on commit 0169516

Please sign in to comment.