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