shader static method

  1. @experimental
Animation shader(
  1. String asset, {
  2. Map<String, Object> uniforms = const {},
  3. Time? duration,
  4. Curve? ease,
  5. Spring? spring,
  6. Time delay = Time.zero,
  7. Trigger at = Trigger.auto,
  8. Stagger? stagger,
  9. Repeat? repeat,
  10. String? label,
})

Paints a custom fragment shader over the element — an experimental pixel post-effect.

Expands to Animation.custom(ShaderEffect(shaderName: asset, uniforms: uniforms)): the .frag at asset (registered under flutter: shaders:) is loaded once before frame 0 and painted over the rendered element. The shader's float slots are bound in a fixed order — resolution.x, resolution.y, progress, then each uniforms value (a num) in iteration order — so the GLSL contract is stable and deterministic.

A missing or invalid asset surfaces as a FluvieRenderException naming the asset. Experimental: the surface may change, and software-rasterizer fidelity varies by platform (goldens are pinned to the Linux baseline). The common tail forwards verbatim.

Implementation

@experimental
static Animation shader(
  String asset, {
  Map<String, Object> uniforms = const {},
  Time? duration,
  Curve? ease,
  Spring? spring,
  Time delay = Time.zero,
  Trigger at = Trigger.auto,
  Stagger? stagger,
  Repeat? repeat,
  String? label,
}) => buildShader(
  asset,
  uniforms,
  _tail(duration, ease, spring, delay, at, stagger, repeat, label),
);