FractionalConstraints class

A floor and a cap on the width, each a share of the width the box is offered plus a fixed amount: max-width: 80% is maxFactor: 0.8, and max-width: calc(100% - 32px) is maxFactor: 1, maxOffset: -32.

ConstrainedBox takes numbers, and a percentage min-width or max-width is not a number until the room is known -- which it is only here, at layout. Offered no width at all, a percentage has nothing to be a share OF and the clamp does nothing (CSS 2.1 10.4: it is none for a maximum and zero for a minimum).

Inheritance

Constructors

FractionalConstraints({Key? key, double? minFactor, double minOffset = 0, double? maxFactor, double maxOffset = 0, double? otherMaxFactor, double otherMaxOffset = 0, bool otherMaxLarger = false, bool compressible = false, TextDirection textDirection = TextDirection.ltr, Widget? child})
const

Properties

child → Widget?
The widget below this widget in the tree.
finalinherited
compressible → bool
Whether the box can be squeezed to nothing, so the least room it asks for is zero (css-sizing-3 5.2.2): a PICTURE capped by a percentage is, and a 1280px image at max-width: 100% does not push the grid column it sits in open to 1280. A box of text still asks for its longest word.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxFactor → double?
final
maxOffset → double
final
minFactor → double?
final
minOffset → double
final
otherMaxFactor → double?
A SECOND CAP of the same room, where the page caps the box at the smaller of two shares that each add a length: max-width: min(50% + 40px, 70% + 10px) is maxFactor: 0.5, maxOffset: 40 and otherMaxFactor: 0.7, otherMaxOffset: 10. Which of the two binds is the room's to say -- the second under 150, the first past it (css-values-4 10.9) -- and a cap nested inside another would take its share of what the outer one leaves, not of the room. Both are of the width THIS box is offered; the floor still wins over either (CSS 2.1 10.4). Nothing without otherMaxFactor.
final
otherMaxLarger → bool
Whether the box is held to the LARGER of the two caps rather than the smaller: max-width: max(50%, 200px) is maxFactor: 0.5 and otherMaxFactor: 0, otherMaxOffset: 200 -- 200 in a room under 400, half of it past (css-values-4 10.9). Nothing without otherMaxFactor.
final
otherMaxOffset → double
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textDirection → TextDirection
The direction of the line or the block the box is laid out in, which says which side a floor past the room takes it over. A box wider than its room keeps its START edge on the room's and hangs off the END -- the right under ltr, the LEFT under rtl -- on a line (css-text-3 7.1: an overflowing line is start-aligned) as in a block (CSS 2.1 10.3.3: in an over-constrained box the end margin is the one that gives). min-width: 340px at width: stretch in a 300px rtl block shows its first 40px past the block's left.
final

Methods

createElement() → SingleChildRenderObjectElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
inherited
createRenderObject(BuildContext context) → RenderFractionalConstraints
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
didUnmountRenderObject(covariant RenderObject renderObject) → void
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited
updateRenderObject(BuildContext context, covariant RenderFractionalConstraints renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

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