save method
Save the config data to the file.
Implementation
Future<ConfigFile> save({bool compact = false}) async {
if (!file.existsSync()) {
file.createSync(recursive: true);
data = defaultValue;
}
if (compact) {
await file.writeAsString(jsonEncode(data));
} else {
await file
.writeAsString(const JsonEncoder.withIndent(" ").convert(data));
}
return this;
}