DetectorState.fromJson constructor

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

Implementation

factory DetectorState.fromJson(Map<String, dynamic> json) {
  return DetectorState(
    stateName: json['stateName'] as String,
    timers: (json['timers'] as List)
        .whereNotNull()
        .map((e) => Timer.fromJson(e as Map<String, dynamic>))
        .toList(),
    variables: (json['variables'] as List)
        .whereNotNull()
        .map((e) => Variable.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}