saveAsJson method
Saves a json-serializable map into a newly created file with the path
filePath
Implementation
@override
Future<File> saveAsJson(String fileName) async {
final file = await File(fileName).create(recursive: true);
final json = jsonEncode(toJson());
return file.writeAsString(json);
}