-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathContainerWidget.dart
45 lines (44 loc) · 1.43 KB
/
ContainerWidget.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
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/common/CommonShowModel.dart';
///author: yang yi
///email: yangyirunning@163.com
class ContainerWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
final arg = ModalRoute.of(context).settings.arguments;
return Scaffold(
appBar: getAppBar(arg),
body: Container(
//容器外填充
margin: EdgeInsets.only(top: 50.0, left: 120.0),
//容器内填充
padding: EdgeInsets.all(20),
//卡片大小
constraints: BoxConstraints.tightFor(width: 200.0, height: 150.0),
//背景装饰
decoration: BoxDecoration(
//背景径向渐变
gradient: RadialGradient(
colors: [Colors.red, Colors.blue],
center: Alignment.center,
radius: .98),
//卡片阴影
boxShadow: [
BoxShadow(
color: Colors.grey, offset: Offset(2.0, 2.0), blurRadius: 4.0)
]),
//卡片倾斜变换
transform: Matrix4.rotationZ(0.5),
//卡片内文字居中
alignment: Alignment.center,
//卡片文字
child: Text(
"Container是所有容器类控件的组合",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
),
);
}
}