Asset constructor
Asset({})
Creates an instance of Asset.
The path parameter is the path to the asset.
The type parameter specifies the type of the asset (JS or CSS).
The cache parameter controls the cache policy for the asset.
Implementation
Asset({
required String path,
this.type = AssetType.none,
this.cache = AssetCache.appVersion,
this.data = const {},
this.attrs = const {},
}) {
_path = path;
if (type == AssetType.none) {
final extention = p.extension(path).toLowerCase();
switch (extention) {
case '.js':
type = AssetType.js;
break;
case '.css':
type = AssetType.css;
break;
}
}
}