RenderFlexible class
A pass-through render object marking its child as flexible inside a RenderFlex. The flex factor and fit are read by RenderFlex during the main-axis allocation pass; otherwise this render object just forwards layout and paint to its child.
- Inheritance
-
- Object
- RenderObject
- RenderFlexible
- Implemented types
Constructors
- RenderFlexible({required int flex, required FlexFit fit})
Properties
- child ↔ RenderObject?
-
The single child render object, if any.
getter/setter pairoverride
- constraints → CellConstraints
-
The constraints from the most recent layout pass.
no setterinherited
- fit ↔ FlexFit
-
getter/setter pair
- flex ↔ int
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasLayout → bool
-
Whether this render object has been laid out at least once.
no setterinherited
- hitTestsBeyondBounds → bool
-
Whether a point outside this render object's box can hit something in
its subtree. False by default: hit-testing prunes a subtree by its box,
as Flutter does, so a pointer event walks one chain of the tree rather
than every region. A container that places children outside its box
and wants them to stay interactive there — a
Stackwith an overflowingPositioned— answers true.no setterinherited - isRepaintBoundary → bool
-
Whether this render object owns its own paint cache (a
CellBufferit can blit instead of re-walking its subtree's paint). Override to true in subclasses that implement the cache discipline.no setterinherited - needsLayout → bool
-
Whether this render object must run performLayout the next time it is
reached with the same constraints. Constraints changes always force a new
layout even when this flag is false.
no setterinherited
- needsPaint ↔ bool
-
Whether the enclosing boundary's cache has been invalidated. Set true
by markNeedsLayout and markNeedsPaintOnly; subclasses that implement
a paint cache clear it once they have re-painted into their cache.
getter/setter pairinherited
- paintOverflow → CellRect?
-
Conservative local bounds when this subtree can paint outside size.
Null means its layout box contains all paint. Containers derive this
from presented children, their offsets and clips. Results are cached;
layout or paint invalidation invalidates the enclosing bounds as well.
Custom painters that draw beyond their box override computePaintOverflow.
no setterinherited
- parent → RenderObject?
-
no setterinherited
- parentData ↔ ParentData?
-
getter/setter pairinherited
- rootFrameDamage → RenderDamageTracker?
-
The frame damage tracker attached at this tree's root — the per-owner
object a render object publishes frame-scoped facts into — or null while
detached or before the first frame.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → CellSize
-
The size computed by the most recent layout pass.
no setterinherited
Methods
-
adoptChild(
RenderObject child) → void -
Attaches
childto this render object as its parent. Subclasses that hold children call this whenever they accept one; it also gives the parent a chance to ensure RenderObject.parentData is the right type via setupParentData.inherited -
attachFrameDamageTracker(
RenderDamageTracker tracker) → bool -
Attaches the per-runtime damage tracker at this (root) render object.
inherited
-
childClipOf(
RenderObject child) → CellRect? -
The clip this render object imposes on
child, in its own coordinates, or null when it does not clip. Usually the same rectangle for every child (a viewport); a container with several scrolling regions — a table with a pinned header — answers per child.inherited -
childOffsetOf(
RenderObject child) → CellOffset -
Where this render object paints
child, relative to its own origin.inherited -
computeMaxIntrinsicHeight(
int? width) → int -
The tallest this render object would want to be at the given
width.override -
computeMaxIntrinsicWidth(
int? height) → int -
The widest this render object would want to be at the given
height. Most relevant override: text returns its unwrapped width.override -
computeMinIntrinsicHeight(
int? width) → int -
The shortest this render object can be at the given
width.override -
computeMinIntrinsicWidth(
int? height) → int -
The narrowest width below which content would clip. Text-like leaves
can return a longest-token width if they word-wrap.
override
-
computePaintOverflow(
) → CellRect? -
inherited
-
dropChild(
RenderObject child) → void -
Detaches
childfrom this render object.inherited -
layout(
CellConstraints constraints) → CellSize -
Lays out this render object against
constraintsand returns the chosen size. Subclasses implement performLayout rather than overriding this; the framework needs the bookkeeping around it.inherited -
markAncestorRepaintBoundariesDirty(
) → void -
Marks every repaint boundary STRICTLY ABOVE this node as needing paint.
inherited
-
markNeedsLayout(
) → void -
Marks this render object and its ancestors as needing layout, and marks
the nearest enclosing repaint boundary as dirty. Use this for changes
that can affect size, child constraints, child offsets, or layout-derived
paint state.
inherited
-
markNeedsPaintOnly(
) → void -
Marks this render object's painted output as stale without touching
layout.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
CellBuffer buffer, CellOffset offset) → void -
Paints this render object into
bufferatoffset: its origin in the buffer's coordinates. The buffer's bounds are the clip.inherited -
performLayout(
CellConstraints constraints) → CellSize -
Override to compute the chosen size and lay out children. Must
return a size that satisfies
constraints.override -
performPaint(
CellBuffer buffer, CellOffset offset) → void -
Paints this render object's cells into
bufferatoffset.override -
presentsChild(
RenderObject child) → bool -
Whether
childis presented this frame: painted and interactive. False for a child hidden by policy — an inactiveIndexedStackchild, a route under an opaque route, an overlay entry under an opaque one, a list row outside the mounted window, a contained-error subtree.inherited -
screenGeometry(
) → RenderGeometry? -
This render object's screen geometry, derived from layout state: where
it is, and how much of it is visible.
inherited
-
setupParentData(
RenderObject child) → void -
Override to install a subclass of ParentData on the child. The
default is a no-op; multi-child render objects override this so a
child's
parentDatais always the type that parent expects.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
visitRenderChildren(
void visitor(RenderObject child)) → void -
Visits this render object's children in paint order. The default reads
the single-child / multi-child interfaces; a container whose
RenderObjectWithChildren.children accessor copies its list overrides
this to iterate in place, since hit-testing and geometry tooling walk
the tree on every event.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited