Container( decoration: BoxDecoration( boxShadow: [ BoxShadow( color: Colors.yellow, blurRadius: 10.0, spreadRadius: 10.0), ], gradient: new LinearGradient( begin: Alignment.bottomCenter, end: Alignment.topCenter, colors: [ Colors.amber, Colors.yellow, ]), ), padding: EdgeInsets.fromLTRB(0.00, 6.00, 0.00, 6.00), width: MediaQuery.of(context).size.width, child:
效果 :
const BoxDecoration({
this.color,
this.image,
this.border,
this.borderRadius,
this.boxShadow,
this.gradient,
this.backgroundBlendMode,
this.shape = BoxShape.rectangle,
}) : assert(shape != null),
其他属性的一些例子 :
decoration: BoxDecoration(
color: Colors.green,
border: Border.all(color: Colors.grey, width: 1.0),
borderRadius: BorderRadius.circular(3.0),
),