writeToFile method
Implementation
Future writeToFile(File targetFile) {
final ioSink = targetFile.openWrite();
try {
YamlToString().writeYamlString(this.toJson(), ioSink);
} catch (e) {
throw DartBomException('$e', 5);
} finally {
return ioSink.close();
}
}