Container({
super.key,
this.alignment,
this.padding,
this.color,
this.decoration,
this.foregroundDecoration,
double? width,
double? height,
BoxConstraints? constraints,
this.margin,
this.transform,
this.transformAlignment,
this.child,
this.clipBehavior = Clip.none,
})
1. 卡片示例
@override
Widget build(BuildContext context) {
return Container(
constraints: const BoxConstraints.tightFor(width: 200,height: 150),
margin: const EdgeInsets.only(top: 50,left: 120),
decoration: const BoxDecoration(
gradient: RadialGradient(
colors: [Colors.red,Colors.orange],
center: Alignment.topLeft,
radius: .98
),
boxShadow: [
BoxShadow(
color: Colors.black54,
offset: Offset(2, 2),
blurRadius: 4
)
]
),
transform: Matrix4.rotationZ(.2),
alignment: Alignment.center,
child: const Text(
"5.20",
style: TextStyle(
color: Colors.white,
fontSize: 40
),
),
);
}
网友评论