CoffeeFile.fromJson constructor
Implementation
factory CoffeeFile.fromJson(Map<String, dynamic> json) {
return CoffeeFile(
id: json['id'] ?? 0,
name: json['name'] as String?,
size: json['size'] as int?,
extension: json['extension'] as String?,
path: json['path'] as String?,
file: json.containsKey('file') && json['file'] != null ? File(json['file']['path']) : null,
isDefault: json['isDefault'] as bool? ?? false,
);
}