getTemplatePath method

File? getTemplatePath(
  1. String templateName, {
  2. Directory? templatesDir,
})

Gets the path to the template file requested.

Implementation

File? getTemplatePath(String templateName, {Directory? templatesDir}) {
  final Directory templateDir =
      templatesDir ?? configuration.templatesDirectory;
  final File templateFile = configuration.filesystem
      .file(path.join(templateDir.path, '$templateName.tmpl'));
  return templateFile.existsSync() ? templateFile : null;
}