Commit a9e0b0014cead2b675e0d717210dcf089e89de40
1 parent
1ebed821
feat:环境变量修改
Showing
2 changed files
with
87 additions
and
75 deletions
lib/common/request/basic_config.dart
lib/pages/section/section_page.dart
| ... | ... | @@ -148,32 +148,36 @@ class _SectionPageView extends StatelessWidget { |
| 148 | 148 | title: bloc.getCourseUnitDetail().name, |
| 149 | 149 | courseModuleCode: bloc.courseUnitEntity.courseModuleCode), |
| 150 | 150 | Expanded( |
| 151 | - child: Padding( | |
| 152 | - padding: EdgeInsets.symmetric(horizontal: 10.w), | |
| 153 | - child: OverflowBox( | |
| 154 | - child: NestedPageView.builder( | |
| 155 | - itemCount: bloc.unlockPageCount(), | |
| 156 | - controller: bloc.pageController, | |
| 157 | - onPageChanged: (int index) { | |
| 158 | - bloc.add(CurrentUnitIndexChangeEvent(index)); | |
| 159 | - }, | |
| 160 | - itemBuilder: (context, index) { | |
| 161 | - // return ScrollConfiguration( | |
| 162 | - // ///去掉 Android 上默认的边缘拖拽效果 | |
| 163 | - // behavior: ScrollConfiguration.of(context) | |
| 164 | - // .copyWith(overscroll: false), | |
| 165 | - // child: _itemTransCard( | |
| 166 | - // bloc.getCourseUnitDetail(pageIndex: index), | |
| 167 | - // index, | |
| 168 | - // context), | |
| 169 | - // ); | |
| 170 | - return _itemTransCard( | |
| 171 | - bloc.getCourseUnitDetail(pageIndex: index), | |
| 172 | - index, | |
| 173 | - context); | |
| 174 | - }), | |
| 175 | - ), // 设置外部padding, | |
| 176 | - )), | |
| 151 | + child: Container( | |
| 152 | + color: Colors.blue, | |
| 153 | + child: Padding( | |
| 154 | + padding: EdgeInsets.symmetric(horizontal: 10.w), | |
| 155 | + // child: OverflowBox( | |
| 156 | + child: NestedPageView.builder( | |
| 157 | + itemCount: bloc.unlockPageCount(), | |
| 158 | + controller: bloc.pageController, | |
| 159 | + onPageChanged: (int index) { | |
| 160 | + bloc.add(CurrentUnitIndexChangeEvent(index)); | |
| 161 | + }, | |
| 162 | + itemBuilder: (context, index) { | |
| 163 | + // return ScrollConfiguration( | |
| 164 | + // ///去掉 Android 上默认的边缘拖拽效果 | |
| 165 | + // behavior: ScrollConfiguration.of(context) | |
| 166 | + // .copyWith(overscroll: false), | |
| 167 | + // child: _itemTransCard( | |
| 168 | + // bloc.getCourseUnitDetail(pageIndex: index), | |
| 169 | + // index, | |
| 170 | + // context), | |
| 171 | + // ); | |
| 172 | + return _itemTransCard( | |
| 173 | + bloc.getCourseUnitDetail(pageIndex: index), | |
| 174 | + index, | |
| 175 | + context); | |
| 176 | + }), | |
| 177 | + // ), // 设置外部padding, | |
| 178 | + ) | |
| 179 | + ) | |
| 180 | + ), | |
| 177 | 181 | SafeArea( |
| 178 | 182 | child: Padding( |
| 179 | 183 | padding: EdgeInsets.symmetric(horizontal: 13.w), |
| ... | ... | @@ -248,54 +252,62 @@ Widget _itemTransCard( |
| 248 | 252 | ), |
| 249 | 253 | ); |
| 250 | 254 | } else { |
| 251 | - return NestedListView.builder( | |
| 252 | - itemCount: bloc.courseSectionDatasMap[courseUnitDetail.id]?.length ?? 0, | |
| 253 | - scrollDirection: Axis.horizontal, | |
| 254 | - itemBuilder: (BuildContext context, int index) { | |
| 255 | - CourseSectionEntity sectionData = courseSectionEntities[index]; | |
| 256 | - if (sectionData.courseType == SectionType.bouns.value) { | |
| 257 | - //彩蛋 | |
| 258 | - return GestureDetector( | |
| 259 | - onTap: () { | |
| 260 | - if (!UserUtil.isLogined()) { | |
| 261 | - pushNamed(AppRouteName.login); | |
| 262 | - return; | |
| 263 | - } | |
| 264 | - if (sectionData.lock == true) { | |
| 265 | - showToast('当前课程暂未解锁'); | |
| 266 | - return; | |
| 267 | - } | |
| 255 | + return | |
| 256 | + Padding(padding: EdgeInsets.symmetric( | |
| 257 | + vertical: 28.h), | |
| 258 | + child: Container( | |
| 259 | + color: Colors.red, | |
| 260 | + margin: EdgeInsets.symmetric(vertical: 10.h), | |
| 261 | + child: NestedListView.builder( | |
| 262 | + itemCount: bloc.courseSectionDatasMap[courseUnitDetail.id]?.length ?? 0, | |
| 263 | + scrollDirection: Axis.horizontal, | |
| 264 | + itemBuilder: (BuildContext context, int index) { | |
| 265 | + CourseSectionEntity sectionData = courseSectionEntities[index]; | |
| 266 | + if (sectionData.courseType == SectionType.bouns.value) { | |
| 267 | + //彩蛋 | |
| 268 | + return GestureDetector( | |
| 269 | + onTap: () { | |
| 270 | + if (!UserUtil.isLogined()) { | |
| 271 | + pushNamed(AppRouteName.login); | |
| 272 | + return; | |
| 273 | + } | |
| 274 | + if (sectionData.lock == true) { | |
| 275 | + showToast('当前课程暂未解锁'); | |
| 276 | + return; | |
| 277 | + } | |
| 268 | 278 | |
| 269 | - ///进入课堂 | |
| 270 | - bloc.add(RequestEnterClassEvent( | |
| 271 | - sectionData.id.toString(), sectionData.courseType)); | |
| 272 | - }, | |
| 273 | - child: SectionBoundsItem( | |
| 274 | - imageUrl: sectionData.coverUrl, | |
| 275 | - ), | |
| 276 | - ); | |
| 277 | - } else { | |
| 278 | - return GestureDetector( | |
| 279 | - onTap: () { | |
| 280 | - if (!UserUtil.isLogined()) { | |
| 281 | - pushNamed(AppRouteName.login); | |
| 282 | - return; | |
| 283 | - } | |
| 284 | - if (sectionData.lock == true) { | |
| 285 | - showToast('当前课程暂未解锁'); | |
| 286 | - return; | |
| 287 | - } | |
| 279 | + ///进入课堂 | |
| 280 | + bloc.add(RequestEnterClassEvent( | |
| 281 | + sectionData.id.toString(), sectionData.courseType)); | |
| 282 | + }, | |
| 283 | + child: SectionBoundsItem( | |
| 284 | + imageUrl: sectionData.coverUrl, | |
| 285 | + ), | |
| 286 | + ); | |
| 287 | + } else { | |
| 288 | + return GestureDetector( | |
| 289 | + onTap: () { | |
| 290 | + if (!UserUtil.isLogined()) { | |
| 291 | + pushNamed(AppRouteName.login); | |
| 292 | + return; | |
| 293 | + } | |
| 294 | + if (sectionData.lock == true) { | |
| 295 | + showToast('当前课程暂未解锁'); | |
| 296 | + return; | |
| 297 | + } | |
| 288 | 298 | |
| 289 | - ///进入课堂 | |
| 290 | - bloc.add(RequestEnterClassEvent( | |
| 291 | - sectionData.id.toString(), sectionData.courseType)); | |
| 292 | - }, | |
| 293 | - child: SectionItem( | |
| 294 | - courseModuleId: bloc.courseUnitEntity.courseModuleCode, | |
| 295 | - lessons: sectionData, | |
| 296 | - ), | |
| 297 | - ); | |
| 298 | - } | |
| 299 | - }); | |
| 299 | + ///进入课堂 | |
| 300 | + bloc.add(RequestEnterClassEvent( | |
| 301 | + sectionData.id.toString(), sectionData.courseType)); | |
| 302 | + }, | |
| 303 | + child: SectionItem( | |
| 304 | + courseModuleId: bloc.courseUnitEntity.courseModuleCode, | |
| 305 | + lessons: sectionData, | |
| 306 | + ), | |
| 307 | + ); | |
| 308 | + } | |
| 309 | + }), | |
| 310 | + ), | |
| 311 | + ); | |
| 300 | 312 | } |
| 301 | 313 | } | ... | ... |