save method

Future<void> save(
  1. String fileName
)

Implementation

Future<void> save(String fileName) async {
  final file = File(fileName);
  final encoder = JsonEncoder.withIndent('  ');
  final jsonString = encoder.convert(toJson());
  await file.writeAsString(jsonString);
}