getTemplatePath static method
Implementation
static Future<String> getTemplatePath(String relativePath) async {
final uri = await Isolate.resolvePackageUri(
Uri.parse('package:fd_arch_gen/'),
);
if (uri == null) {
throw Exception('Could not resolve fd_arch_gen package');
}
final packageRoot = Directory.fromUri(uri).path;
final templatePath = path.join(packageRoot, 'templates', relativePath);
if (!File(templatePath).existsSync()) {
throw Exception('Template not found: $relativePath');
}
return templatePath;
}