Skip to content
pubscout

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.

$ flutter pub add flutter_gpu_shaders
Source repository

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.

  • webdev

    A command-line tool for developing and deploying web applications with Dart.

  • msix

    CLI tool that creates MSIX installers from Flutter Windows build outputs.

  • git_stamp

    Embeds Git commit, branch, and build metadata into Flutter apps with optional UI screens.

Works with

Packages commonly used together with flutter_gpu_shaders: ones it builds on, ones built on it, and its own family.