842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
1
2
3
|
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
997ea0d6
liangchengyou
feat:绘本闪退问题修复
|
4
|
import 'package:wow_english/common/core/app_consts.dart';
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
5
|
import 'package:wow_english/common/core/user_util.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
6
7
|
import 'package:wow_english/common/extension/string_extension.dart';
import 'package:wow_english/common/widgets/ow_image_widget.dart';
|
2eb67dd4
liangchengyou
feat:调整代码
|
8
|
import 'package:wow_english/models/course_process_entity.dart';
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
9
|
import 'package:wow_english/route/route.dart';
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
10
|
import 'package:wow_english/utils/toast_util.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
11
12
13
14
|
import 'bloc/topic_picture_bloc.dart';
import 'widgets/practice_header_widget.dart';
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
15
|
class TopicPicturePage extends StatelessWidget {
|
608c05b4
liangchengyou
feat:兑换课程
|
16
17
18
|
const TopicPicturePage({super.key, this.courseLessonId});
final String? courseLessonId;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
19
20
21
22
|
@override
Widget build(BuildContext context) {
return BlocProvider(
|
2eb67dd4
liangchengyou
feat:调整代码
|
23
|
create: (context) => TopicPictureBloc(
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
24
25
|
PageController(),
courseLessonId??'',
|
2eb67dd4
liangchengyou
feat:调整代码
|
26
|
)
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
27
|
..add(InitBlocEvent())
|
2eb67dd4
liangchengyou
feat:调整代码
|
28
|
..add(RequestDataEvent())
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
29
30
|
..add(XSVoiceInitEvent(
{
|
997ea0d6
liangchengyou
feat:绘本闪退问题修复
|
31
32
33
|
'appKey':AppConsts.xsAppKey,
'service':AppConsts.xsAppService,
'secretKey':AppConsts.xsAppSecretKey,
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
34
35
|
}
)),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
36
37
38
39
40
41
42
43
44
|
child: _TopicPicturePage(),
);
}
}
class _TopicPicturePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocListener<TopicPictureBloc,TopicPictureState>(
|
2eb67dd4
liangchengyou
feat:调整代码
|
45
46
|
listener: (context, state){
if (state is RequestDataState) {
|
608c05b4
liangchengyou
feat:兑换课程
|
47
|
context.read<TopicPictureBloc>().add(CurrentPageIndexChangeEvent(0));
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
48
|
}
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
49
50
|
if (state is XSVoiceTestState) {
|
2eb67dd4
liangchengyou
feat:调整代码
|
51
52
|
}
},
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
53
54
55
56
57
|
child: _topicPictureView(),
);
}
Widget _topicPictureView() => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
58
59
60
61
62
63
64
65
66
|
builder: (context,state){
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return Container(
color: Colors.white,
child: Stack(
children: [
Column(
children: [
PracticeHeaderWidget(
|
2eb67dd4
liangchengyou
feat:调整代码
|
67
|
title: '${bloc.currentPage}/${bloc.entity?.topics?.length}',
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
68
|
onTap: () {
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
69
70
71
|
popPage(
data:{
'currentStep':bloc.currentPage.toString(),
|
56e2ae5a
liangchengyou
feat:绘本添加回调数据
|
72
|
'courseLessonId':bloc.courseLessonId
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
73
74
|
});
// Navigator.pop(context);
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
75
|
},
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
76
77
78
|
),
Expanded(
child: PageView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
79
|
itemCount: bloc.entity?.topics?.length,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
80
81
82
83
84
85
|
scrollDirection: Axis.horizontal,
controller: bloc.pageController,
onPageChanged: (int index) {
bloc.add(CurrentPageIndexChangeEvent(index));
},
itemBuilder: (BuildContext context,int index){
|
2eb67dd4
liangchengyou
feat:调整代码
|
86
87
88
89
90
91
92
93
94
95
96
|
CourseProcessTopics? topics = bloc.entity?.topics![index];
if (topics?.type == 1) {//听音选图
return _pageViewVoicePictureItemWidget(topics);
} else if (topics?.type == 2) {//听音选字
return _pageViewVoiceWordItemWidget(topics);
} else if (topics?.type == 3) {//看题选字
return _pageViewWordItemWidget(topics);
} else if (topics?.type == 4) {//看题选图
return _pageViewItemWidget(topics);
} else {//语音问答
return _voiceAnswerItem(topics);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
}
}),
)
],
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Image.asset('bottom_grass'.assetPng)
)
],
),
);
});
///看题选图
|
2eb67dd4
liangchengyou
feat:调整代码
|
114
|
Widget _pageViewItemWidget(CourseProcessTopics? topics) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
115
|
builder: (context, state){
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
116
117
118
119
|
return SafeArea(
child: Column(
children: [
Text(
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
120
|
topics?.word??'',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
121
122
123
124
125
126
127
|
softWrap: true,
style: TextStyle(
fontSize: 21.sp,
color: const Color(0xFF333333)
)
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
128
129
130
131
|
SizedBox(
height: 143.h,
width: 143.w * (topics?.topicAnswerList?.length??0),
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
132
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
133
134
|
physics: const NeverScrollableScrollPhysics(),
itemCount: topics?.topicAnswerList?.length??0,
|
2eb67dd4
liangchengyou
feat:调整代码
|
135
|
itemBuilder: (context,index){
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
136
|
return _decodeImageWidget(index,topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
137
138
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
139
140
141
142
143
|
],
),
);
});
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
144
|
Widget _decodeImageWidget(int index,CourseProcessTopicsTopicAnswerList? answerLis) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
145
146
147
|
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context,state){
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
2eb67dd4
liangchengyou
feat:调整代码
|
148
149
150
151
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
152
|
child: Container(
|
2eb67dd4
liangchengyou
feat:调整代码
|
153
|
padding: const EdgeInsets.all(4.5),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
154
|
decoration: BoxDecoration(
|
2eb67dd4
liangchengyou
feat:调整代码
|
155
156
157
158
159
160
161
162
163
164
165
166
167
|
color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white,
borderRadius: BorderRadius.circular(15),
),
height: 143.h,
width: 143.w,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1.0,
color: const Color(0xFF140C10)
),
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
168
|
image: DecorationImage(
|
2eb67dd4
liangchengyou
feat:调整代码
|
169
|
fit: BoxFit.fitWidth,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
170
|
image: NetworkImage(answerLis?.picUrl??'')
|
2eb67dd4
liangchengyou
feat:调整代码
|
171
172
|
)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
173
174
175
176
177
178
179
|
),
),
),
);
});
///看题选字
|
2eb67dd4
liangchengyou
feat:调整代码
|
180
|
Widget _pageViewWordItemWidget(CourseProcessTopics? topics) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
181
|
builder: (context, state){
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
182
183
184
185
|
return SafeArea(
child: Column(
children: [
Text(
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
186
|
topics?.word??'',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
187
188
189
190
191
192
193
|
softWrap: true,
style: TextStyle(
fontSize: 21.sp,
color: const Color(0xFF333333)
)
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
194
195
196
197
|
SizedBox(
height: 143.h,
width: 143.w * (topics?.topicAnswerList?.length??0),
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
198
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
199
200
|
itemCount: topics?.topicAnswerList?.length??0,
physics: const NeverScrollableScrollPhysics(),
|
2eb67dd4
liangchengyou
feat:调整代码
|
201
|
itemBuilder: (context,index){
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
202
|
return _decodeWordWidget(index,topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
203
204
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
205
206
207
208
209
|
],
),
);
});
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
210
|
Widget _decodeWordWidget(int index,CourseProcessTopicsTopicAnswerList? answerLis) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
211
212
213
|
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context,state){
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
2eb67dd4
liangchengyou
feat:调整代码
|
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
child: Container(
width: 143.w,
height: 143.h,
padding: EdgeInsets.only(left: 13.w,right: 13.w,top: 13.h,bottom: 13.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1.0,
color: const Color(0xFF140C10)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
229
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
230
231
232
233
234
235
236
|
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: Text(
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
237
|
answerLis?.word??'',
|
2eb67dd4
liangchengyou
feat:调整代码
|
238
239
240
241
242
|
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333)
)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
243
244
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
245
246
247
248
249
250
251
252
253
254
|
Container(
height: 30.h,
width: double.infinity,
decoration: BoxDecoration(
color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white,
borderRadius: BorderRadius.circular(15.r),
border: Border.all(
width: 1.5,
color: const Color(0xFF140C10)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
255
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
256
257
258
259
260
|
alignment: Alignment.center,
child: Image.asset('choose'.assetPng),
)
],
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
261
262
263
264
265
266
|
),
),
);
});
///听音选图
|
2eb67dd4
liangchengyou
feat:调整代码
|
267
|
Widget _pageViewVoicePictureItemWidget(CourseProcessTopics? topics) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
268
|
builder: (context, state){
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
269
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
270
271
272
273
274
275
|
return SafeArea(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
276
277
278
279
280
281
282
283
284
285
|
GestureDetector(
onTap: () {
bloc.add(VoicePlayEvent());
},
child: Image.asset(
bloc.voicePlayState == VoicePlayState.playing?'reade_answer'.assetGif:'voice'.assetPng,
height: 33.h,
width: 30.w,
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
286
287
|
10.horizontalSpace,
Text(
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
288
|
topics?.word??'',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
289
290
291
292
293
294
295
296
|
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333)
)
)
],
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
297
298
299
300
301
|
SizedBox(
height: 143.h,
width: 163.w * (topics?.topicAnswerList?.length??0),
child: ListView.builder(
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
302
|
physics: const NeverScrollableScrollPhysics(),
|
2eb67dd4
liangchengyou
feat:调整代码
|
303
304
|
itemCount: topics?.topicAnswerList?.length??0,
itemBuilder: (BuildContext context,int index){
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
305
|
return _decodeVoiceImageWidget(index,topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
306
307
|
})
,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
308
309
310
311
312
313
|
)
],
),
);
});
|
2eb67dd4
liangchengyou
feat:调整代码
|
314
|
Widget _decodeVoiceImageWidget(int index,CourseProcessTopicsTopicAnswerList? answerList) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
315
316
317
|
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context,state){
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
2eb67dd4
liangchengyou
feat:调整代码
|
318
319
320
321
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
322
|
child: Container(
|
2eb67dd4
liangchengyou
feat:调整代码
|
323
|
padding: const EdgeInsets.all(4.5),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
324
|
decoration: BoxDecoration(
|
2eb67dd4
liangchengyou
feat:调整代码
|
325
326
327
328
329
330
331
332
333
334
335
336
337
|
color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white,
borderRadius: BorderRadius.circular(15),
),
height: 143.h,
width: 143.w,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1.0,
color: const Color(0xFF140C10)
),
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
338
|
image: DecorationImage(
|
2eb67dd4
liangchengyou
feat:调整代码
|
339
|
fit: BoxFit.fitWidth,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
340
|
image: NetworkImage(answerList?.picUrl??'')
|
2eb67dd4
liangchengyou
feat:调整代码
|
341
342
|
)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
343
344
345
346
347
348
349
|
),
),
),
);
});
///听音选字
|
2eb67dd4
liangchengyou
feat:调整代码
|
350
|
Widget _pageViewVoiceWordItemWidget(CourseProcessTopics? topics) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
351
|
builder: (context, state){
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
352
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
353
354
355
|
return SafeArea(
child: Column(
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
356
357
358
359
360
361
362
363
364
365
|
GestureDetector(
onTap: () {
bloc.add(VoicePlayEvent());
},
child: Image.asset(
bloc.voicePlayState == VoicePlayState.playing?'reade_answer'.assetGif:'voice'.assetPng,
height: 33.h,
width: 30.w
)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
366
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
367
368
369
370
|
SizedBox(
width: 163.w * (topics?.topicAnswerList?.length??0),
height: 143.h,
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
371
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
372
373
|
itemCount: topics?.topicAnswerList?.length,
physics: const NeverScrollableScrollPhysics(),
|
2eb67dd4
liangchengyou
feat:调整代码
|
374
375
376
377
|
itemBuilder: (BuildContext context,int index){
return _decodeVoiceWordImageWidget(index, topics!.topicAnswerList![index]);
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
378
379
380
381
382
|
],
),
);
});
|
2eb67dd4
liangchengyou
feat:调整代码
|
383
|
Widget _decodeVoiceWordImageWidget(int index,CourseProcessTopicsTopicAnswerList answerList) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
384
385
386
387
388
389
|
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context,state){
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
child: Container(
|
2eb67dd4
liangchengyou
feat:调整代码
|
390
|
width: 163.w,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
391
|
height: 143.h,
|
2eb67dd4
liangchengyou
feat:调整代码
|
392
393
394
395
396
397
398
399
400
401
402
403
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Container(
width: 143.w,
height: 143.h,
padding: EdgeInsets.only(left: 13.w,right: 13.w,top: 13.h,bottom: 13.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1.0,
color: const Color(0xFF140C10)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
404
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
405
406
407
408
409
410
411
412
413
414
415
416
417
|
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
child: Text(
answerList.word??'',
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333)
)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
418
419
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
420
421
422
423
424
425
426
427
428
429
|
Container(
height: 30.h,
width: double.infinity,
decoration: BoxDecoration(
color: bloc.selectItem == index?const Color(0xFF00B6F1):Colors.white,
borderRadius: BorderRadius.circular(15.r),
border: Border.all(
width: 1.5,
color: const Color(0xFF140C10)
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
430
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
431
432
433
434
435
|
alignment: Alignment.center,
child: Image.asset('choose'.assetPng),
)
],
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
436
437
438
439
440
441
|
),
),
);
});
///语音问答
|
2eb67dd4
liangchengyou
feat:调整代码
|
442
|
Widget _voiceAnswerItem(CourseProcessTopics? topics) => BlocBuilder<TopicPictureBloc,TopicPictureState>(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
443
|
builder: (context, state) {
|
2eb67dd4
liangchengyou
feat:调整代码
|
444
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
445
|
return Row(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
446
447
|
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
2eb67dd4
liangchengyou
feat:调整代码
|
448
|
OwImageWidget(
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
449
|
name:topics?.picUrl??'',
|
2eb67dd4
liangchengyou
feat:调整代码
|
450
451
|
height: 186.h,
width: 186.w,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
452
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
453
454
455
456
|
160.horizontalSpace,
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
GestureDetector(
onTap: () {
if (bloc.isVoicing) {
showToast('正在录音,不能终止');
return;
}
bloc.add(VoicePlayEvent());
},
child: Row(
children: [
Image.asset(
bloc.voicePlayState == VoicePlayState.playing?'reade_answer'.assetGif:'voice'.assetPng,
height: 52.h,
width: 46.w,
),
10.horizontalSpace,
Text(topics?.word??'')
],
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
476
477
478
479
|
),
70.verticalSpace,
GestureDetector(
onTap: () {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
480
481
482
483
484
|
if (bloc.voicePlayState == VoicePlayState.playing) {
showToast('正在播放音屏,不能终止');
return;
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
485
486
487
|
if (bloc.isVoicing) {
return;
}
|
ceacd07e
liangchengyou
feat:评测失败问题修复
|
488
|
if (topics?.type == 5) {
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
489
490
491
492
|
bloc.add(XSVoiceTestEvent(topics?.keyWord??'', '0',UserUtil.getUser()!.id.toString()));
} else {
bloc.add(XSVoiceTestEvent(topics?.word??'', '0',UserUtil.getUser()!.id.toString()));
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
493
494
|
},
child: Image.asset(
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
495
|
bloc.isVoicing?'micro_phone'.assetGif:'micro_phone'.assetPng,
|
2eb67dd4
liangchengyou
feat:调整代码
|
496
497
498
499
500
|
height: 75.w,
width: 75.w,
),
)
],
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
501
502
|
)
],
|
2eb67dd4
liangchengyou
feat:调整代码
|
503
504
|
);
});
|
da82bd70
Key
feat: user_inform...
|
505
|
}
|