addRuntimeAsset function

void addRuntimeAsset(
  1. Asset asset
)

Adds an Asset representing a non-Dart resource to the runtime context.

Assets typically include configuration files, text resources, JSON metadata, or other bundled, non-code artifacts that participate in reflection or generation workflows.

addRuntimeAsset(Asset('config.json', contents));

Assets added here are exposed via RuntimeProvider.getAllAssets. This API is internal-only and must be invoked before freezing.

Implementation

void addRuntimeAsset(Asset asset) => _InternalRuntime.addAsset(asset);