From 7b87c05caf37ffb77b13fc292942bf20987cdb4e Mon Sep 17 00:00:00 2001 From: wuqifeng <540416539@qq.com> Date: Sat, 27 Jul 2024 14:36:17 +0800 Subject: [PATCH] feat:进入课堂接口取消loading,因为进去后会调用课程详情接口,连着2个loading体验不好 --- lib/pages/section/bloc/section_bloc.dart | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) 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( -- libgit2 0.22.2