simpleTemplateToFileMap method

Map<String, File> simpleTemplateToFileMap(
  1. Directory targetDirectory,
  2. String fileNameBase
)

Maps every template to a filename in a simple way

Maps template name with file's name replacing filename string with fileNameBase parameter

All files will be located at the same targetDirectory

Implementation

Map<String, File> simpleTemplateToFileMap(
  Directory targetDirectory,
  String fileNameBase,
) {
  final files = <String, File>{};
  for (final templateName in templateNames) {
    files[templateName] = File(
      p.join(
        targetDirectory.path,
        templateToFilenameMap[templateName]!
            .replaceAll('filename', fileNameBase),
      ),
    );
  }
  return files;
}