//容器组件的使用 外面的column的高度是固定的
new Container(
alignment: Alignment.center,
padding: const EdgeInsets.all(8.0),
margin:const EdgeInsets.all(8.0),
constraints: new BoxConstraints.expand(
height: Theme.of(context).textTheme.display1.fontSize*1.1+200,
),
width: 300.0,
height: 200.0,
decoration: buildBoxDecoration(),
foregroundDecoration: BoxDecoration(),
child: new Text('容器演示'),
transform: new Matrix4.rotationZ(0.1),
),
//下面是BoxDecoration的封装,
Decoration buildBoxDecoration()
{
//dart 1.0 需要new dart2.0不需要new
return new BoxDecoration(
color:const Color(0xfffce5cd),
border: new Border.all(
color: const Color(0xfffce5cd),
width: 8.0,
),
);
}