factory Emotion.fromJson(Map<String, dynamic> json) { return Emotion( confidence: json['Confidence'] as double?, type: (json['Type'] as String?)?.toEmotionName(), ); }