Blame view

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