forked from toly1994328/FlutterUnit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialog_about.dart
60 lines (59 loc) · 1.55 KB
/
dialog_about.dart
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
import 'package:flutter/material.dart';
import 'package:flutter_unit/app/res/cons.dart';
class DialogAbout extends StatelessWidget {
static show(BuildContext context){
showDialog(//内置方法,创建对话弹框
context: context,
builder: (_) => DialogAbout());
}
@override
Widget build(BuildContext context) {
var title = Row(
//标题
children: <Widget>[
Image.asset(
"assets/images/icon_head.png",
width: 30,
height: 30,
),
SizedBox(
width: 10,
),
Expanded(child: Text("关于",style: TextStyle(fontSize: 18),)),
InkWell(
child: Icon(Icons.close),
onTap: ()=>Navigator.of(context).pop(),
)
],
);
var content = Column(
//内容
mainAxisSize: MainAxisSize.min,
children: <Widget>[
// Image.asset(
// "assets/images/icon_flutter.png",
// width: 50,
// ),
FlutterLogo(size: 50,),
SizedBox(
height: 20,
),
Text(
"Flutter Unit ${Cons.version}",
),
]);
return AlertDialog(title: title, content: content, actions: <Widget>[
//左下角
Padding(
padding: const EdgeInsets.only(right:15.0,bottom: 10,top: 10),
child: Column(
children: <Widget>[
Text(
"Power By GF·J·Toly\n张风捷特烈",
textAlign: TextAlign.center,
),
],
))
]);
}
}