AnimatedWidgetBaseState<T extends ImplicitlyAnimatedWidget> class
abstract
Base state class for ImplicitlyAnimatedWidget.
Subclasses must override forEachTween to register tweens for each animatable property, and build to use the current tween values.
class _AnimatedOpacityState
extends AnimatedWidgetBaseState<AnimatedOpacity> {
Tween<double>? _opacity;
@override
void forEachTween(TweenVisitor visitor) {
_opacity = visitor(
_opacity,
widget.opacity,
(value) => Tween<double>(begin: value as double, end: value),
) as Tween<double>?;
}
@override
Widget build(BuildContext context) {
return Opacity(
opacity: _opacity?.evaluate(controller) ?? widget.opacity,
child: widget.child,
);
}
}
- Inheritance
- Mixed-in types
Constructors
Properties
- context ↔ BuildContext
-
The build context for this state.
getter/setter pairinherited
- controller → AnimationController
-
The animation controller driving the implicit animation.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- mounted → bool
-
Whether this state is currently mounted in the element tree.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- widget ↔ T
-
The current configuration for this state.
getter/setter pairinherited
Methods
-
build(
BuildContext context) → Widget -
Builds the widget subtree for this state.
inherited
-
createAnimationController(
{double? value, Duration? duration, Duration? reverseDuration, double lowerBound = 0.0, double upperBound = 1.0, int fps = 30, Object? id}) → AnimationController -
Creates and registers an AnimationController.
inherited
-
didUpdateWidget(
covariant T oldWidget) → Cmd? -
Called when the widget configuration changes.
override
-
dispose(
) → void -
Disposes all registered controllers and clears the list.
inherited
-
forEachTween(
TweenVisitor visitor) → void - Called to register tweens for each animatable property.
-
handleInit(
) → Cmd? -
Called once when the widget tree is first mounted.
inherited
-
handleIntercept(
Msg msg) → Cmd? -
Called before children during message dispatch.
inherited
-
handleUpdate(
Msg msg) → Cmd? -
Intercepts AnimationTickMsg and dispatches it to the matching
controller via AnimationController.processTick.
inherited
-
initState(
) → void -
Called when the state is inserted into the tree.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerAnimationController(
AnimationController controller) → void -
Registers an externally-created
controllerfor tick dispatch and automatic disposal.inherited -
setState(
void fn()) → void -
Notifies the framework that this state's internal data has changed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterAnimationController(
AnimationController controller) → bool -
Unregisters a
controllerso it no longer receives tick dispatch and is no longer automatically disposed.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited