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';
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
10
|
import 'package:wow_english/pages/practice/widgets/shake_widget.dart';
|
934e2b47
liangchengyou
feat:权限调整+课程进度接口对接
|
11
|
import 'package:wow_english/route/route.dart';
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
12
|
import 'package:wow_english/utils/toast_util.dart';
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
13
|
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
14
|
import '../../common/widgets/throttledGesture_gesture_detector.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);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
167
168
|
final shouldShake = (bloc.selectItem == index &&
bloc.checkAnswerRight(index) == false);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
169
170
171
172
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
173
174
|
child: ShakeWidget(
shouldShake: shouldShake,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
175
|
child: Container(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
176
|
padding: const EdgeInsets.all(4.5),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
177
|
decoration: BoxDecoration(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
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)),
image: DecorationImage(
fit: BoxFit.fitWidth,
image: NetworkImage(answerLis?.picUrl ?? ''))),
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
195
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
196
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
197
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
198
199
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
200
201
|
///看题选字
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
202
203
204
|
Widget _pageViewWordItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
205
206
207
|
return SafeArea(
child: Column(
children: [
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
208
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
209
210
|
softWrap: true,
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
211
|
fontSize: 21.sp, color: const Color(0xFF333333))),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
212
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
213
214
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
215
|
width: 143.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
216
|
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
217
|
scrollDirection: Axis.horizontal,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
218
|
itemCount: topics?.topicAnswerList?.length ?? 0,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
219
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
220
221
222
|
itemBuilder: (context, index) {
return _decodeWordWidget(
index, topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
223
224
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
225
226
227
228
229
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
230
231
232
233
234
235
|
Widget _decodeWordWidget(
int index, CourseProcessTopicsTopicAnswerList? answerLis) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
236
237
|
final shouldShake = (bloc.selectItem == index &&
bloc.checkAnswerRight(index) == false);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
238
239
240
241
|
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
child: ShakeWidget(
shouldShake: shouldShake,
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(
alignment: Alignment.center,
child: Text(answerLis?.word ?? '',
style: TextStyle(
fontSize: 20.sp,
color: const Color(0xFF333333))),
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
266
|
),
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
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)),
),
alignment: Alignment.center,
child: Image.asset('choose'.assetPng),
)
],
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
283
284
|
),
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
285
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
286
287
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
288
289
|
///听音选图
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
290
291
292
|
Widget _pageViewVoicePictureItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
293
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
294
295
296
297
298
299
|
return SafeArea(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
300
301
302
303
304
|
GestureDetector(
onTap: () {
bloc.add(VoicePlayEvent());
},
child: Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
305
306
307
|
bloc.voicePlayState == VoicePlayState.playing
? 'reade_answer'.assetGif
: 'voice'.assetPng,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
308
309
310
311
|
height: 33.h,
width: 30.w,
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
312
|
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
313
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
314
|
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
315
|
fontSize: 20.sp, color: const Color(0xFF333333)))
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
316
317
318
|
],
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
319
320
|
SizedBox(
height: 143.h,
|
82c8633c
biao
音频添加 页面优化
|
321
|
width: 203.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
322
323
|
child: ListView.builder(
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
324
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
325
326
327
328
329
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceImageWidget(
index, topics?.topicAnswerList?[index]);
}),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
330
331
332
333
334
335
|
)
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
336
337
338
339
340
341
|
Widget _decodeVoiceImageWidget(
int index, CourseProcessTopicsTopicAnswerList? answerList) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
342
343
344
345
346
347
348
349
|
final shouldShake = (bloc.selectItem == index &&
bloc.checkAnswerRight(index) == false);
return ShakeWidget(
shouldShake: shouldShake,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
350
|
child: Container(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
351
|
padding: const EdgeInsets.all(4.5),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
352
|
decoration: BoxDecoration(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
|
color: bloc.selectItem == index
? const Color(0xFF00B6F1)
: Colors.white,
borderRadius: BorderRadius.circular(15),
),
height: 143.h,
width: 163.w,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(answerList?.picUrl ?? ''))),
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
368
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
369
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
370
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
371
372
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
373
374
|
///听音选字
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
375
376
377
|
Widget _pageViewVoiceWordItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
378
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
379
380
381
|
return SafeArea(
child: Column(
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
382
|
GestureDetector(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
383
384
385
386
387
388
389
390
391
|
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:磨耳朵/练习页面调整
|
392
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
393
|
SizedBox(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
394
|
width: 163.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
395
396
|
height: 143.h,
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
397
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
398
399
|
itemCount: topics?.topicAnswerList?.length,
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
400
401
402
|
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceWordImageWidget(
index, topics!.topicAnswerList![index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
403
404
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
405
406
407
408
409
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
410
411
412
413
414
415
|
Widget _decodeVoiceWordImageWidget(
int index, CourseProcessTopicsTopicAnswerList answerList) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
buildWhen: (_, s) => s is SelectItemChangeState,
builder: (context, state) {
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
416
417
|
final shouldShake = (bloc.selectItem == index &&
bloc.checkAnswerRight(index) == false);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
418
419
|
return GestureDetector(
onTap: () => bloc.add(SelectItemEvent(index)),
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
420
421
|
child: ShakeWidget(
shouldShake: shouldShake,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
422
|
child: Container(
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
423
|
width: 163.w,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
424
|
height: 143.h,
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
|
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)),
),
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))),
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
448
|
),
|
45c862fd
吴启风
feat:闯关交互优化-答错晃动、...
|
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
|
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)),
),
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
|
///语音问答
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
472
473
474
|
Widget _voiceAnswerItem(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
2eb67dd4
liangchengyou
feat:调整代码
|
475
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
476
|
return Row(
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
477
478
|
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
82c8633c
biao
音频添加 页面优化
|
479
480
481
482
483
484
485
486
487
488
|
ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Container(
color: Colors.white,
child: OwImageWidget(
name: topics?.picUrl ?? '',
height: 186.h,
width: 186.w,
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
489
|
),
|
82c8633c
biao
音频添加 页面优化
|
490
|
120.horizontalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
491
492
493
|
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
494
495
496
497
498
499
500
501
502
503
504
|
GestureDetector(
onTap: () {
if (bloc.isVoicing) {
showToast('正在录音,不能终止');
return;
}
bloc.add(VoicePlayEvent());
},
child: Row(
children: [
Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
505
506
507
|
bloc.voicePlayState == VoicePlayState.playing
? 'reade_answer'.assetGif
: 'voice'.assetPng,
|
82c8633c
biao
音频添加 页面优化
|
508
509
|
height: 45.h,
width: 45.w,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
510
511
|
),
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
512
|
Text(topics?.word ?? '')
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
513
514
|
],
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
515
516
|
),
70.verticalSpace,
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
517
518
|
ThrottledGestureDetector(
throttleTime: 1000,
|
2eb67dd4
liangchengyou
feat:调整代码
|
519
|
onTap: () {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
520
|
if (bloc.voicePlayState == VoicePlayState.playing) {
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
521
|
showToast('正在播放音频,不能终止');
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
522
523
524
|
return;
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
525
|
if (bloc.isVoicing) {
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
526
|
bloc.add(XSVoiceStopEvent());
|
2eb67dd4
liangchengyou
feat:调整代码
|
527
528
|
return;
}
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
529
530
|
if (topics?.type == TopicType.voiceQuestion.value ||
topics?.type == TopicType.voiceWord.value) {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
531
532
|
bloc.add(XSVoiceStartEvent(topics?.keyWord ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
533
|
} else {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
534
535
|
bloc.add(XSVoiceStartEvent(topics?.word ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
536
|
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
537
538
|
},
child: Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
539
540
541
|
bloc.isVoicing
? 'micro_phone'.assetGif
: 'micro_phone'.assetPng,
|
82c8633c
biao
音频添加 页面优化
|
542
543
|
height: 46.h,
width: 46.w,
|
2eb67dd4
liangchengyou
feat:调整代码
|
544
545
546
|
),
)
],
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
547
548
|
)
],
|
2eb67dd4
liangchengyou
feat:调整代码
|
549
550
|
);
});
|
da82bd70
Key
feat: user_inform...
|
551
|
}
|