SafetySettings.fromJson constructor

SafetySettings.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory SafetySettings.fromJson(Map<String, dynamic> json) {
  return SafetySettings(
    category: SafetyCategory.values
        .firstWhere((e) => e.toString() == '${json['category']}'),
    threshold: SafetyThreshold.values
        .firstWhere((e) => e.toString() == '${json['threshold']}'),
  );
}