Commit 4d8b0da4cba692c0d4f6b474ac1004d21b0433b5
1 parent
0e314ad5
feat:绘本跟读底部ui优化
Showing
2 changed files
with
9 additions
and
5 deletions
lib/pages/reading/bloc/reading_bloc.dart
| @@ -19,7 +19,6 @@ import '../../../route/route.dart'; | @@ -19,7 +19,6 @@ import '../../../route/route.dart'; | ||
| 19 | import '../../../utils/loading.dart'; | 19 | import '../../../utils/loading.dart'; |
| 20 | 20 | ||
| 21 | import '../../../utils/log_util.dart'; | 21 | import '../../../utils/log_util.dart'; |
| 22 | -import '../../../common/permission/permissionRequestPage.dart'; | ||
| 23 | 22 | ||
| 24 | part 'reading_event.dart'; | 23 | part 'reading_event.dart'; |
| 25 | part 'reading_state.dart'; | 24 | part 'reading_state.dart'; |
| @@ -299,6 +298,11 @@ class ReadingPageBloc | @@ -299,6 +298,11 @@ class ReadingPageBloc | ||
| 299 | return _entity?.readings?[_currentPage]; | 298 | return _entity?.readings?[_currentPage]; |
| 300 | } | 299 | } |
| 301 | 300 | ||
| 301 | + ///当前页绘本跟读内容 | ||
| 302 | + String readingContent() { | ||
| 303 | + return currentPageData()?.word?.trim() ?? ''; | ||
| 304 | + } | ||
| 305 | + | ||
| 302 | void nextPage() { | 306 | void nextPage() { |
| 303 | if (currentPage >= dataCount()) { | 307 | if (currentPage >= dataCount()) { |
| 304 | sectionComplete(() { | 308 | sectionComplete(() { |
lib/pages/reading/reading_page.dart
| @@ -13,6 +13,7 @@ import '../../models/course_process_entity.dart'; | @@ -13,6 +13,7 @@ import '../../models/course_process_entity.dart'; | ||
| 13 | import '../../utils/log_util.dart'; | 13 | import '../../utils/log_util.dart'; |
| 14 | import 'bloc/reading_bloc.dart'; | 14 | import 'bloc/reading_bloc.dart'; |
| 15 | 15 | ||
| 16 | +///绘本页 | ||
| 16 | class ReadingPage extends StatelessWidget { | 17 | class ReadingPage extends StatelessWidget { |
| 17 | const ReadingPage({super.key, this.courseLessonId}); | 18 | const ReadingPage({super.key, this.courseLessonId}); |
| 18 | 19 | ||
| @@ -151,8 +152,7 @@ class _ReadingPage extends StatelessWidget { | @@ -151,8 +152,7 @@ class _ReadingPage extends StatelessWidget { | ||
| 151 | Align( | 152 | Align( |
| 152 | alignment: Alignment.bottomLeft, | 153 | alignment: Alignment.bottomLeft, |
| 153 | child: Container( | 154 | child: Container( |
| 154 | - color: const Color(0x4DFFFFFF), | ||
| 155 | - margin: EdgeInsets.symmetric(horizontal: 10.w), | 155 | + color: const Color(0x80FFFFFF), |
| 156 | child: Row( | 156 | child: Row( |
| 157 | children: [ | 157 | children: [ |
| 158 | 5.horizontalSpace, | 158 | 5.horizontalSpace, |
| @@ -177,7 +177,7 @@ class _ReadingPage extends StatelessWidget { | @@ -177,7 +177,7 @@ class _ReadingPage extends StatelessWidget { | ||
| 177 | ), | 177 | ), |
| 178 | Expanded( | 178 | Expanded( |
| 179 | child: Text( | 179 | child: Text( |
| 180 | - bloc.currentPageData()?.word?.trim() ?? '', | 180 | + bloc.readingContent(), |
| 181 | style: TextStyle( | 181 | style: TextStyle( |
| 182 | color: const Color(0xFF333333), fontSize: 21.sp), | 182 | color: const Color(0xFF333333), fontSize: 21.sp), |
| 183 | maxLines: 2, | 183 | maxLines: 2, |
| @@ -193,7 +193,7 @@ class _ReadingPage extends StatelessWidget { | @@ -193,7 +193,7 @@ class _ReadingPage extends StatelessWidget { | ||
| 193 | bloc.add(XSVoiceStopEvent()); | 193 | bloc.add(XSVoiceStopEvent()); |
| 194 | } else { | 194 | } else { |
| 195 | bloc.add(XSVoiceStartEvent( | 195 | bloc.add(XSVoiceStartEvent( |
| 196 | - bloc.currentPageData()?.word ?? '', | 196 | + bloc.readingContent(), |
| 197 | '0', | 197 | '0', |
| 198 | UserUtil.getUser()?.id.toString())); | 198 | UserUtil.getUser()?.id.toString())); |
| 199 | } | 199 | } |