Step.fromJson constructor
Implementation
factory Step.fromJson(Map<String, dynamic> json) {
final type = json['type'];
if (type == 'intro') {
return InstructionStep.fromJson(json);
} else if (type == 'question') {
return QuestionStep.fromJson(json);
} else if (type == 'completion') {
return CompletionStep.fromJson(json);
}
throw StepNotDefinedException();
}