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 {
|
608c05b4
liangchengyou
feat:兑换课程
|
18
19
20
|
const TopicPicturePage({super.key, this.courseLessonId});
final String? courseLessonId;
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
21
22
23
24
|
@override
Widget build(BuildContext context) {
return BlocProvider(
|
2eb67dd4
liangchengyou
feat:调整代码
|
25
|
create: (context) => TopicPictureBloc(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
26
27
28
|
context,
PageController(),
courseLessonId ?? '',
|
2eb67dd4
liangchengyou
feat:调整代码
|
29
|
)
|
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
62
63
64
65
66
67
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
return Container(
color: Colors.white,
child: Stack(
children: [
Column(
children: [
PracticeHeaderWidget(
|
2eb67dd4
liangchengyou
feat:调整代码
|
68
|
title: '${bloc.currentPage}/${bloc.entity?.topics?.length}',
|
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
78
79
|
),
Expanded(
child: PageView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
80
|
itemCount: bloc.entity?.topics?.length,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
81
82
83
84
85
|
scrollDirection: Axis.horizontal,
controller: bloc.pageController,
onPageChanged: (int index) {
bloc.add(CurrentPageIndexChangeEvent(index));
},
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
86
87
88
89
90
91
|
itemBuilder: (BuildContext context, int index) {
CourseProcessTopics? topics =
bloc.entity?.topics![index];
if (topics?.type ==
TopicType.audioImageSelect.value) {
//听音选图
|
2eb67dd4
liangchengyou
feat:调整代码
|
92
|
return _pageViewVoicePictureItemWidget(topics);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
93
94
95
|
} else if (topics?.type ==
TopicType.audioCharSelect.value) {
//听音选字
|
2eb67dd4
liangchengyou
feat:调整代码
|
96
|
return _pageViewVoiceWordItemWidget(topics);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
97
98
99
|
} else if (topics?.type ==
TopicType.questionCharSelect.value) {
//看题选字
|
2eb67dd4
liangchengyou
feat:调整代码
|
100
|
return _pageViewWordItemWidget(topics);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
101
102
103
|
} else if (topics?.type ==
TopicType.questionImageSelect.value) {
//看题选图
|
2eb67dd4
liangchengyou
feat:调整代码
|
104
|
return _pageViewItemWidget(topics);
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
105
106
|
} else {
//语音问答
|
2eb67dd4
liangchengyou
feat:调整代码
|
107
|
return _voiceAnswerItem(topics);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
108
109
110
111
112
113
114
115
116
|
}
}),
)
],
),
Positioned(
left: 0,
right: 0,
bottom: 0,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
117
|
child: Image.asset('bottom_grass'.assetPng))
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
118
119
120
121
122
123
|
],
),
);
});
///看题选图
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
124
125
126
|
Widget _pageViewItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
127
128
129
|
return SafeArea(
child: Column(
children: [
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
130
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
131
132
|
softWrap: true,
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
133
|
fontSize: 21.sp, color: const Color(0xFF333333))),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
134
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
135
136
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
137
|
width: 143.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
138
|
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
139
|
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
140
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
141
142
143
144
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (context, index) {
return _decodeImageWidget(
index, topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
145
146
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
147
148
149
150
151
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
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:调整代码
|
168
|
borderRadius: BorderRadius.circular(15),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
169
170
171
172
173
174
175
176
177
178
179
180
181
|
),
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:调整代码
|
182
|
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
183
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
184
185
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
186
187
|
///看题选字
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
188
189
190
|
Widget _pageViewWordItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
191
192
193
|
return SafeArea(
child: Column(
children: [
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
194
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
195
196
|
softWrap: true,
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
197
|
fontSize: 21.sp, color: const Color(0xFF333333))),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
198
|
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
199
200
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
201
|
width: 143.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
202
|
child: ListView.builder(
|
2eb67dd4
liangchengyou
feat:调整代码
|
203
|
scrollDirection: Axis.horizontal,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
204
|
itemCount: topics?.topicAnswerList?.length ?? 0,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
205
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
206
207
208
|
itemBuilder: (context, index) {
return _decodeWordWidget(
index, topics?.topicAnswerList?[index]);
|
2eb67dd4
liangchengyou
feat:调整代码
|
209
210
|
}),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
211
212
213
214
215
|
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
216
217
218
219
220
221
222
223
224
225
226
227
228
229
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);
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:磨耳朵/练习页面调整
|
236
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
237
238
239
240
241
242
243
244
245
246
247
|
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:调整代码
|
248
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
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:调整代码
|
266
|
),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
267
268
|
);
});
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
269
270
|
///听音选图
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
271
272
273
|
Widget _pageViewVoicePictureItemWidget(CourseProcessTopics? topics) =>
BlocBuilder<TopicPictureBloc, TopicPictureState>(
builder: (context, state) {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
274
|
final bloc = BlocProvider.of<TopicPictureBloc>(context);
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
275
276
277
278
279
280
|
return SafeArea(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
281
282
283
284
285
|
GestureDetector(
onTap: () {
bloc.add(VoicePlayEvent());
},
child: Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
286
287
288
|
bloc.voicePlayState == VoicePlayState.playing
? 'reade_answer'.assetGif
: 'voice'.assetPng,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
289
290
291
292
|
height: 33.h,
width: 30.w,
),
),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
293
|
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
294
|
Text(topics?.word ?? '',
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
295
|
style: TextStyle(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
296
|
fontSize: 20.sp, color: const Color(0xFF333333)))
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
297
298
299
|
],
),
26.verticalSpace,
|
2eb67dd4
liangchengyou
feat:调整代码
|
300
301
|
SizedBox(
height: 143.h,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
302
|
width: 163.w * (topics?.topicAnswerList?.length ?? 0),
|
2eb67dd4
liangchengyou
feat:调整代码
|
303
304
|
child: ListView.builder(
scrollDirection: Axis.horizontal,
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
305
|
physics: const NeverScrollableScrollPhysics(),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
306
307
308
309
310
|
itemCount: topics?.topicAnswerList?.length ?? 0,
itemBuilder: (BuildContext context, int index) {
return _decodeVoiceImageWidget(
index, topics?.topicAnswerList?[index]);
}),
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
311
312
313
314
315
316
|
)
],
),
);
});
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
|
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(
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:调整代码
|
333
|
borderRadius: BorderRadius.circular(15),
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
334
335
336
337
338
339
340
341
342
343
344
345
346
|
),
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(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: [
|
2eb67dd4
liangchengyou
feat:调整代码
|
452
|
OwImageWidget(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
453
|
name: topics?.picUrl ?? '',
|
2eb67dd4
liangchengyou
feat:调整代码
|
454
455
|
height: 186.h,
width: 186.w,
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
456
|
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
457
458
459
460
|
160.horizontalSpace,
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
461
462
463
464
465
466
467
468
469
470
471
|
GestureDetector(
onTap: () {
if (bloc.isVoicing) {
showToast('正在录音,不能终止');
return;
}
bloc.add(VoicePlayEvent());
},
child: Row(
children: [
Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
472
473
474
|
bloc.voicePlayState == VoicePlayState.playing
? 'reade_answer'.assetGif
: 'voice'.assetPng,
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
475
476
477
478
|
height: 52.h,
width: 46.w,
),
10.horizontalSpace,
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
479
|
Text(topics?.word ?? '')
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
480
481
|
],
),
|
2eb67dd4
liangchengyou
feat:调整代码
|
482
483
|
),
70.verticalSpace,
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
484
485
|
ThrottledGestureDetector(
throttleTime: 1000,
|
2eb67dd4
liangchengyou
feat:调整代码
|
486
|
onTap: () {
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
487
|
if (bloc.voicePlayState == VoicePlayState.playing) {
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
488
|
showToast('正在播放音频,不能终止');
|
3c1d5c64
liangchengyou
feat:练习功能完成
|
489
490
491
|
return;
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
492
|
if (bloc.isVoicing) {
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
493
|
bloc.add(XSVoiceStopEvent());
|
2eb67dd4
liangchengyou
feat:调整代码
|
494
495
|
return;
}
|
ae77d87f
吴启风
feat:fix语音题无法手动停止...
|
496
497
|
if (topics?.type == TopicType.voiceQuestion.value ||
topics?.type == TopicType.voiceWord.value) {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
498
499
|
bloc.add(XSVoiceStartEvent(topics?.keyWord ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
500
|
} else {
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
501
502
|
bloc.add(XSVoiceStartEvent(topics?.word ?? '', '0',
UserUtil.getUser()!.id.toString()));
|
b90a1518
liangchengyou
feat:练习接口逻辑完成
|
503
|
}
|
2eb67dd4
liangchengyou
feat:调整代码
|
504
505
|
},
child: Image.asset(
|
f29687b2
biao
修复iOS偶现按钮消失问题,练习页...
|
506
507
508
|
bloc.isVoicing
? 'micro_phone'.assetGif
: 'micro_phone'.assetPng,
|
2eb67dd4
liangchengyou
feat:调整代码
|
509
510
511
512
513
|
height: 75.w,
width: 75.w,
),
)
],
|
842b7132
liangchengyou
feat:磨耳朵/练习页面调整
|
514
515
|
)
],
|
2eb67dd4
liangchengyou
feat:调整代码
|
516
517
|
);
});
|
da82bd70
Key
feat: user_inform...
|
518
|
}
|