readTemplateFile method

Future<String> readTemplateFile(
  1. String filename
)

Reads template file

Implementation

Future<String> readTemplateFile(String filename) async {
  final filepath = p.join(templatesDirectoryPath, filename);
  final file = File(filepath);
  if (!file.existsSync()) {
    throw GenerateTemplatesUnreachableException(
      'cannot find template file "$filepath"',
    );
  }
  return file.readAsString();
}