my_item.dart
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/h_empty_view.dart';
class MyItem extends StatefulWidget{
final String title;
final String content;
final VoidCallback callback;
const MyItem({Key key, this.title, this.content, this.callback}) : super(key: key);
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new MyItemState();
}
}
class MyItemState extends State<MyItem>{
@override
Widget build(BuildContext context) {
// TODO: implement build
return GestureDetector(
onTap: widget.callback,
child: Container(
width: double.infinity,
height: ScreenUtil().setHeight(122),
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Row(
children: <Widget>[
Text(widget.title,style: TextStyle(fontSize: ScreenUtil().setSp(30),color: MyColours.color_353535),),
Spacer(),
Text(widget.content,style: TextStyle(fontSize: ScreenUtil().setSp(28),color: MyColours.color_666666),),
HEmptyView(20),
Image.asset("assets/arr_right_gray.png",width: ScreenUtil().setWidth(14),height: ScreenUtil().setWidth(22),)
],
),
),
);
}
}