Update 2026-05-12: This is available under flutter config --enable-dart-data-assets. Please report any issues that you find.
Update 2026-09-29: With @RecordUse() info available in link hooks since Dart 3.13, this experiment can be used to do tree-shaking of assets (#64106).
The hook/build.dart of packages should be able to not only add native code assets, but also data assets.
In Flutter, these data assets should be made available through the existing asset bundle API.
This issue tracks the flutter implementation for this in flutter tools.
Tracking issue for Dart and Flutter combined:
Umbrella issue for native assets:
cc @mosuem @andrewkolos @christopherfujino
Update 2026-05-12: This is available under
flutter config --enable-dart-data-assets. Please report any issues that you find.Update 2026-09-29: With
@RecordUse()info available in link hooks since Dart 3.13, this experiment can be used to do tree-shaking of assets (#64106).The
hook/build.dartof packages should be able to not only add native code assets, but also data assets.In Flutter, these data assets should be made available through the existing asset bundle API.
This issue tracks the flutter implementation for this in flutter tools.
data_assettoBuildConfig.supportedAssetTypes.DataAsset]s fromBuildOutput.assetsin Flutter applications (on all 5 OSes, in all modes).Tracking issue for Dart and Flutter combined:
Umbrella issue for native assets:
cc @mosuem @andrewkolos @christopherfujino