ScanResult.fromMap constructor
Implementation
factory ScanResult.fromMap(Map<String, dynamic> map) {
final rawLabels = map['labels'] as List<dynamic>? ?? [];
return ScanResult(
identifier: map['identifier'] as String? ?? '',
mediaType: map['mediaType'] as String? ?? 'image',
labels: rawLabels
.map((e) => NsfwLabel.fromMap(Map<String, dynamic>.from(e as Map)))
.toList(),
frameCount: map['frameCount'] as int? ?? 1,
);
}