Commit 56e2ae5a43dab61bd7fd1bfc8d82e126c1b72fdf

Authored by liangchengyou
1 parent 934e2b47

feat:绘本添加回调数据

lib/common/request/token_interceptor.dart
1 1 import 'package:dio/dio.dart';
2   -import 'package:package_info_plus/package_info_plus.dart';
3 2 import 'package:wow_english/common/core/user_util.dart';
4   -import 'package:wow_english/common/request/basic_config.dart';
5 3  
6 4 class TokenInterceptor extends Interceptor {
7 5 @override
... ...
lib/pages/practice/topic_picture_page.dart
... ... @@ -70,7 +70,7 @@ class _TopicPicturePage extends StatelessWidget {
70 70 popPage(
71 71 data:{
72 72 'currentStep':bloc.currentPage.toString(),
73   - 'courseLessonId':(int.parse(bloc.courseLessonId)+1).toString()
  73 + 'courseLessonId':bloc.courseLessonId
74 74 });
75 75 // Navigator.pop(context);
76 76 },
... ...
lib/pages/reading/reading_page.dart
... ... @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
4 4 import 'package:wow_english/common/extension/string_extension.dart';
5 5 import 'package:wow_english/pages/reading/widgets/ReadingModeType.dart';
6 6 import 'package:wow_english/pages/reading/widgets/reading_dialog_widget.dart';
  7 +import 'package:wow_english/route/route.dart';
7 8  
8 9 import '../../common/core/app_consts.dart';
9 10 import '../../common/core/user_util.dart';
... ... @@ -23,12 +24,12 @@ class ReadingPage extends StatelessWidget {
23 24 ..add(InitBlocEvent())
24 25 ..add(RequestDataEvent())
25 26 ..add(XSVoiceInitEvent(
26   - {
27   - 'appKey':AppConsts.xsAppKey,
28   - 'service':AppConsts.xsAppService,
29   - 'secretKey':AppConsts.xsAppSecretKey,
30   - 'userId':UserUtil.getUser()!.id.toString(),
31   - }
  27 + {
  28 + 'appKey':AppConsts.xsAppKey,
  29 + 'service':AppConsts.xsAppService,
  30 + 'secretKey':AppConsts.xsAppSecretKey,
  31 + 'userId':UserUtil.getUser()!.id.toString(),
  32 + }
32 33 )),
33 34 child: _ReadingPage(),
34 35 );
... ... @@ -59,7 +60,7 @@ class _ReadingPage extends StatelessWidget {
59 60 }
60 61  
61 62 Widget _readingPageView() => BlocBuilder<ReadingPageBloc, ReadingPageState>(
62   - builder: (context, state) {
  63 + builder: (context, state) {
63 64 final bloc = BlocProvider.of<ReadingPageBloc>(context);
64 65 return Container(
65 66 color: Colors.white,
... ... @@ -82,10 +83,15 @@ class _ReadingPage extends StatelessWidget {
82 83 children: [
83 84 Padding(
84 85 padding:
85   - EdgeInsets.only(left: ScreenUtil().bottomBarHeight),
  86 + EdgeInsets.only(left: ScreenUtil().bottomBarHeight),
86 87 child: IconButton(
87 88 onPressed: () {
88   - Navigator.pop(context);
  89 + popPage(
  90 + data:{
  91 + 'currentStep':bloc.currentPage.toString(),
  92 + 'courseLessonId':bloc.courseLessonId
  93 + }
  94 + );
89 95 },
90 96 icon: Image.asset(
91 97 'back_around'.assetPng,
... ... @@ -159,7 +165,7 @@ class _ReadingPage extends StatelessWidget {
159 165 },
160 166 child: Image.asset(
161 167 bloc.voicePlayState == VoicePlayState.playing &&
162   - bloc.isOriginAudioPlaying
  168 + bloc.isOriginAudioPlaying
163 169 ? 'reade_answer'.assetGif
164 170 : 'voice'.assetPng,
165 171 height: 40.h,
... ... @@ -171,12 +177,12 @@ class _ReadingPage extends StatelessWidget {
171 177 ),
172 178 Expanded(
173 179 child: Text(
174   - bloc.currentPageData()?.word ?? '',
175   - style: TextStyle(
176   - color: const Color(0xFF333333), fontSize: 21.sp),
177   - maxLines: 2,
178   - overflow: TextOverflow.ellipsis,
179   - )),
  180 + bloc.currentPageData()?.word ?? '',
  181 + style: TextStyle(
  182 + color: const Color(0xFF333333), fontSize: 21.sp),
  183 + maxLines: 2,
  184 + overflow: TextOverflow.ellipsis,
  185 + )),
180 186 SizedBox(
181 187 width: 10.w,
182 188 ),
... ... @@ -233,7 +239,7 @@ class _ReadingPage extends StatelessWidget {
233 239 children: [
234 240 Positioned.fill(
235 241 child:
236   - Image.network(readings.picUrl ?? '', fit: BoxFit.cover),
  242 + Image.network(readings.picUrl ?? '', fit: BoxFit.cover),
237 243 ),
238 244 ],
239 245 );
... ...