getAsset function
Returns the full path for an asset in /assets directory. Usage e.g. getAsset('videos/welcome.mp4');
Returns a String.
Implementation
String getAsset(String asset) {
// remove the first slash if it exists
if (asset.startsWith('/')) {
asset = asset.substring(1);
}
return "${getEnv("ASSET_PATH")}/$asset";
}