IndexedStack class final
Shows the child at index and keeps the rest mounted but unpainted, so their state survives switching between them — the basis for tabbed or paged surfaces that must remember each page. Sized to the largest child; an out-of-range index shows nothing.
- Inheritance
-
- Object
- Widget
- RenderObjectWidget
- MultiChildRenderObjectWidget
- IndexedStack
- Available extensions
Constructors
-
IndexedStack({Key? key, int index = 0, List<
Widget> children = const []}) -
const
Properties
-
children
→ List<
Widget> -
The widgets below this widget in the tree, in layout and paint order.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
Which child to paint. Out-of-range paints nothing.
final
- key → Key?
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
animate(
{Duration? duration, Curve? curve, Object? trigger, bool repeat = false}) → Animate -
Available on Widget, provided by the AnimateExtension extension
Starts an Animate chain over this widget.duration/curveapply to the whole chain. With notriggerit plays on mount; with a non-null trigger it rests on mount and replays whenever the token changes. -
createElement(
) → MultiChildRenderObjectElement -
Creates the Element that will mount this widget into the tree.
override
-
createRenderObject(
BuildContext context) → RenderObject -
Creates the render object backing this widget. Called once when the
element first mounts.
override
-
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 RenderIndexedStack renderObject) → void -
Applies any changes from a new widget instance to the existing
render object. Default is a no-op; subclasses override when the
widget carries layout/paint configuration.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited