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
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 VoidCallback callback;
const ErrorPage({Key key, this.callback}) : 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: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset("assets/bg_error.png",width: ScreenUtil().setWidth(311),height: ScreenUtil().setWidth(215),),
VEmptyView(40),
Text("哎呀~网络好像走失了呢",style: TextStyle(fontSize: ScreenUtil().setSp(32),color: MyColours.color_353535),),
VEmptyView(20),
widget.callback!=null?GestureDetector(
onTap: widget.callback,
child: Container(
width: ScreenUtil().setWidth(148),
height: ScreenUtil().setWidth(58),
decoration: BoxDecoration(
color: MyColours.color_2bb5b7,
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(12)))
),
child: Center(
child: Text("点击刷新",style: TextStyle(fontSize: ScreenUtil().setSp(30),color: MyColours.color_ffffff),),
),
),
):Container()
],
),
),
);
}
}