StatefulElement class

Element for a StatefulWidget.

Inheritance
Available extensions

Constructors

StatefulElement(StatefulWidget widget)

Properties

child → Element?
The element below this one in the tree, if any.
no setterinherited
colors → ColorScheme

Available on BuildContext, provided by the FleuryThemeContext extension

Shorthand for Theme.of(this).colorScheme. Establishes a dependency on the same scope — equivalent to theme.colorScheme.
no setter
depth → int
no setterinherited
dirty → bool
no setterinherited
elementParent → Element?
The element this one was mounted under, or null for the root.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
mounted → bool
True while the underlying element is in the tree.
no setterinherited

Available on BuildContext, provided by the NavigatorContext extension

The nearest NavigatorState.
no setter
owner → BuildOwner
no setterinherited
rootNavigator → NavigatorState

Available on BuildContext, provided by the NavigatorContext extension

The app's root NavigatorState.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → State<StatefulWidget>
The state object backing this element.
no setter
theme → ThemeData

Available on BuildContext, provided by the FleuryThemeContext extension

Shorthand for Theme.of(this). Establishes a dependency.
no setter
widget → StatefulWidget
The widget currently mounted at this location.
no setteroverride

Methods

activate() → void
Subclass hook mirroring State.activate; the default is a no-op.
override
activeChildOrNull(Element? child) → Element?
child if it is still this element's active child, else null.
inherited
attachRenderObject() → void
Reattaches the render objects at the top of this subtree to the nearest ancestor render object. Inverse of detachRenderObject.
inherited
buildChild() → Widget
Subclasses produce the child widget here.
override
deactivate() → void
Subclass hook mirroring State.deactivate; the default is a no-op.
override
detachRenderObject() → void
Detaches the render objects at the top of this subtree from the ancestor render object. The default walks down through child elements; RenderObjectElement overrides it to detach its own render object and stop (the subtree below that render object travels with it).
inherited
findAncestorStateOfType<T extends State<StatefulWidget>>() → T?
Walks ancestors looking for an Element whose state is of type T. Does not establish a dependency.
inherited
findRenderObject() → RenderObject?
Walks down through component elements until a render-object element is found, returning that render object (or null when this context isn't mounted or has no render-object descendant). Does not establish a dependency.
inherited
forgetChild(Element child) → void
Called on this element's current parent when the element is being reclaimed by a different parent (via a GlobalKey move) while still active. The parent drops its reference so it won't later try to update or unmount a child that has moved away. The default is a no-op (leaf elements hold no children); container elements override it.
inherited
inflateWidget(Widget newWidget) → Element
Creates an element for newWidget and mounts it under this element.
inherited
listen<T extends Listenable>(T source) → T
Observes source during this widget's build and returns the same object.
inherited
markNeedsBuild() → void
Marks this element as needing a rebuild on the next flush.
inherited
mount(Element? parent) → void
Inserts this element into the tree at the given parent.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performRebuild() → void
Subclasses do the actual rebuild work here. The framework clears the dirty bit BEFORE calling this method.
inherited
pop([Object? result]) → void

Available on BuildContext, provided by the NavigatorContext extension

Pops the current screen with an optional result, ignoring PopScope (see NavigatorState.pop).
popToRoot() → void

Available on BuildContext, provided by the NavigatorContext extension

Pops every screen above the root.
popUntil<T extends Widget>() → void

Available on BuildContext, provided by the NavigatorContext extension

Pops until the top screen is a T.
present<T>(Widget screen, {Alignment alignment = Alignment.center, RouteTransition? transition, Color? barrierColor, bool barrierDismissible = true}) → Future<T?>

Available on BuildContext, provided by the NavigatorContext extension

Presents screen as a modal over the current screen (centered by default), on an opaque fill. Dismiss with pop. barrierColor fills the surround; barrierDismissible (default true) controls Esc.
push<T>(Widget screen, {RouteTransition? transition}) → Future<T?>

Available on BuildContext, provided by the NavigatorContext extension

Pushes screen; awaits its pop result.
pushAndClear<T>(Widget screen, {RouteTransition? transition}) → Future<T?>

Available on BuildContext, provided by the NavigatorContext extension

Pushes screen and clears the stack beneath it (the reset idiom).
pushReplacement<T>(Widget screen, {RouteTransition? transition, Object? result}) → Future<T?>

Available on BuildContext, provided by the NavigatorContext extension

Replaces the current screen with screen (the login → home idiom).
rebuild({bool force = false}) → void
Performs a rebuild if the element is dirty.
inherited
rebuildDirtyDescendants() → void
Rebuilds the dirty elements below this one, shallowest first.
inherited
replaceChildWithError(Element? child, Object error, StackTrace stack) → Element?
Contains a child update that threw the way a thrown build is contained: reports error to BuildOwner.onBuildError and puts the owner's error widget in the slot child occupied.
inherited
runWithBuildTarget<T>(T fn()) → T
Runs fn with this element as the active build target (current), so listenables read inside it (context.listen, Animation.value) subscribe it for this build. Restores the previous target on the way out (stack discipline for nested builds). For any element that invokes a build callback — including outside the build phase (e.g. a layout-time builder).
inherited
scope<T>() → T
Reads the nearest Scope declared with type T and subscribes this widget to it.
inherited
toString() → String
A string representation of this object.
inherited
toStringDeep([String prefix = '']) → String
Multi-line indented dump of this subtree, one element per line. Intended for test failure messages — not for runtime logging.
inherited
toStringShallow() → String
One-line description of this element. Includes runtime type, the widget runtime type, and the key when present.
inherited
unmount() → void
Removes this element from the tree permanently.
override
update(covariant StatefulWidget newWidget) → void
Replaces the widget configuration backing this element.
override
updateChild(Element? child, Widget? newWidget) → Element?
Reconciles a single child slot.
inherited
visitChildren(void visitor(Element child)) → void
Visits each direct child element.
inherited

Operators

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