From a9e0b0014cead2b675e0d717210dcf089e89de40 Mon Sep 17 00:00:00 2001 From: wuqifeng <540416539@qq.com> Date: Thu, 16 May 2024 12:06:28 +0800 Subject: [PATCH] feat:环境变量修改 --- lib/common/request/basic_config.dart | 4 ++-- lib/pages/section/section_page.dart | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------- 2 files changed, 87 insertions(+), 75 deletions(-) diff --git a/lib/common/request/basic_config.dart b/lib/common/request/basic_config.dart index d507c86..a06e191 100644 --- a/lib/common/request/basic_config.dart +++ b/lib/common/request/basic_config.dart @@ -1,8 +1,8 @@ import 'package:flutter/foundation.dart'; class BasicConfig { - // static bool isTestDev = true; - static bool isTestDev = false; + static bool isTestDev = !isEnvProd(); + // static bool isTestDev = false; // 暂时未启用 diff --git a/lib/pages/section/section_page.dart b/lib/pages/section/section_page.dart index 5febdc4..1db876e 100644 --- a/lib/pages/section/section_page.dart +++ b/lib/pages/section/section_page.dart @@ -148,32 +148,36 @@ class _SectionPageView extends StatelessWidget { title: bloc.getCourseUnitDetail().name, courseModuleCode: bloc.courseUnitEntity.courseModuleCode), Expanded( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.w), - child: OverflowBox( - child: NestedPageView.builder( - itemCount: bloc.unlockPageCount(), - controller: bloc.pageController, - onPageChanged: (int index) { - bloc.add(CurrentUnitIndexChangeEvent(index)); - }, - itemBuilder: (context, index) { - // return ScrollConfiguration( - // ///去掉 Android 上默认的边缘拖拽效果 - // behavior: ScrollConfiguration.of(context) - // .copyWith(overscroll: false), - // child: _itemTransCard( - // bloc.getCourseUnitDetail(pageIndex: index), - // index, - // context), - // ); - return _itemTransCard( - bloc.getCourseUnitDetail(pageIndex: index), - index, - context); - }), - ), // 设置外部padding, - )), + child: Container( + color: Colors.blue, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 10.w), + // child: OverflowBox( + child: NestedPageView.builder( + itemCount: bloc.unlockPageCount(), + controller: bloc.pageController, + onPageChanged: (int index) { + bloc.add(CurrentUnitIndexChangeEvent(index)); + }, + itemBuilder: (context, index) { + // return ScrollConfiguration( + // ///去掉 Android 上默认的边缘拖拽效果 + // behavior: ScrollConfiguration.of(context) + // .copyWith(overscroll: false), + // child: _itemTransCard( + // bloc.getCourseUnitDetail(pageIndex: index), + // index, + // context), + // ); + return _itemTransCard( + bloc.getCourseUnitDetail(pageIndex: index), + index, + context); + }), + // ), // 设置外部padding, + ) + ) + ), SafeArea( child: Padding( padding: EdgeInsets.symmetric(horizontal: 13.w), @@ -248,54 +252,62 @@ Widget _itemTransCard( ), ); } else { - return NestedListView.builder( - itemCount: bloc.courseSectionDatasMap[courseUnitDetail.id]?.length ?? 0, - scrollDirection: Axis.horizontal, - itemBuilder: (BuildContext context, int index) { - CourseSectionEntity sectionData = courseSectionEntities[index]; - if (sectionData.courseType == SectionType.bouns.value) { - //彩蛋 - return GestureDetector( - onTap: () { - if (!UserUtil.isLogined()) { - pushNamed(AppRouteName.login); - return; - } - if (sectionData.lock == true) { - showToast('当前课程暂未解锁'); - return; - } + return + Padding(padding: EdgeInsets.symmetric( + vertical: 28.h), + child: Container( + color: Colors.red, + margin: EdgeInsets.symmetric(vertical: 10.h), + child: NestedListView.builder( + itemCount: bloc.courseSectionDatasMap[courseUnitDetail.id]?.length ?? 0, + scrollDirection: Axis.horizontal, + itemBuilder: (BuildContext context, int index) { + CourseSectionEntity sectionData = courseSectionEntities[index]; + if (sectionData.courseType == SectionType.bouns.value) { + //彩蛋 + return GestureDetector( + onTap: () { + if (!UserUtil.isLogined()) { + pushNamed(AppRouteName.login); + return; + } + if (sectionData.lock == true) { + showToast('当前课程暂未解锁'); + return; + } - ///进入课堂 - bloc.add(RequestEnterClassEvent( - sectionData.id.toString(), sectionData.courseType)); - }, - child: SectionBoundsItem( - imageUrl: sectionData.coverUrl, - ), - ); - } else { - return GestureDetector( - onTap: () { - if (!UserUtil.isLogined()) { - pushNamed(AppRouteName.login); - return; - } - if (sectionData.lock == true) { - showToast('当前课程暂未解锁'); - return; - } + ///进入课堂 + bloc.add(RequestEnterClassEvent( + sectionData.id.toString(), sectionData.courseType)); + }, + child: SectionBoundsItem( + imageUrl: sectionData.coverUrl, + ), + ); + } else { + return GestureDetector( + onTap: () { + if (!UserUtil.isLogined()) { + pushNamed(AppRouteName.login); + return; + } + if (sectionData.lock == true) { + showToast('当前课程暂未解锁'); + return; + } - ///进入课堂 - bloc.add(RequestEnterClassEvent( - sectionData.id.toString(), sectionData.courseType)); - }, - child: SectionItem( - courseModuleId: bloc.courseUnitEntity.courseModuleCode, - lessons: sectionData, - ), - ); - } - }); + ///进入课堂 + bloc.add(RequestEnterClassEvent( + sectionData.id.toString(), sectionData.courseType)); + }, + child: SectionItem( + courseModuleId: bloc.courseUnitEntity.courseModuleCode, + lessons: sectionData, + ), + ); + } + }), + ), + ); } } -- libgit2 0.22.2