MissionPhaseMessage.fromJson constructor
MissionPhaseMessage.fromJson(
- Map<String, dynamic> json
)
Implementation
factory MissionPhaseMessage.fromJson(Map<String, dynamic> json) {
final rawHints = json['hints'];
return MissionPhaseMessage(
missionId: json['mission_id'] as String,
stepIndex: json['step_index'] as int,
phase: StepPhaseCodec.fromWire(json['phase'] as String),
timestamp: DateTime.parse(json['timestamp'] as String),
hints: rawHints is Map
? Map<String, Object?>.from(rawHints)
: const <String, Object?>{},
);
}