FittedBox class

Scales and positions a child widget within its allocated space according to fit and alignment.

Equivalent to Flutter's FittedBox for nocterm terminal UIs.

Example — keep the NitroLogo centred and fully visible regardless of how large the surrounding Expanded area is:

FittedBox(
  fit: BoxFit.scaleDown,
  child: NitroLogo(color: Colors.cyan),
)

Constructors

FittedBox({Key? key, BoxFit fit = BoxFit.contain, Alignment alignment = Alignment.center, Component? child})
const

Properties

alignment → Alignment
final
child → Component?
finalinherited
fit BoxFit
final
hashCode int
The hash code for this object.
no setterinherited
key → Key?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → SingleChildRenderObjectElement
inherited
createRenderObject(BuildContext context) → RenderObject
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateRenderObject(BuildContext context, covariant RenderFittedBox renderObject) → void

Operators

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