generateAssetClassTemplate method
Generates a complete Dart class template for asset constants.
Creates a class with static const fields for each asset in the directory, following Dart naming conventions and including proper documentation.
Parameters:
projectName: The project name for class namingdirectoryName: The asset directory name for class namingassets: List of assets to include in the classassetsBasePath: Base path for asset references
Returns the complete Dart class as a string.
Implementation
String generateAssetClassTemplate({
required String projectName,
required String directoryName,
required List<Asset> assets,
required String assetsBasePath,
}) {
final className = '${projectName.pascalCase}${directoryName.pascalCase}';
final packagePath = _buildPackagePath(assetsBasePath);
final template = ClassTemplate(
className: className,
packagePath: packagePath,
assets: assets,
directoryName: directoryName,
);
return template.render();
}