writeToFile method
Overwrites the file with content.
Throws if the path was not set with setFilePath.
Implementation
void writeToFile(String content) {
if (_filePath == null || _filePath == "") {
throw Exception("File path not set");
} else {
_file!.writeAsStringSync(content);
}
}