pub struct BoxConstraints {
pub min_width: f32,
pub max_width: f32,
pub min_height: f32,
pub max_height: f32,
}Expand description
布局约束(Flutter 范式:父→子 min/max,子→父 size)
Fields§
§min_width: f32§max_width: f32§min_height: f32§max_height: f32Implementations§
Source§impl BoxConstraints
impl BoxConstraints
Sourcepub fn inset_uniform(&self, inset: f32) -> Self
pub fn inset_uniform(&self, inset: f32) -> Self
四边均匀内缩(用于带边框/焦点环的容器给 child 的约束)。 min 归 0(child 可以任意小),max 减去两侧 inset 并 clamp ≥0 (防 max < min)。∞ 减有限值仍为 ∞。
Sourcepub fn is_bounded_width(&self) -> bool
pub fn is_bounded_width(&self) -> bool
宽度轴是否被限制为有限值
Sourcepub fn is_bounded_height(&self) -> bool
pub fn is_bounded_height(&self) -> bool
高度轴是否被限制为有限值
Trait Implementations§
Source§impl Clone for BoxConstraints
impl Clone for BoxConstraints
impl Copy for BoxConstraints
Source§impl Debug for BoxConstraints
impl Debug for BoxConstraints
Source§impl Default for BoxConstraints
impl Default for BoxConstraints
Source§impl PartialEq for BoxConstraints
impl PartialEq for BoxConstraints
impl StructuralPartialEq for BoxConstraints
Auto Trait Implementations§
impl Forget for BoxConstraints
impl Freeze for BoxConstraints
impl Move for BoxConstraints
impl RefUnwindSafe for BoxConstraints
impl Send for BoxConstraints
impl Sync for BoxConstraints
impl Unpin for BoxConstraints
impl UnsafeUnpin for BoxConstraints
impl UnwindSafe for BoxConstraints
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more