Blame view

lib/pages/repeatafter/widgets/repeat_after_item.dart 3.89 KB
9d080046   liangchengyou   feat:视频跟读逻辑
1
2
3
  import 'package:flutter/material.dart';
  import 'package:flutter_screenutil/flutter_screenutil.dart';
  import 'package:wow_english/common/extension/string_extension.dart';
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
4
5
  import 'package:wow_english/common/widgets/ow_image_widget.dart';
  import 'package:wow_english/models/follow_read_entity.dart';
9d080046   liangchengyou   feat:视频跟读逻辑
6
7
  
  class RepeatAfterItem extends StatelessWidget {
08a0f5a8   liangchengyou   feat:路由方式更新
8
    const RepeatAfterItem({super.key,  this.tapEvent, this.entity});
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
9
10
  
    final FollowReadEntity? entity;
9d080046   liangchengyou   feat:视频跟读逻辑
11
  
08a0f5a8   liangchengyou   feat:路由方式更新
12
    final Function()? tapEvent;
9d080046   liangchengyou   feat:视频跟读逻辑
13
14
15
16
17
18
19
20
21
  
    @override
    Widget build(BuildContext context) {
      return Padding(
        padding: EdgeInsets.symmetric(
          horizontal: 10.w
        ),
        child: GestureDetector(
          onTap: (){
37b78a15   liangchengyou   feat:添加录音插件
22
            ///todo 暂时注释调,测试用
9efff6ae   liangchengyou   feat:视频跟读逻辑修改
23
24
25
26
27
            if (entity != null) {
              if (!entity!.lock!) {
                tapEvent?.call();
              }
            }
9d080046   liangchengyou   feat:视频跟读逻辑
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
          },
          child: Stack(
            children: [
              _modelInfoWidget(context),
              _lockWidget()
            ],
          ),
        ),
      );
    }
  
    Widget _modelInfoWidget(BuildContext context) {
      return Container(
        width: 162.w,
        height: 235.h,
        decoration: BoxDecoration(
            image: DecorationImage(
                image: AssetImage(
                    'gendubeij'.assetPng
                ),
                fit: BoxFit.fill
            )
        ),
        padding: EdgeInsets.symmetric(horizontal: 11.w,vertical: 13.h),
        alignment: Alignment.center,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
56
57
            OwImageWidget(
              name:entity?.coverUrl??'',
9d080046   liangchengyou   feat:视频跟读逻辑
58
59
60
61
62
63
64
65
              height: 100.h,
              width: 140.w,
              fit: BoxFit.fitWidth,
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Image.asset(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
66
                  (entity?.star??0) >= 1 ? 'star_light'.assetPng:'star_dark'.assetPng,
9d080046   liangchengyou   feat:视频跟读逻辑
67
68
69
70
                  width: 23.w,
                  height: 21.h,
                ),
                Image.asset(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
71
                  (entity?.star??0) >= 2 ? 'star_light'.assetPng:'star_dark'.assetPng,
9d080046   liangchengyou   feat:视频跟读逻辑
72
73
74
75
                  width: 23.w,
                  height: 21.h,
                ),
                Image.asset(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
76
                  (entity?.star??0) >= 3 ? 'star_light'.assetPng:'star_dark'.assetPng,
9d080046   liangchengyou   feat:视频跟读逻辑
77
78
79
80
                  width: 23.w,
                  height: 21.h,
                ),
                Image.asset(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
81
                  (entity?.star??0) >= 4 ? 'star_light'.assetPng:'star_dark'.assetPng,
9d080046   liangchengyou   feat:视频跟读逻辑
82
83
84
85
                  width: 23.w,
                  height: 21.h,
                ),
                Image.asset(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
86
                  (entity?.star??0) >= 5 ? 'star_light'.assetPng:'star_dark'.assetPng,
9d080046   liangchengyou   feat:视频跟读逻辑
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
                  width: 23.w,
                  height: 21.h,
                ),
              ],
            ),
            Container(
              height: 35.h,
              width: double.infinity,
              decoration: BoxDecoration(
                color: const Color(0xFFFFCC00),
                borderRadius: BorderRadius.circular(5.r),
                border: Border.all(
                  width: 1.0,
                  color: const Color(0xFF333333),
                ),
              ),
              alignment: Alignment.center,
              child: Text(
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
105
                entity?.title??'',
9d080046   liangchengyou   feat:视频跟读逻辑
106
107
108
109
110
111
112
113
114
115
116
117
                style: TextStyle(
                    fontSize: 16.sp,
                    color: const Color(0xFF333333)
                ),
              ),
            )
          ],
        ),
      );
    }
  
    Widget _lockWidget() {
6f617434   liangchengyou   feat:磨耳朵/视频跟读列表页接口调整
118
119
      return Visibility(
        visible: entity?.lock??false,
9d080046   liangchengyou   feat:视频跟读逻辑
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
        child: Container(
          width: 162.w,
          height: 235.h,
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage(
                      'gendubeij_mengban'.assetPng
                  ),
                  fit: BoxFit.fill
              )
          ),
          alignment: Alignment.center,
          child: Image.asset(
            'listen_lock'.assetPng,
            height: 36.h,
            width: 41.w,
          ),
        ),
      );
    }
  }