overwriteFile method
AFGeneratedFile
overwriteFile(
- AFCommandContext context,
- List<
String> projectPath, - dynamic templateOrId, {
- Map<
AFSourceTemplateInsertion, AFSourceTemplate> ? insertions,
Used for generated files which always get overwritten.
Implementation
AFGeneratedFile overwriteFile(AFCommandContext context, List<String> projectPath, dynamic templateOrId, {
Map<AFSourceTemplateInsertion, AFSourceTemplate>? insertions,
}) {
final generated = _createFile(context, projectPath, templateOrId, AFGeneratedFileAction.overwrite);
if(insertions != null && !context.isExportTemplates) {
final insert = AFSourceTemplateInsertions(insertions: insertions);
generated.performInsertions(context, insert);
}
return generated;
}