addAssets function

void addAssets(
  1. Map<AssetId, dynamic> assets,
  2. InMemoryAssetWriter writer
)

Implementation

void addAssets(Map<AssetId, dynamic> assets, InMemoryAssetWriter writer) {
  assets.forEach((id, value) {
    if (value is String) {
      writer.assets[id] = utf8.encode(value);
    } else if (value is List<int>) {
      writer.assets[id] = value;
    } else {
      throw ArgumentError(
          '`assets` values must be of type `String` or `List<int>`, got '
          '${value.runtimeType}.');
    }
  });
}