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