FittedBox class

A widget that sizes and positions its child within itself according to fit.

In a terminal context where scaling vector fonts is not physically possible, this widget enforces layout constraints and provides strict cell-dropping truncation when clipBehavior is Clip.hardEdge.

Inheritance

Constructors

FittedBox({Key? key, BoxFit fit = .contain, Alignment alignment = .center, Clip clipBehavior = .none, required Widget child})
Creates a FittedBox.
const

Properties

alignment → Alignment
How to align the child within the available space.
final
child → Widget
The child widget.
final
clipBehavior → Clip
How to clip the content.
final
fit → BoxFit
How to inscribe the child into the available space.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
The optional key for this widget.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → Element
Creates an Element to manage this widget's location in the tree.
override
getIntrinsicHeight(int width) → int
Computes the intrinsic height of this widget under the given width constraint.
inherited
getIntrinsicWidth(int height) → int
Computes the intrinsic width of this widget under the given height constraint.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited