Adding shaders to an application

Shaders, in the form of GLSL files with the .frag extension,
must be declared in the shaders section of your project’s pubspec.yaml file.
The Flutter command-line tool compiles the shader to its appropriate backend format,
and generates its necessary runtime metadata.
The compiled shader is then included in the application just like an asset.

flutter

shaders

shaders/myshader.frag

When running in debug mode,
changes to a shader program trigger recompilation
and update the shader during hot reload or hot restart.

Shaders from packages are added to a project
with packages/$pkgname prefixed to the shader program’s name
(where $pkgname is the name of the package).

Loading shaders at runtime