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';
|
22f36232
吴启风
feat:过渡页-练习环节
|
9
|
import 'package:wow_english/pages/practice/topic_type.dart';
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
10
|
import 'package:wow_english/route/route.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
11
|
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
12
|
import '../../common/widgets/option_widget.dart';
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
13
|
import '../../common/widgets/recorder_widget.dart';
|
56b412f5
吴启风
feat:扬声器播放动画组件封装
|
14
|
import '../../common/widgets/speaker_widget.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
15
16
17
|
import 'bloc/topic_picture_bloc.dart';
import 'widgets/practice_header_widget.dart';
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
18
|
class TopicPicturePage extends StatelessWidget {
|
07b173c9
吴启风
feat:练习页上方进度信息改成进...
|
19
|
const TopicPicturePage({super.key, this.courseLessonId, this.moduleColor});
|
608c05b4
liangchengyou
feat:兑换课程
|
20
21
|
final String? courseLessonId;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
22
|
|
07b173c9
吴启风
feat:练习页上方进度信息改成进...
|
23
24
|
final Color? moduleColor;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
25
26
27
|
@override
Widget build(BuildContext context) {
return BlocProvider(
|
2eb67dd4
liangchengyou
feat:调整代码
|
28
|
create: (context) => TopicPictureBloc(
|
07b173c9
吴启风
feat:练习页上方进度信息改成进...
|
29
|
context, PageController(), courseLessonId ?? '', moduleColor)
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
30
|
..add(InitBlocEvent())
|
2eb67dd4
liangchengyou
feat:调整代码
|
31
|
..add(RequestDataEvent())
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
32
33
34
35
36
37
|
..add(XSVoiceInitEvent({
'appKey': AppConsts.xsAppKey,
'service': AppConsts.xsAppService,
'secretKey': AppConsts.xsAppSecretKey,
'userId': UserUtil.getUser()!.id.toString(),
})),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
38
39
40
41
42
43
44
45
|
child: _TopicPicturePage(),
);
}
}
class _TopicPicturePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
46
47
|
return BlocListener<TopicPictureBloc, TopicPictureState>(
listener: (context, state) {
|
2eb67dd4
liangchengyou
feat:调整代码
|
48
|
if (state is RequestDataState) {
|
608c05b4
liangchengyou
feat:兑换课程
|
49
|
context.read<TopicPictureBloc>().add(CurrentPageIndexChangeEvent(0));
|
e3c2820c
liangchengyou
feat:先声SDK逻辑调整
|
50
|
}
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
51
|
if (state is XSVoiceTestState) {}
|
2eb67dd4
liangchengyou
feat:调整代码
|
52
|
},
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
53
54
55
56
|
child: _topicPictureView(),
);
}
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
57
58
59
|
Widget _topicPictureView() =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
60
61
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return Container(
|
82c8633c
biao
音频添加 页面优化
|
62
63
64
65
66
67
|
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('read_background'.assetPng), // 背景图片路径
fit: BoxFit.cover, // 适应图片的方式
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
68
69
70
71
72
|
child: Stack(
children: [
Column(
children: [
PracticeHeaderWidget(
|
07b173c9
吴启风
feat:练习页上方进度信息改成进...
|
73
74
75
|
color: bloc.moduleColor,
progress: bloc.currentPage,
total: bloc.entity?.topics?.length ?? 0,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
76
|
onTap: () {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
77
78
79
80
81
|
popPage(data: {
'currentStep': bloc.currentPage,
'courseLessonId': bloc.courseLessonId,
'isCompleted': bloc.isLastPage(),
});
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
82
|
// Navigator.pop(context);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
83
|
},
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
84
|
),
|
82c8633c
biao
音频添加 页面优化
|
85
|
35.verticalSpace,
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
bloc.entity != null
? Expanded(
child: PageView.builder(
itemCount: bloc.entity?.topics?.length,
scrollDirection: Axis.horizontal,
controller: bloc.pageController,
onPageChanged: (int index) {
bloc.add(CurrentPageIndexChangeEvent(index));
},
itemBuilder: (BuildContext context, int index) {
CourseProcessTopics? topics =
bloc.entity?.topics![index];
if (topics?.type ==
TopicType.audioImageSelect.value) {
//听音选图
return _pageViewVoicePictureItemWidget(
topics);
} else if (topics?.type ==
TopicType.audioCharSelect.value) {
//听音选字
return _pageViewVoiceWordItemWidget(topics);
} else if (topics?.type ==
TopicType.questionCharSelect.value) {
//看题选字
return _pageViewWordItemWidget(topics);
} else if (topics?.type ==
TopicType.questionImageSelect.value) {
//看题选图
return _pageViewItemWidget(topics);
} else {
//语音问答
return _voiceAnswerItem(topics);
}
}),
)
: Container(
color: Colors.transparent,
child: const CircularProgressIndicator(),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
125
|
],
|
82c8633c
biao
音频添加 页面优化
|
126
|
)
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
127
128
129
130
131
132
|
],
),
);
});
///看题选图
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
133
134
135
|
Widget _pageViewItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
136
137
138
|
return SafeArea(
child: Column(
children: [
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
139
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
140
141
|
softWrap: true,
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
142
|
fontSize: 21.sp, color: const Color(0xFF333333))),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
143
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
144
145
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
146
|
width: 143.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
147
|
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
148
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
149
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
150
151
152
153
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (context, index) {
return _decodeImageWidget(
index, topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
154
155
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
156
157
158
159
160
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
161
162
163
164
165
166
|
Widget _decodeImageWidget(
int index, CourseProcessTopicsTopicAnswerList? answerLis) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
167
|
final isAnswerOption = bloc.selectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
168
169
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
170
171
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
172
|
child: OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
173
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
174
175
176
177
178
179
180
181
182
183
184
|
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
child: Container(
padding: const EdgeInsets.all(4.5),
decoration: BoxDecoration(
color: isAnswerOption
? getResultColor(answerCorrect)
: Colors.white,
borderRadius: BorderRadius.circular(15),
),
height: 143.h,
width: 143.w,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
185
|
child: Container(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
186
|
decoration: BoxDecoration(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
187
188
189
190
191
192
193
|
color: Colors.white,
borderRadius: BorderRadius.circular(15),
border: Border.all(
width: 1.0, color: const Color(0xFF140C10)),
image: DecorationImage(
fit: BoxFit.fitWidth,
image: NetworkImage(answerLis?.picUrl ?? ''))),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
194
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
195
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
196
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
197
198
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
199
200
|
///看题选字
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
201
202
203
|
Widget _pageViewWordItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
204
205
206
|
return SafeArea(
child: Column(
children: [
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
207
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
208
209
|
softWrap: true,
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
210
|
fontSize: 21.sp, color: const Color(0xFF333333))),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
211
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
212
213
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
214
|
width: 143.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
215
|
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
216
|
scrollDirection: Axis.horizontal,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
217
|
itemCount: topics?.topicAnswerList?.length ?? 0,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
218
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
219
220
221
|
itemBuilder: (context, index) {
return _decodeWordWidget(
index, topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
222
223
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
224
225
226
227
228
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
229
230
231
232
233
234
|
Widget _decodeWordWidget(
int index, CourseProcessTopicsTopicAnswerList? answerLis) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
235
|
final isAnswerOption = bloc.selectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
236
237
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
238
239
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
240
|
child: OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
241
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
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)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: Container(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
259
|
alignment: Alignment.center,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
child: Text(answerLis?.word ?? '',
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333))),
),
),
Container(
height: 30.h,
width: double.infinity,
decoration: BoxDecoration(
color: isAnswerOption
? getResultColor(answerCorrect)
: Colors.white,
borderRadius: BorderRadius.circular(15.r),
border: Border.all(
width: 1.5, color: const Color(0xFF140C10)),
),
alignment: Alignment.center,
child: Image.asset('choose'.assetPng),
)
],
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
281
282
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
283
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
284
285
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
286
287
|
///听音选图
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
288
289
290
|
Widget _pageViewVoicePictureItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
291
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
292
293
294
295
296
297
|
return SafeArea(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
b81332ca
吴启风
feat:喇叭组件替换
|
298
299
300
301
302
303
304
|
SpeakerWidget(
isPlaying: bloc.voicePlayState == VoicePlayState.playing,
// 控制动画播放
isClickable: true,
// 控制是否可点击
width: 32.w,
height: 32.w,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
305
306
307
|
onTap: () {
bloc.add(VoicePlayEvent());
},
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
308
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
309
|
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
310
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
311
|
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
312
|
fontSize: 20.sp, color: const Color(0xFF333333)))
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
313
314
315
|
],
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
316
317
|
SizedBox(
height: 143.h,
|
82c8633c
biao
音频添加 页面优化
|
318
|
width: 203.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
319
320
|
child: ListView.builder(
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
321
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
322
323
324
325
326
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceImageWidget(
index, topics?.topicAnswerList?[index]);
}),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
327
328
329
330
331
332
|
)
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
333
334
335
336
337
338
|
Widget _decodeVoiceImageWidget(
int index, CourseProcessTopicsTopicAnswerList? answerList) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
339
|
final isAnswerOption = bloc.selectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
340
341
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
342
343
344
|
return OptionWidget(
onTap: () => bloc.add(SelectItemEvent(index)),
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
345
346
|
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
347
348
349
350
351
352
353
354
355
356
|
child: Container(
padding: const EdgeInsets.all(4.5),
decoration: BoxDecoration(
color: isAnswerOption
? getResultColor(answerCorrect)
: Colors.white,
borderRadius: BorderRadius.circular(15),
),
height: 143.h,
width: 163.w,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
357
|
child: Container(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
358
|
decoration: BoxDecoration(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
359
360
361
362
363
|
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(answerList?.picUrl ?? ''))),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
364
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
365
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
366
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
367
368
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
369
370
|
///听音选字
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
371
372
373
|
Widget _pageViewVoiceWordItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
374
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
375
376
377
|
return SafeArea(
child: Column(
children: [
|
b81332ca
吴启风
feat:喇叭组件替换
|
378
379
380
381
382
383
384
385
386
387
388
|
SpeakerWidget(
isPlaying: bloc.voicePlayState == VoicePlayState.playing,
// 控制动画播放
isClickable: true,
// 控制是否可点击
width: 32.w,
height: 32.w,
onTap: () {
bloc.add(VoicePlayEvent());
},
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
389
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
390
|
SizedBox(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
391
|
width: 163.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
392
393
|
height: 143.h,
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
394
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
395
396
|
itemCount: topics?.topicAnswerList?.length,
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
397
398
399
|
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceWordImageWidget(
index, topics!.topicAnswerList![index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
400
401
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
402
403
404
405
406
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
407
408
409
410
411
412
|
Widget _decodeVoiceWordImageWidget(
int index, CourseProcessTopicsTopicAnswerList answerList) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
413
|
final isAnswerOption = bloc.selectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
414
415
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
416
|
return OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
417
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
418
419
420
421
422
|
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
child: Container(
width: 163.w,
height: 143.h,
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
423
|
child: Container(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
424
|
width: 143.w,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
425
|
height: 143.h,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
426
427
428
429
430
431
432
433
434
435
436
437
438
|
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)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
child: Container(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
439
|
alignment: Alignment.center,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
|
child: Text(answerList.word ?? '',
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333))),
),
),
Container(
height: 30.h,
width: double.infinity,
decoration: BoxDecoration(
color: isAnswerOption
? getResultColor(answerCorrect)
: Colors.white,
borderRadius: BorderRadius.circular(15.r),
border: Border.all(
width: 1.5, color: const Color(0xFF140C10)),
),
alignment: Alignment.center,
child: Image.asset('choose'.assetPng),
)
],
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
461
462
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
463
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
464
465
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
466
467
|
///语音问答
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
468
469
470
|
Widget _voiceAnswerItem(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
2eb67dd4
liangchengyou
feat:调整代码
|
471
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
472
|
return Row(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
473
474
|
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
82c8633c
biao
音频添加 页面优化
|
475
476
477
478
479
480
481
482
483
484
|
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
color: Colors.white,
child: OwImageWidget(
name: topics?.picUrl ?? '',
height: 186.h,
width: 186.w,
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
485
|
),
|
82c8633c
biao
音频添加 页面优化
|
486
|
120.horizontalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
487
488
489
|
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
Row(
children: [
SpeakerWidget(
isPlaying: bloc.voicePlayState == VoicePlayState.playing,
// 控制动画播放
isClickable: !bloc.isRecording,
// 控制是否可点击
width: 45.w,
height: 45.w,
onTap: () {
bloc.add(VoicePlayEvent());
},
),
10.horizontalSpace,
Text(topics?.word ?? '')
],
|
2eb67dd4
liangchengyou
feat:调整代码
|
506
507
|
),
70.verticalSpace,
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
508
509
510
511
512
|
RecorderWidget(
isPlaying: bloc.isRecording,
isClickable: bloc.voicePlayState != VoicePlayState.playing,
width: 72.w,
height: 72.w,
|
2eb67dd4
liangchengyou
feat:调整代码
|
513
|
onTap: () {
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
514
|
if (bloc.isRecording) {
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
515
|
bloc.add(XSVoiceStopEvent());
|
2eb67dd4
liangchengyou
feat:调整代码
|
516
517
|
return;
}
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
518
519
|
if (topics?.type == TopicType.voiceQuestion.value ||
topics?.type == TopicType.voiceWord.value) {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
520
521
|
bloc.add(XSVoiceStartEvent(topics?.keyWord ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
522
|
} else {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
523
524
|
bloc.add(XSVoiceStartEvent(topics?.word ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
525
|
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
526
|
},
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
527
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
528
|
],
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
529
530
|
)
],
|
2eb67dd4
liangchengyou
feat:调整代码
|
531
532
|
);
});
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
533
534
535
536
537
538
539
540
|
Color getResultColor(bool correct) {
if (correct) {
return const Color(0xFF19D717);
} else {
return const Color(0xFFFF463C);
}
}
|
da82bd70
Key
feat: user_inform...
|
541
|
}
|