diff --git a/lib/pages/section/bloc/section_bloc.dart b/lib/pages/section/bloc/section_bloc.dart index f447fa8..b27e492 100644 --- a/lib/pages/section/bloc/section_bloc.dart +++ b/lib/pages/section/bloc/section_bloc.dart @@ -93,21 +93,21 @@ class SectionBloc extends Bloc { Future requestEnterClass( String courseLessonId, FutureOr Function() onRequestEnterSuccess, {FutureOr Function(Object)? onRequestEnterFailed}) async { - await loading(() async { - try { - await ListenDao.enterClass(courseLessonId); - await Future.sync(onRequestEnterSuccess); - } catch (e) { - if (e is ApiException) { - showToast('进入课堂失败 ${e.message}'); - } else { - showToast('进入课堂失败 $e'); - } - if (onRequestEnterFailed != null) { - await Future.sync(onRequestEnterFailed(e) as FutureOr Function()); - } + // await loading(() async { + try { + await ListenDao.enterClass(courseLessonId); + await Future.sync(onRequestEnterSuccess); + } catch (e) { + if (e is ApiException) { + showToast('进入课堂失败 ${e.message}'); + } else { + showToast('进入课堂失败 $e'); } - }); + if (onRequestEnterFailed != null) { + await Future.sync(onRequestEnterFailed(e) as FutureOr Function()); + } + } + // }); } void _requestEndClass(