page_error.dart
1.76 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
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/v_empty_view.dart';
class ErrorPage extends StatefulWidget{
final String content;
final VoidCallback callback;
const ErrorPage({Key key, this.callback,this.content="哎呀~网络好像走失了呢"}) : super(key: key);
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new ErrorPageState();
}
}
class ErrorPageState extends State<ErrorPage>{
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
width: double.infinity,
height: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
VEmptyView(120),
Image.asset("assets/bg_error.png",width: ScreenUtil().setWidth(520),height: ScreenUtil().setWidth(384),),
VEmptyView(40),
Text("${widget.content}",style: TextStyle(fontSize: ScreenUtil().setSp(28),color: MyColours.color_353535),),
VEmptyView(20),
widget.callback!=null?GestureDetector(
onTap: widget.callback,
child: Container(
width: ScreenUtil().setWidth(152),
height: ScreenUtil().setWidth(58),
decoration: BoxDecoration(
color: MyColours.app_main,
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(28)))
),
child: Center(
child: Text("点击刷新",style: TextStyle(fontSize: ScreenUtil().setSp(28),color: MyColours.color_ffffff),),
),
),
):Container()
],
)
);
}
}