download_transformer 1.0.2
download_transformer: ^1.0.2 copied to clipboard
A dart transformer for downloading assets. This is useful, if you don't have to check in large assets or want to pull assets from a directory shared with non-programmers.
Download Transformer #
Download Transformer is a simple asset transformer that fetches files over HTTPS at compile time. Ideal for managing large assets without checking them into source control or sharing assets with non-programmers.
Installation #
Add download_transformer to your dev_dependencies in pubspec.yaml:
dev_dependencies:
download_transformer: ^1.0.0
Usage #
-
Create an empty placeholder
In your assets folder, add an empty file named after the target asset, e.g.,
texture_atlas.png. -
Specify the download URL
Open the file and insert the asset URL on a single line, for example:
https://dekeyser.ch/texture_atlas.png -
Configure the transformer
Reference the placeholder in your
pubspec.yamland attach the transformer:flutter: assets: - path: assets/texture_atlas.png transformers: - package: download_transformer -
Build your project
During compilation, the transformer replaces the placeholder with the downloaded asset.
That’s it! No more checked-in binaries—just maintain URLs and let the build process fetch your assets automatically.