美文网首页
容器组件 - ConstrainedBox

容器组件 - ConstrainedBox

作者: 努力生活的西鱼 | 来源:发表于2023-09-14 15:22 被阅读0次
ConstrainedBox({
  super.key,
  required this.constraints,
  super.child,
})


BoxConstraints({
  this.minWidth = 0.0, // 最小宽度
  this.maxWidth = double.infinity, // 最大宽度
  this.minHeight = 0.0, // 最小高度
  this.maxHeight = double.infinity, // 最大高度
})
BoxConstraints的方法
1. tightFor
constraints: const BoxConstraints.tightFor(width: 200,height: 150)

宽度和高度是可选参数,在不传入的情况下,能大则大,在传入参数时,设定大多就是多大

相关文章

网友评论

      本文标题:容器组件 - ConstrainedBox

      本文链接:https://www.haomeiwen.com/subject/zvvmvdtx.html