# AssetResource constructor

AssetResource(

1. Object source

)

Factory constructor for creating an AssetResource.

- If the `source` is an Asset, it delegates to `_AssetResource.fromAsset(source)`.
- Otherwise, it wraps the `source` directly.

### Example

    final resource1 = AssetResource('{"name":"test"}'); // from content
    final asset = FileAsset('/path/to/file.json');
    final resource2 = AssetResource(asset); // from an Asset

## Implementation

    factory AssetResource(Object source) {
      if (source is Asset) return _AssetResource.fromAsset(source);
      return _AssetResource(source);
    }