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