95edef4f
liangchengyou
feat:更新适配代码
|
1
2
3
4
|
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wow_english/common/extension/string_extension.dart';
|
60e47f7c
liangchengyou
feat:课程选择功能
|
5
6
7
8
9
10
11
12
13
14
15
|
enum HeaderActionType {
//视频跟读
video,
//阶段选择
phase,
//磨耳朵
listen,
//购买
shop,
}
|
95edef4f
liangchengyou
feat:更新适配代码
|
16
|
class HomeTabHeaderWidget extends StatelessWidget {
|
60e47f7c
liangchengyou
feat:课程选择功能
|
17
18
19
20
|
const HomeTabHeaderWidget({super.key, this.actionTap});
final Function(HeaderActionType type)? actionTap;
|
95edef4f
liangchengyou
feat:更新适配代码
|
21
22
23
24
25
26
27
28
29
30
|
@override
Widget build(BuildContext context) {
return Container(
height: 45.h,
width: double.infinity,
color: Colors.purple,
padding: EdgeInsets.symmetric(horizontal: 9.5.w),
child: Row(
children: [
|
4bf67b91
liangchengyou
feat:设置密码
|
31
|
ScreenUtil().bottomBarHeight.horizontalSpace,
|
95edef4f
liangchengyou
feat:更新适配代码
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
ClipRRect(
borderRadius:BorderRadius.circular(21),
child: Image.network(
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fsafe-img.xhscdn.com%2Fbw1%2Faa1c2213-820a-4223-8757-5f8cee318a28%3FimageView2%2F2%2Fw%2F1080%2Fformat%2Fjpg&refer=http%3A%2F%2Fsafe-img.xhscdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1688713226&t=192b18a613683bcdc5bd76f65c9ff032',
height: 42,
width: 42,
fit: BoxFit.fill,
),
),
Container(
color: Colors.white,
margin: const EdgeInsets.only(left: 7),
padding: const EdgeInsets.all(7.0),
child: const Text('franky'),
),
20.horizontalSpace,
const Expanded(
child:Text(
'learn wow!yellow',
textAlign:TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: 30.0
),
)
),
IconButton(
|
60e47f7c
liangchengyou
feat:课程选择功能
|
59
60
61
62
63
|
onPressed: (){
if(actionTap != null) {
actionTap!(HeaderActionType.video);
}
},
|
95edef4f
liangchengyou
feat:更新适配代码
|
64
65
66
|
icon: Image.asset('video'.assetPng)
),
IconButton(
|
60e47f7c
liangchengyou
feat:课程选择功能
|
67
68
69
70
71
|
onPressed: (){
if(actionTap != null) {
actionTap!(HeaderActionType.phase);
}
},
|
95edef4f
liangchengyou
feat:更新适配代码
|
72
73
74
|
icon: Image.asset('home'.assetPng)
),
IconButton(
|
60e47f7c
liangchengyou
feat:课程选择功能
|
75
76
77
78
79
|
onPressed: (){
if(actionTap != null) {
actionTap!(HeaderActionType.listen);
}
},
|
95edef4f
liangchengyou
feat:更新适配代码
|
80
81
82
|
icon: Image.asset('listen'.assetPng)
),
IconButton(
|
60e47f7c
liangchengyou
feat:课程选择功能
|
83
84
85
86
87
|
onPressed: (){
if(actionTap != null) {
actionTap!(HeaderActionType.shop);
}
},
|
95edef4f
liangchengyou
feat:更新适配代码
|
88
|
icon: Image.asset('shop'.assetPng)
|
4bf67b91
liangchengyou
feat:设置密码
|
89
90
|
),
ScreenUtil().bottomBarHeight.horizontalSpace,
|
95edef4f
liangchengyou
feat:更新适配代码
|
91
92
93
94
95
|
],
),
);
}
}
|