FaceDetail.fromJson constructor
FaceDetail.fromJson(
- Map<String, dynamic> json
)
Implementation
factory FaceDetail.fromJson(Map<String, dynamic> json) {
return FaceDetail(
ageRange: json['AgeRange'] != null
? AgeRange.fromJson(json['AgeRange'] as Map<String, dynamic>)
: null,
beard: json['Beard'] != null
? Beard.fromJson(json['Beard'] as Map<String, dynamic>)
: null,
boundingBox: json['BoundingBox'] != null
? BoundingBox.fromJson(json['BoundingBox'] as Map<String, dynamic>)
: null,
confidence: json['Confidence'] as double?,
emotions: (json['Emotions'] as List?)
?.whereNotNull()
.map((e) => Emotion.fromJson(e as Map<String, dynamic>))
.toList(),
eyeglasses: json['Eyeglasses'] != null
? Eyeglasses.fromJson(json['Eyeglasses'] as Map<String, dynamic>)
: null,
eyesOpen: json['EyesOpen'] != null
? EyeOpen.fromJson(json['EyesOpen'] as Map<String, dynamic>)
: null,
gender: json['Gender'] != null
? Gender.fromJson(json['Gender'] as Map<String, dynamic>)
: null,
landmarks: (json['Landmarks'] as List?)
?.whereNotNull()
.map((e) => Landmark.fromJson(e as Map<String, dynamic>))
.toList(),
mouthOpen: json['MouthOpen'] != null
? MouthOpen.fromJson(json['MouthOpen'] as Map<String, dynamic>)
: null,
mustache: json['Mustache'] != null
? Mustache.fromJson(json['Mustache'] as Map<String, dynamic>)
: null,
pose: json['Pose'] != null
? Pose.fromJson(json['Pose'] as Map<String, dynamic>)
: null,
quality: json['Quality'] != null
? ImageQuality.fromJson(json['Quality'] as Map<String, dynamic>)
: null,
smile: json['Smile'] != null
? Smile.fromJson(json['Smile'] as Map<String, dynamic>)
: null,
sunglasses: json['Sunglasses'] != null
? Sunglasses.fromJson(json['Sunglasses'] as Map<String, dynamic>)
: null,
);
}