page_empty.dart
2.66 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class EmptyPage extends StatefulWidget {
final String content;
final String imgname;
final Color bgcolor;
final bool needEmpty;
const EmptyPage(
{Key key,
this.content,
this.imgname = "bg_error",
this.bgcolor = MyColours.color_ffffff,
this.needEmpty = false})
: super(key: key);
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new EmptyPageState();
}
}
class EmptyPageState extends State<EmptyPage> {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
width: double.infinity,
height: double.infinity,
color: widget.bgcolor,
child: Stack(
children: <Widget>[
Container(
width: double.infinity,
height: double.infinity,
margin: EdgeInsets.only(top: ScreenUtil().setWidth(132)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
Utils.getImgPath(widget.imgname),
width: ScreenUtil().setWidth(520),
height: ScreenUtil().setWidth(384),
),
VEmptyView(40),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Text(
widget.content ?? "数据为空",
textAlign: TextAlign.center,
strutStyle: StrutStyle(leading: ScreenUtil().setWidth(1)),
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_353535),
),
widget.needEmpty
? InkWell(
onTap: () {
NavigatorUtil.goCouponHistoryPage(context);
},
child: Text(
'查看过期优惠券',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_438E93),
))
: SizedBox()
])
],
),
),
],
));
}
}