CssSizeConstraints class

The max-width / min-width / max-height / min-height declarations found on one element, still in their authored units.

Parsing and resolution are deliberately separate: %, vw, vh and em cannot be turned into logical pixels until there is a BuildContext and a set of incoming BoxConstraints, which only exist at build time.

Annotations

Constructors

CssSizeConstraints({CssSizeLength? maxWidth, CssSizeLength? minWidth, CssSizeLength? maxHeight, CssSizeLength? minHeight})
const
CssSizeConstraints.fromInlineStyle(String styleAttr)
Reads the four properties out of an inline style="" attribute.
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
isEmpty → bool
True when not one of the four properties was understood.
no setter
isNotEmpty → bool
True when at least one of the four properties was understood.
no setter
maxHeight → CssSizeLength?
The max-height declaration, or null if absent or untranslatable.
final
maxWidth → CssSizeLength?
The max-width declaration, or null if absent or untranslatable.
final
minHeight → CssSizeLength?
The min-height declaration, or null if absent or untranslatable.
final
minWidth → CssSizeLength?
The min-width declaration, or null if absent or untranslatable.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
usesPercentages → bool
Whether any declaration is a percentage, and therefore needs the incoming BoxConstraints before it can be resolved.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve({required double? availableWidth, required double? availableHeight, required Size? viewport, required double emPx, required double remPx}) → BoxConstraints?
Turns the declarations into BoxConstraints, or null when none of them resolve in this context.
toString() → String
A string representation of this object.
override

Operators

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