DataAsset.fromEncoded constructor

DataAsset.fromEncoded(
  1. EncodedAsset asset
)

Constructs a DataAsset from an EncodedAsset.

Implementation

factory DataAsset.fromEncoded(EncodedAsset asset) {
  assert(asset.type == DataAsset.type);
  final jsonMap = asset.encoding;
  return DataAsset(
    name: jsonMap.string(_nameKey),
    package: jsonMap.string(_packageKey),
    file: jsonMap.path(_fileKey),
  );
}