DissolveEffect class
A shader-based dissolve effect that disintegrates a child widget.
Uses layered value noise to create an organic dissolve pattern with bright white-orange spark edges at the dissolution boundary. This effect requires a child widget to be provided in GKWidget.
The progress value drives the dissolve: 0.0 is fully visible, 1.0 is fully dissolved. You can animate this via the GKController or pass a fixed value.
{@tool snippet}
GKWidget(
effect: DissolveEffect(
progress: 0.5,
noiseScale: 4.0,
edgeSoftness: 0.1,
),
child: Image.asset('assets/photo.png'),
)
{@end-tool}
Constructors
- DissolveEffect({double progress = 0.0, double noiseScale = 4.0, double edgeSoftness = 0.1})
-
Creates a DissolveEffect.
const
Properties
- edgeSoftness → double
-
The width of the glowing spark edge at the dissolve boundary.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- noiseScale → double
-
The frequency of the dissolve noise pattern.
final
- progress → double
-
The dissolve progress from 0.0 (fully visible) to 1.0 (fully dissolved).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context, GKController controller, {Widget? child}) → Widget -
Builds the widget tree for this effect.
override
-
dispose(
) → void -
Override to release resources held by this effect.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited