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
|
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...
|
96
97
|
final bloc =
BlocProvider.of<TopicPictureBloc>(context);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
98
99
|
CourseProcessTopics? topics =
bloc.entity?.topics![index];
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
100
101
|
bool isCurrentPage =
index == bloc.currentPage - 1;
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
102
103
104
105
|
if (topics?.type ==
TopicType.audioImageSelect.value) {
//听音选图
return _pageViewVoicePictureItemWidget(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
106
|
topics, isCurrentPage);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
107
108
109
|
} else if (topics?.type ==
TopicType.audioCharSelect.value) {
//听音选字
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
110
111
|
return _pageViewVoiceWordItemWidget(
topics, isCurrentPage);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
112
113
114
|
} else if (topics?.type ==
TopicType.questionCharSelect.value) {
//看题选字
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
115
116
|
return _pageViewWordItemWidget(
topics, isCurrentPage);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
117
118
119
|
} else if (topics?.type ==
TopicType.questionImageSelect.value) {
//看题选图
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
120
121
|
return _pageViewItemWidget(
topics, isCurrentPage);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
122
123
|
} else {
//语音问答
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
124
125
|
return _voiceAnswerItem(
topics, isCurrentPage);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
126
127
128
129
130
131
132
|
}
}),
)
: Container(
color: Colors.transparent,
child: const CircularProgressIndicator(),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
133
|
],
|
82c8633c
biao
音频添加 页面优化
|
134
|
)
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
135
136
137
138
139
140
|
],
),
);
});
///看题选图
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
141
|
Widget _pageViewItemWidget(CourseProcessTopics? topics, bool isCurrentPage) =>
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
142
|
BlocBuilder<TopicPictureBloc, TopicPictureState>(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
143
|
buildWhen: (_, s) => isCurrentPage,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
144
|
builder: (context, state) {
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
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:调整代码
|
166
|
),
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
167
168
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
169
|
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
170
171
172
173
174
175
|
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:体验优化-练习题目取消阻...
|
176
|
final isAnswerOption = bloc.optionSelectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
177
178
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
179
180
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
181
|
child: OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
182
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
183
184
185
186
187
188
189
190
191
192
193
|
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偶现按钮消失问题,练习页...
|
194
|
child: Container(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
195
|
decoration: BoxDecoration(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
196
197
198
199
200
201
202
|
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偶现按钮消失问题,练习页...
|
203
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
204
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
205
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
206
207
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
208
209
|
///看题选字
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
210
211
|
Widget _pageViewWordItemWidget(
CourseProcessTopics? topics, bool isCurrentPage) =>
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
212
|
BlocBuilder<TopicPictureBloc, TopicPictureState>(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
213
|
buildWhen: (_, s) => isCurrentPage,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
214
|
builder: (context, state) {
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
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:调整代码
|
236
|
),
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
237
238
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
239
|
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
240
241
242
243
244
245
|
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:体验优化-练习题目取消阻...
|
246
|
final isAnswerOption = bloc.optionSelectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
247
248
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
249
250
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
251
|
child: OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
252
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
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:闯关交互优化-答错晃动、...
|
270
|
alignment: Alignment.center,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
|
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偶现按钮消失问题,练习页...
|
292
293
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
294
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
295
296
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
297
298
|
///听音选图
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
299
300
|
Widget _pageViewVoicePictureItemWidget(
CourseProcessTopics? topics, bool isCurrentPage) =>
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
301
|
BlocBuilder<TopicPictureBloc, TopicPictureState>(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
302
303
304
|
buildWhen: (previous, current) {
return isCurrentPage;
}, builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
305
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
306
307
308
309
310
311
|
return SafeArea(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
b81332ca
吴启风
feat:喇叭组件替换
|
312
|
SpeakerWidget(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
313
|
isPlaying: isCurrentPage &&
|
8fb5f860
吴启风
feat:先声录音状态优化
|
314
|
bloc.isAudioPlaying(),
|
b81332ca
吴启风
feat:喇叭组件替换
|
315
|
// 控制动画播放
|
b81332ca
吴启风
feat:喇叭组件替换
|
316
317
|
width: 32.w,
height: 32.w,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
318
319
320
|
onTap: () {
bloc.add(VoicePlayEvent());
},
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
321
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
322
|
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
323
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
324
|
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
325
|
fontSize: 20.sp, color: const Color(0xFF333333)))
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
326
327
328
|
],
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
329
330
|
SizedBox(
height: 143.h,
|
82c8633c
biao
音频添加 页面优化
|
331
|
width: 203.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
332
333
|
child: ListView.builder(
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
334
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
335
336
337
338
339
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceImageWidget(
index, topics?.topicAnswerList?[index]);
}),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
340
341
342
343
344
345
|
)
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
346
347
348
349
350
351
|
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:体验优化-练习题目取消阻...
|
352
|
final isAnswerOption = bloc.optionSelectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
353
354
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
355
356
357
|
return OptionWidget(
onTap: () => bloc.add(SelectItemEvent(index)),
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
358
359
|
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
360
361
362
363
364
365
366
367
368
369
|
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偶现按钮消失问题,练习页...
|
370
|
child: Container(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
371
|
decoration: BoxDecoration(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
372
373
374
375
376
|
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(answerList?.picUrl ?? ''))),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
377
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
378
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
379
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
380
381
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
382
383
|
///听音选字
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
384
385
|
Widget _pageViewVoiceWordItemWidget(
CourseProcessTopics? topics, bool isCurrentPage) =>
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
386
|
BlocBuilder<TopicPictureBloc, TopicPictureState>(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
387
|
buildWhen: (_, s) => isCurrentPage,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
388
|
builder: (context, state) {
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
389
390
391
392
393
394
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return SafeArea(
child: Column(
children: [
SpeakerWidget(
isPlaying: isCurrentPage &&
|
8fb5f860
吴启风
feat:先声录音状态优化
|
395
|
bloc.isAudioPlaying(),
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
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:调整代码
|
416
|
),
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
417
418
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
419
|
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
420
421
422
423
424
425
|
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:体验优化-练习题目取消阻...
|
426
|
final isAnswerOption = bloc.optionSelectItem == index;
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
427
428
|
final answerCorrect =
isAnswerOption && bloc.checkAnswerRight(index) == true;
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
429
|
return OptionWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
430
|
onTap: () => bloc.add(SelectItemEvent(index)),
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
431
432
433
434
435
|
isCorrect: isAnswerOption ? bloc.checkAnswerRight(index) : null,
child: Container(
width: 163.w,
height: 143.h,
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
436
|
child: Container(
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
437
|
width: 143.w,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
438
|
height: 143.h,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
439
440
441
442
443
444
445
446
447
448
449
450
451
|
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:闯关交互优化-答错晃动、...
|
452
|
alignment: Alignment.center,
|
61e3478a
吴启风
feat:封装具备答错摇晃、答对缩...
|
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
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偶现按钮消失问题,练习页...
|
474
475
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
476
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
477
478
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
479
480
|
///语音问答
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
481
|
Widget _voiceAnswerItem(CourseProcessTopics? topics, bool isCurrentPage) =>
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
482
|
BlocBuilder<TopicPictureBloc, TopicPictureState>(
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
483
|
buildWhen: (_, s) => isCurrentPage,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
484
|
builder: (context, state) {
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
485
486
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return Row(
|
2eb67dd4
liangchengyou
feat:调整代码
|
487
488
|
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
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动效组件封装...
|
503
|
children: [
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
504
505
506
507
|
Row(
children: [
SpeakerWidget(
isPlaying: isCurrentPage &&
|
8fb5f860
吴启风
feat:先声录音状态优化
|
508
|
bloc.isAudioPlaying(),
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
|
// 控制动画播放
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...
|
525
526
|
width: 72.w,
height: 72.w,
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
527
|
onTap: () {
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
528
529
530
531
532
533
534
535
536
537
538
539
|
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动效组件封装...
|
540
541
|
},
),
|
d4d91cb0
吴启风
feat:lottie动效组件封装...
|
542
|
],
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
543
|
)
|
2eb67dd4
liangchengyou
feat:调整代码
|
544
|
],
|
2512b58c
吴启风
feat:性能优化-练习页Page...
|
545
546
|
);
});
|
32b3acf4
吴启风
feat:选择题作答完毕颜色参考hkc
|
547
548
549
550
551
552
553
554
|
Color getResultColor(bool correct) {
if (correct) {
return const Color(0xFF19D717);
} else {
return const Color(0xFFFF463C);
}
}
|
da82bd70
Key
feat: user_inform...
|
555
|
}
|