updateFileContent static method
Updates the contents of the file at the given filePath by replacing
all occurrences of oldString with newString.
Throws an exception if the file cannot be read or written to.
Implementation
static Future<void> updateFileContent({
required String oldString,
required String newString,
required String filePath
}) async {
final file = File(filePath);
String content = await file.readAsString();
content = content.replaceAll(oldString, newString);
await file.writeAsString(content);
}