pub struct LayoutCtx<'a> {
pub constraints: Constraints,
pub font: &'a FontCache,
pub theme: &'a ThemeData,
}Expand description
Context passed to every widget’s Widget::layout call.
Carries the available constraints plus font and theme access so that widgets can measure text accurately without relying on character-count heuristics.
Fields§
§constraints: Constraints§font: &'a FontCache§theme: &'a ThemeDataImplementations§
Source§impl<'a> LayoutCtx<'a>
impl<'a> LayoutCtx<'a>
pub fn new( constraints: Constraints, font: &'a FontCache, theme: &'a ThemeData, ) -> Self
Sourcepub fn with_constraints(&self, constraints: Constraints) -> LayoutCtx<'_>
pub fn with_constraints(&self, constraints: Constraints) -> LayoutCtx<'_>
Derive a child context with tighter constraints (font/theme are shared).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LayoutCtx<'a>
impl<'a> !Send for LayoutCtx<'a>
impl<'a> !Sync for LayoutCtx<'a>
impl<'a> !UnwindSafe for LayoutCtx<'a>
impl<'a> Freeze for LayoutCtx<'a>
impl<'a> Unpin for LayoutCtx<'a>
impl<'a> UnsafeUnpin for LayoutCtx<'a>
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