url property
String
get
url
Returns the URL of the asset, considering cache settings.
The cache policy determines how the URL is constructed:
- AssetCache.never: Adds a version based on the current timestamp.
- AssetCache.appVersion: Adds the application version from the configuration.
Implementation
String get url {
if (cache == AssetCache.never) {
return rq.url(
_path,
params: {
'vr': "v1.${DateTime.now().millisecondsSinceEpoch}",
},
);
} else if (cache == AssetCache.appVersion) {
return rq.url(
_path,
params: {
'vr': "v${WaServer.config.version}",
},
);
} else {
return rq.url(_path);
}
}