deleteGeneratedDartFile function
Deletes the .g.dart file at filePath.
Implementation
Future<void> deleteGeneratedDartFile(
String filePath, {
void Function(String filePath)? onDelete,
Set<String> pathPatterns = const {},
}) async {
if (isGeneratedDartFilePath(filePath) &&
matchesAnyPathPattern(filePath, pathPatterns)) {
await deleteFile(filePath);
onDelete?.call(filePath);
}
}