Extensions for bzlmod.
Installs a flutter toolchain. Every module can define a toolchain version under the default name, "flutter". The latest of those versions will be selected (the rest discarded), and will always be registered by rules_flutter.
Additionally, the root module can define arbitrarily many more toolchain versions under different names (the latest version will be picked for each name) and can register them as it sees fit, effectively overriding the default named toolchain due to toolchain resolution precedence.
flutter = use_extension("@rules_flutter//flutter:extensions.bzl", "flutter")
flutter.toolchain(name, flutter_version, integrity, precache)
TAG CLASSES
Attributes
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | Base name for generated repositories, allowing more than one flutter toolchain to be registered. Overriding the default is only permitted in the root module. | Name | optional | "flutter" |
| flutter_version | Explicit version of flutter. | String | required | |
| integrity | Escape hatch for Flutter versions not in the built-in version table: a map from platform (macos, linux, windows) to the SRI integrity of that platform's stable release archive, e.g. {"macos": "sha256-...", "linux": "sha256-..."}. Only the platforms you actually build on need an entry (the per-platform SDK repositories are fetched lazily). When flutter_version is in the built-in table this may be omitted. Merged across registrations of the same name. | Dictionary: String -> String | optional | {} |
| precache | Artifact groups (web, android, ios, macos, linux, windows) that must be present in the SDK cache after fetch. Stable archives already ship these; when one is missing, flutter precache runs at repository fetch time. Unioned across registrations of the same toolchain name. |
List of strings | optional | [] |
pub = use_extension("@rules_flutter//flutter:extensions.bzl", "pub")
pub.package(name, package, version)
TAG CLASSES
Attributes
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | Repository name for the package | Name | required | |
| package | Package name on pub.dev | String | required | |
| version | Package version (optional, defaults to latest) | String | optional | "" |