95edef4f
liangchengyou
feat:更新适配代码
|
1
|
import 'package:flutter/material.dart';
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
2
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
95edef4f
liangchengyou
feat:更新适配代码
|
3
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
aa4e28be
Key
removed: cache_bl...
|
4
|
import 'package:wow_english/common/core/user_util.dart';
|
95edef4f
liangchengyou
feat:更新适配代码
|
5
|
import 'package:wow_english/common/extension/string_extension.dart';
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
6
|
import 'package:wow_english/pages/user/bloc/user_bloc.dart';
|
aa4e28be
Key
removed: cache_bl...
|
7
|
import 'package:wow_english/utils/image_util.dart';
|
95edef4f
liangchengyou
feat:更新适配代码
|
8
|
|
68dd7ba8
liangchengyou
feat:首页主题颜色+已知问题修改
|
9
10
11
|
import '../../../models/course_entity.dart';
import '../courese_module_model.dart';
|
60e47f7c
liangchengyou
feat:课程选择功能
|
12
13
14
15
16
17
18
19
20
|
enum HeaderActionType {
//视频跟读
video,
//阶段选择
phase,
//磨耳朵
listen,
//购买
shop,
|
d35a4e87
liangchengyou
feat:磨耳朵功能UI
|
21
|
//个人信息
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
22
23
24
|
user,
//返回到(模块选择)首页
home,
|
60e47f7c
liangchengyou
feat:课程选择功能
|
25
26
|
}
|
95edef4f
liangchengyou
feat:更新适配代码
|
27
|
class HomeTabHeaderWidget extends StatelessWidget {
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
28
|
const HomeTabHeaderWidget({super.key, this.entity, this.actionTap});
|
60e47f7c
liangchengyou
feat:课程选择功能
|
29
|
|
68dd7ba8
liangchengyou
feat:首页主题颜色+已知问题修改
|
30
|
final CourseEntity? entity;
|
60e47f7c
liangchengyou
feat:课程选择功能
|
31
|
final Function(HeaderActionType type)? actionTap;
|
95edef4f
liangchengyou
feat:更新适配代码
|
32
33
34
|
@override
Widget build(BuildContext context) {
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
35
36
|
return BlocBuilder<UserBloc, UserState>(
builder: (context, state) {
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
37
38
39
|
return Container(
height: 45,
width: double.infinity,
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
40
41
|
color:
CourseModuleModel(entity?.courseModuleCode ?? 'Phase-1').color,
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
42
43
44
45
46
|
padding: EdgeInsets.symmetric(horizontal: 9.5.w),
child: Row(
children: [
ScreenUtil().bottomBarHeight.horizontalSpace,
GestureDetector(
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
47
48
|
onTap: () {
if (actionTap != null) {
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
49
|
actionTap!(HeaderActionType.home);
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
50
51
52
|
}
},
child: Container(
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
53
54
55
56
57
|
alignment: Alignment.center,
child: Image.asset(
'back_around'.assetPng,
height: 40.h,
width: 40.w,
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
58
59
60
|
),
),
),
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
// GestureDetector(
// onTap: () => actionTap?.call(HeaderActionType.user),
// child: Container(
// decoration: BoxDecoration(
// border: Border.all(
// width: 1.0,
// color: const Color(0xFF140C10),
// ),
// borderRadius: BorderRadius.circular(21),
// ),
// child: CircleAvatar(
// radius: 21,
// backgroundImage: ImageUtil.getImageProviderOnDefault(UserUtil.getUser()?.avatarUrl),
// ),
// ),
// ),
// GestureDetector(
// onTap: () {
// if (actionTap != null) {
// actionTap!(HeaderActionType.user);
// }
// },
// child: Container(
// margin: const EdgeInsets.only(left: 7),
// padding: const EdgeInsets.all(4.0),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(2),
// border: Border.all(width: 1.0, color: const Color(0xFF140C10), style: BorderStyle.solid),
// ),
// child: Text(
// UserUtil.getUser()?.name ?? '未登录',
// style: TextStyle(color: const Color(0xFF333333), fontSize: 16.sp),
// ),
// ),
// ),
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
97
|
20.horizontalSpace,
|
68dd7ba8
liangchengyou
feat:首页主题颜色+已知问题修改
|
98
|
Expanded(
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
99
|
child: Text(
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
100
101
102
103
104
|
CourseModuleModel(entity?.courseModuleCode ?? 'Phase-1')
.courseModuleTitle,
textAlign: TextAlign.left,
style: const TextStyle(color: Colors.white, fontSize: 30.0),
)),
|
354ac7e6
吴启风
feat:隐藏视频跟读入口、底部草...
|
105
106
107
108
109
110
111
|
// IconButton(
// onPressed: () {
// if (actionTap != null) {
// actionTap!(HeaderActionType.video);
// }
// },
// icon: Image.asset('video'.assetPng)),
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
IconButton(
onPressed: () {
if (actionTap != null) {
actionTap!(HeaderActionType.phase);
}
},
icon: Image.asset('home'.assetPng)),
IconButton(
onPressed: () {
if (actionTap != null) {
actionTap!(HeaderActionType.listen);
}
},
icon: Image.asset('listen'.assetPng)),
|
07599105
吴启风
feat:商品列表请求&路由
|
126
|
IconButton(
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
127
128
|
onPressed: () {
if (actionTap != null) {
|
07599105
吴启风
feat:商品列表请求&路由
|
129
130
131
|
actionTap!(HeaderActionType.shop);
}
},
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
132
|
icon: Image.asset('shop'.assetPng)),
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
133
134
|
ScreenUtil().bottomBarHeight.horizontalSpace,
],
|
454dc387
吴启风
feat:原阶段选择页(首页)增加...
|
135
|
));
|
c948a9ea
liangchengyou
feat:个人信息更改模块功能
|
136
|
},
|
95edef4f
liangchengyou
feat:更新适配代码
|
137
138
|
);
}
|
056970d8
Key
feat: api
|
139
|
}
|