const IntrinsicHeight({ Key? key, Widget? child }) : super(key: key, child: child);
代码
body:Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Container(color: Colors.blue, width: 100.0),
new Container(color: Colors.red, width: 50.0,height: 50.0,),
new Container(color: Colors.yellow, width: 150.0),
],
),
代码
body:IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
new Container(color: Colors.blue, width: 100.0),
new Container(color: Colors.red, width: 50.0,height: 50.0,),
new Container(color: Colors.yellow, width: 150.0),
],
),
)
效果图
const IntrinsicWidth({ Key? key, this.stepWidth, this.stepHeight, Widget? child })
: assert(stepWidth == null || stepWidth >= 0.0),
assert(stepHeight == null || stepHeight >= 0.0),
super(key: key, child: child);
属性 | 说明 | 取值 |
---|---|---|
stepWidth | double | |
stepHeight | double |
IntrinsicWidth(
stepHeight: 450.0,
stepWidth: 300.0,
child: Column(
children: [
new Container(color: Colors.blue, height: 100.0),
new Container(color: Colors.red, width: 150.0, height: 100.0),
new Container(color: Colors.yellow,height: 150.0,),
],
),
)