ShaderLibrary class base

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shaders_ Map<String, Shader?>
final

Methods

debugReinitializeFromAsset(String assetName) String?
Test-only. Reloads this library from assetName's bytes while keeping this library's identity and registry key. Production hot reload always re-fetches the original asset path via reinitialize; this hook lets tests simulate an edited bundle by swapping in a different fixture.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reinitializeFromBytes(ByteData bytes) String?
Reparses bytes into this library in place, preserving its identity so any Shaders already handed out keep working (they are mutated and marked dirty so the next pipeline build re-registers them). The counterpart to reinitialize for a fromBytes library, which has no asset path to re-fetch. Use it to swap in a recompiled shader bundle.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String shaderName) Shader?

Static Methods

fromAsset(String assetName) Future<ShaderLibrary?>
Loads the shader bundle at assetName and returns its ShaderLibrary, or null if the bundle could not be parsed.
fromBytes(ByteData bytes) Future<ShaderLibrary?>
Loads a ShaderLibrary directly from a shader bundle's bytes (the contents of a .shaderbundle compiled by impellerc), rather than from a bundled asset. This suits shader bundles produced or fetched at runtime, which have no entry in the asset manifest that fromAsset resolves.
reinitialize(String assetKey) → void
Re-fetches assetKey through the asset manager and reparses it into the cached ShaderLibrary for that key, marking each shader dirty so the next pipeline build evicts and re-registers it. The primary caller is the ext.ui.gpu.reinitializeShaderLibrary service extension driving hot reload from flutter_tools; tests may also call this directly. No-ops if no library has been loaded for assetKey.