NsfwScanProgress.fromMap constructor

NsfwScanProgress.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory NsfwScanProgress.fromMap(Map<String, dynamic> map) {
  return NsfwScanProgress(
    scanId: '${map['scanId'] ?? ''}',
    processed: _toInt(map['processed']),
    total: _toInt(map['total']),
    percent: _toDouble(map['percent']),
    status: '${map['status'] ?? 'running'}',
    imagePath: _toNullableString(map['imagePath']),
    error: _toNullableString(map['error']),
    mediaType: _toNullableString(map['mediaType']),
  );
}