ShaderProgram class

Abstraction for a shader program (vertex + fragment).

On Canvas: uses Paint shaders (limited to gradients, images). On GPU (future): uses GLSL/Metal compiled shaders.

Constructors

ShaderProgram({required String name, String? vertexSource, String? fragmentSource})

Properties

fragmentSource String?
final
hashCode int
The hash code for this object.
no setterinherited
isLoaded bool
no setter
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vertexSource String?
final

Methods

dispose() → void
loadFromAsset(String assetPath) Future<void>
Loads a fragment shader from a Flutter asset (SPIR-V or SkSL).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setColor(String name, Color color) → void
Sets a uniform vec4 value (color).
setFloat(String name, double value) → void
Sets a uniform float value.
setVec2(String name, double x, double y) → void
Sets a uniform vec2 value.
toPaint() Paint?
Returns a Paint configured with this shader.
toString() String
A string representation of this object.
inherited

Operators

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