flutter_gpu_shaders
0.5.2, released 3 months ago by bdero.dev
Build tool that compiles Flutter GPU shader bundles via a build hook.
What it does
Provides a build hook to compile vertex/fragment shader files into a bundled asset for Flutter GPU. It tracks engine and file dependencies and can register the bundle with DataAssets when available.
AI-written summary of version 0.5.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to include custom GPU shaders in a Flutter app
- You want automatic rebuilds of shader bundles on source changes or engine updates
Skip it when
- Your app does not use Flutter GPU shaders
- You prefer runtime shader compilation instead of build‑time bundling
Strengths
- Integrates with Flutter's build system via hooks
- Tracks engine binary changes to trigger rebuilds
- Supports optional DataAssets registration
Weaknesses
- Only handles shader bundling, not general asset management
- Requires a manifest file and manual hook setup
- Limited to platforms supported by Impeller
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Add a hook/build.dart script that calls buildShaderBundleJson, create a .shaderbundle.json manifest, and list the generated bundle in pubspec assets or use DataAssets mode.
import 'package:hooks/hooks.dart';
import 'package:flutter_gpu_shaders/build.dart';
void main(List<String> args) async {
await build(args, (config, output) async {
await buildShaderBundleJson(
buildInput: config,
buildOutput: output,
manifestFileName: 'my_cool_bundle.shaderbundle.json');
});
}Alternatives
Packages that do the same job and could replace flutter_gpu_shaders.
- native_toolchain_rust
Build and bundle Rust code into a Dart/Flutter project via build hooks.
88Compare - webdev
A command-line tool for developing and deploying web applications with Dart.
85Compare - msix
CLI tool that creates MSIX installers from Flutter Windows build outputs.
77Compare - git_stamp
Embeds Git commit, branch, and build metadata into Flutter apps with optional UI screens.
57Compare
Works with
Packages commonly used together with flutter_gpu_shaders: ones it builds on, ones built on it, and its own family.
- cryptoflutter_gpu_shaders depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- hooksflutter_gpu_shaders depends on itDart API for the JSON-based protocol for package build and link hooks.
- loggingflutter_gpu_shaders depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- data_assetsflutter_gpu_shaders depends on itProtocol specification for bundling data assets with Dart and Flutter packages using build hooks.
- flutter_sceneBuilt on flutter_gpu_shadersA 3D game engine for Flutter built on Flutter GPU with PBR lighting and glTF support.
- liquid_glass_rendererBuilt on flutter_gpu_shadersiOS 27-style liquid glass renderer for Flutter with refraction, frost, and tint.
- glint_engineBuilt on flutter_gpu_shadersA Flutter-first 3D engine for rendering glTF models with physics and a real‑time game loop.