SafetyInsights.fromJson constructor

SafetyInsights.fromJson(
  1. Map<String, dynamic> jsonDecode
)

Implementation

SafetyInsights.fromJson(Map<String, dynamic> jsonDecode) {
  riskScore = jsonDecode['riskScore']?.toDouble();
  interventionCount = jsonDecode['interventionCount'];

  criticalEvents = (jsonDecode['criticalEvents'] as List?)
      ?.map((e) => e?.toString())
      .toList();

  safetyTips = (jsonDecode['safetyTips'] as List?)
      ?.map((e) => e?.toString())
      .toList();
}