ColorOpacityEffect class

An effect that animates a Paint's opacity by mutating its alpha.

Every variant is the same line - base + span * progress - so the constructors differ only in what they put in those two fields. A null _base means the alpha is read when the effect builds rather than being fixed up front.

Inheritance
Available extensions

Constructors

ColorOpacityEffect.by({required Paint paint, required double opacity, required EffectController controller, bool? cleanup, bool? enabled})
Shifts paint's opacity by opacity, relative to its alpha when this effect starts.
ColorOpacityEffect.fadeIn({required Paint paint, required EffectController controller, bool? cleanup, bool? enabled})
Fades paint in from fully transparent to fully opaque.
ColorOpacityEffect.fadeOut({required Paint paint, required EffectController controller, bool? cleanup, bool? enabled})
Fades paint out from fully opaque to fully transparent.

Properties

ancestors Iterable<Node>
This node's ancestors in the tree.
no setterinherited
children Iterable<Node>
This node's direct children.
no setterinherited
cleanup bool
Whether to detach once finished. Defaults to false.
getter/setter pairinherited
controller EffectController
Drives this effect.
finalinherited
descendants Iterable<Node>
This node's descendants in depth-first preorder.
no setterinherited
enabled bool
Whether this node updates and renders. Defaults to true.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hasParent bool
True if this node has a non-null parent.
no setterinherited
isFinished bool
Whether this effect has finished and no longer needs updating.
no setterinherited
isForward bool
Whether this effect is running in the forward direction.
no setterinherited
isMounted bool
True while this node is part of a mounted tree.
no setterinherited
isReverse bool
Whether this effect is running in the reverse direction.
no setterinherited
isRunning bool
Whether this effect has started progressing.
no setterinherited
onFinish Signal0
Emitted once, when this effect finishes progressing.
finalinherited
onMax Signal0
Emitted each time progress reaches 1.
finalinherited
onMin Signal0
Emitted each time progress reaches 0.
finalinherited
onMount Signal0
Emitted when this node is added to a scene.
finalinherited
onProgress Signal1<double>
Emitted after each update once this effect starts progressing, with its current progress.
finalinherited
onSceneResize Signal1<Vector2>
Emitted when the scene resizes, and once at mount.
finalinherited
onStart Signal0
Emitted once, when this effect starts progressing.
finalinherited
onUnmount Signal0
Emitted when this node is removed from a scene.
finalinherited
paint Paint
The paint whose alpha channel is mutated as this effect progresses.
final
parent Node?
The parent that owns this node, or null when it is parentless.
no setterinherited
previousProgress double
This effect's progress as of the previous onProgress emission.
no setterinherited
priority int
This node's order in updating and rendering in its parent. Defaults to 0.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scene Scene<Node>
This node's owning scene. Only valid while isMounted.
no setterinherited

Methods

add<T extends Node>(T node) → T
Adds node to this node. The node is returned.
inherited
addAll(Iterable<Node> nodes) → void
Adds all nodes to this node.
inherited
attach(Node node) → void
Adds this node to the target node.
inherited
build() → void
Declares this node's children and behavior.
override
contains(Node other) bool
Checks if this node contains the other node in its tree.
inherited
containsPoint(Vector2 point) bool
Whether this node's hit area contains point.
inherited
cycles(Node node) bool
True if node is (or soon will be) an ancestor of this node.
inherited
debugDraw(DebugDraw draw) → void
Draws to the debug overlay every frame, in the same space as draw.
inherited
debugRender(Canvas canvas) → void
Renders the debug overlay for this node and its children to canvas.
inherited
debugRenderSelf(Canvas canvas) → void
Runs this node's debugDraw callbacks, in the same space as renderSelf.
inherited
detach() bool
Removes this node from its parent, or from the parent it is on its way to.
inherited
disable() → void
Disables this node, so it stops updating and rendering.
inherited
draw(Draw draw) → void
Draws to canvas every frame, in this node's own coordinate space.
inherited
enable() → void
Enables this node, so it resumes updating and rendering.
inherited
forward() → void
Run this effect in its forward direction.
inherited
hitTest(Vector2 point) Iterable<Node>
Finds every enabled node in this subtree whose hit area contains point, per containsPoint, topmost first.
inherited
mount() Scene<T>

Available on T, provided by the Mount extension

Mounts this node as the root of a new Scene and returns it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
owns(Node other) bool
Checks if this node owns the other node.
inherited
provide<T>(T value) → void
Provides value as this node's instance of T, overwriting any value previously provided for T.
inherited
query<T extends Node>() Iterable<T>
This node's direct children of type T, in priority order.
inherited
read<T>() → T
Reads the nearest instance of T provided by this node or an ancestor, checking this node first.
inherited
readOrNull<T>() → T?
Reads the nearest instance of T provided by this node or an ancestor, checking this node first. Returns null if none was provided.
inherited
reassemble() → void
What this node does when the tree is reassembled.
inherited
rebuild() → void
Re-derives this node by running build again over the wreckage of the last one.
inherited
remove(Node node) bool
Removes the child node.
inherited
removeAll() → void
Removes all children.
inherited
render(Canvas canvas) → void
Renders this node and its children to canvas.
inherited
renderSelf(Canvas canvas) → void
Runs this node's draw callbacks.
inherited
reset() → void
Resets this effect back to its start.
inherited
reverse() → void
Run this effect in its reverse direction.
inherited
tick(Tick tick) → void
Calls tick with the elapsed seconds on every frame.
inherited
toString() String
A string representation of this object.
inherited
trash(Cleanup cleanup) → void
Defers cleanup until this build stops being current.
inherited
update(double dt) → void
Updates this node and its children by dt seconds.
inherited

Operators

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