writeMatchersToFile method
void
writeMatchersToFile({})
Writes the generated matchers for the properties of W
to a file.
Implementation
void writeMatchersToFile({
required String path,
Map<String, String> propNameOverrides = const {},
String? imports,
bool Function(DiagnosticsNode node)? filter,
}) {
final content = createMatcherString(
propNameOverrides: propNameOverrides,
imports: imports,
filter: filter,
);
final file = File(path);
if (content == null) {
if (file.existsSync()) {
file.deleteSync();
}
} else {
file
..createSync(recursive: true)
..writeAsStringSync(content);
}
}