generateAssetConstant method
Generates a single asset constant definition.
Creates a properly formatted static const field for an individual asset.
Parameters:
asset: The asset to generate a constant forpackagePath: The package path prefix for the asset
Returns the constant definition as a string.
Implementation
String generateAssetConstant(Asset asset, String packagePath) {
final constantName = asset.toConstantName();
final assetPath = '$packagePath/${asset.fileName}';
return " static const String $constantName = '$assetPath';";
}