How a box should be inscribed into another box.

See also applyBoxFit, which applies the sizing semantics of these values (though not the alignment semantics).

Constants

contain BoxFit

As large as possible while still containing the source entirely within the target box.

const BoxFit(1)
cover BoxFit

As small as possible while still covering the entire target box.

const BoxFit(2)
fill BoxFit

Fill the target box by distorting the source's aspect ratio.

const BoxFit(0)
fitHeight BoxFit

Make sure the full height of the source is shown, regardless of whether this means the source overflows the target box horizontally.

const BoxFit(4)
fitWidth BoxFit

Make sure the full width of the source is shown, regardless of whether this means the source overflows the target box vertically.

const BoxFit(3)
none BoxFit

Align the source within the target box (by default, centering) and discard any portions of the source that lie outside the box.

The source image is not resized.

const BoxFit(5)
scaleDown BoxFit

Align the source within the target box (by default, centering) and, if necessary, scale the source down to ensure that the source fits within the box.

This is the same as contain if that would shrink the image, otherwise it is the same as none.

const BoxFit(6)
values List<BoxFit>

A constant List of the values in this enum, in order of their declaration.

const List<BoxFit>

Properties

index int

The integer index of this enum.

final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited