SizedBox
指定大小的盒子布局,可指定width和height宽高两个属性,其特点是可通过设置width=double.infinity和height=double.infinity来使盒子充满父Widget宽高。
Widget getSizedBox() { return SizedBox( width: double.infinity, height: 200, child: Container( color: Colors.redAccent, child: Text('This is SizedBox widget demo'), ), ); }