Commit 56e2ae5a43dab61bd7fd1bfc8d82e126c1b72fdf
1 parent
934e2b47
feat:绘本添加回调数据
Showing
3 changed files
with
24 additions
and
20 deletions
lib/common/request/token_interceptor.dart
1 | import 'package:dio/dio.dart'; | 1 | import 'package:dio/dio.dart'; |
2 | -import 'package:package_info_plus/package_info_plus.dart'; | ||
3 | import 'package:wow_english/common/core/user_util.dart'; | 2 | import 'package:wow_english/common/core/user_util.dart'; |
4 | -import 'package:wow_english/common/request/basic_config.dart'; | ||
5 | 3 | ||
6 | class TokenInterceptor extends Interceptor { | 4 | class TokenInterceptor extends Interceptor { |
7 | @override | 5 | @override |
lib/pages/practice/topic_picture_page.dart
@@ -70,7 +70,7 @@ class _TopicPicturePage extends StatelessWidget { | @@ -70,7 +70,7 @@ class _TopicPicturePage extends StatelessWidget { | ||
70 | popPage( | 70 | popPage( |
71 | data:{ | 71 | data:{ |
72 | 'currentStep':bloc.currentPage.toString(), | 72 | 'currentStep':bloc.currentPage.toString(), |
73 | - 'courseLessonId':(int.parse(bloc.courseLessonId)+1).toString() | 73 | + 'courseLessonId':bloc.courseLessonId |
74 | }); | 74 | }); |
75 | // Navigator.pop(context); | 75 | // Navigator.pop(context); |
76 | }, | 76 | }, |
lib/pages/reading/reading_page.dart
@@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
4 | import 'package:wow_english/common/extension/string_extension.dart'; | 4 | import 'package:wow_english/common/extension/string_extension.dart'; |
5 | import 'package:wow_english/pages/reading/widgets/ReadingModeType.dart'; | 5 | import 'package:wow_english/pages/reading/widgets/ReadingModeType.dart'; |
6 | import 'package:wow_english/pages/reading/widgets/reading_dialog_widget.dart'; | 6 | import 'package:wow_english/pages/reading/widgets/reading_dialog_widget.dart'; |
7 | +import 'package:wow_english/route/route.dart'; | ||
7 | 8 | ||
8 | import '../../common/core/app_consts.dart'; | 9 | import '../../common/core/app_consts.dart'; |
9 | import '../../common/core/user_util.dart'; | 10 | import '../../common/core/user_util.dart'; |
@@ -23,12 +24,12 @@ class ReadingPage extends StatelessWidget { | @@ -23,12 +24,12 @@ class ReadingPage extends StatelessWidget { | ||
23 | ..add(InitBlocEvent()) | 24 | ..add(InitBlocEvent()) |
24 | ..add(RequestDataEvent()) | 25 | ..add(RequestDataEvent()) |
25 | ..add(XSVoiceInitEvent( | 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 | child: _ReadingPage(), | 34 | child: _ReadingPage(), |
34 | ); | 35 | ); |
@@ -59,7 +60,7 @@ class _ReadingPage extends StatelessWidget { | @@ -59,7 +60,7 @@ class _ReadingPage extends StatelessWidget { | ||
59 | } | 60 | } |
60 | 61 | ||
61 | Widget _readingPageView() => BlocBuilder<ReadingPageBloc, ReadingPageState>( | 62 | Widget _readingPageView() => BlocBuilder<ReadingPageBloc, ReadingPageState>( |
62 | - builder: (context, state) { | 63 | + builder: (context, state) { |
63 | final bloc = BlocProvider.of<ReadingPageBloc>(context); | 64 | final bloc = BlocProvider.of<ReadingPageBloc>(context); |
64 | return Container( | 65 | return Container( |
65 | color: Colors.white, | 66 | color: Colors.white, |
@@ -82,10 +83,15 @@ class _ReadingPage extends StatelessWidget { | @@ -82,10 +83,15 @@ class _ReadingPage extends StatelessWidget { | ||
82 | children: [ | 83 | children: [ |
83 | Padding( | 84 | Padding( |
84 | padding: | 85 | padding: |
85 | - EdgeInsets.only(left: ScreenUtil().bottomBarHeight), | 86 | + EdgeInsets.only(left: ScreenUtil().bottomBarHeight), |
86 | child: IconButton( | 87 | child: IconButton( |
87 | onPressed: () { | 88 | onPressed: () { |
88 | - Navigator.pop(context); | 89 | + popPage( |
90 | + data:{ | ||
91 | + 'currentStep':bloc.currentPage.toString(), | ||
92 | + 'courseLessonId':bloc.courseLessonId | ||
93 | + } | ||
94 | + ); | ||
89 | }, | 95 | }, |
90 | icon: Image.asset( | 96 | icon: Image.asset( |
91 | 'back_around'.assetPng, | 97 | 'back_around'.assetPng, |
@@ -159,7 +165,7 @@ class _ReadingPage extends StatelessWidget { | @@ -159,7 +165,7 @@ class _ReadingPage extends StatelessWidget { | ||
159 | }, | 165 | }, |
160 | child: Image.asset( | 166 | child: Image.asset( |
161 | bloc.voicePlayState == VoicePlayState.playing && | 167 | bloc.voicePlayState == VoicePlayState.playing && |
162 | - bloc.isOriginAudioPlaying | 168 | + bloc.isOriginAudioPlaying |
163 | ? 'reade_answer'.assetGif | 169 | ? 'reade_answer'.assetGif |
164 | : 'voice'.assetPng, | 170 | : 'voice'.assetPng, |
165 | height: 40.h, | 171 | height: 40.h, |
@@ -171,12 +177,12 @@ class _ReadingPage extends StatelessWidget { | @@ -171,12 +177,12 @@ class _ReadingPage extends StatelessWidget { | ||
171 | ), | 177 | ), |
172 | Expanded( | 178 | Expanded( |
173 | child: Text( | 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 | SizedBox( | 186 | SizedBox( |
181 | width: 10.w, | 187 | width: 10.w, |
182 | ), | 188 | ), |
@@ -233,7 +239,7 @@ class _ReadingPage extends StatelessWidget { | @@ -233,7 +239,7 @@ class _ReadingPage extends StatelessWidget { | ||
233 | children: [ | 239 | children: [ |
234 | Positioned.fill( | 240 | Positioned.fill( |
235 | child: | 241 | child: |
236 | - Image.network(readings.picUrl ?? '', fit: BoxFit.cover), | 242 | + Image.network(readings.picUrl ?? '', fit: BoxFit.cover), |
237 | ), | 243 | ), |
238 | ], | 244 | ], |
239 | ); | 245 | ); |