LiquidEffect class

A shader-based liquid flow effect.

Renders smooth, organic color waves that mix and interfere like flowing liquid. The movement is controlled by speed and the thickness of the blending by viscosity.

{@tool snippet}

GKWidget(
  effect: LiquidEffect(
    speed: 1.0,
    viscosity: 0.5,
    colors: [Colors.purple, Colors.blue, Colors.cyan],
  ),
  trigger: GKTrigger.auto,
)

{@end-tool}

Inheritance

Constructors

LiquidEffect({double speed = 1.0, double viscosity = 0.5, List<Color> colors = const [Color(0xFF9C27B0), Color(0xFF2196F3), Color(0xFF00BCD4)]})
Creates a LiquidEffect.
const

Properties

colors List<Color>
The three colors blended by wave interference.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
speed double
Animation speed multiplier.
final
viscosity double
Viscosity from 0.0 (thin, fast blending) to 1.0 (thick, slow blending).
final

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