replaceInFile static method
Replaces all occurrences of from with to in the file at path.
Implementation
static void replaceInFile(String path, String from, String to) {
final file = File(path);
if (!file.existsSync()) return;
final content = file.readAsStringSync();
file.writeAsStringSync(content.replaceAll(from, to));
}