Result<T>.fromJson constructor
Implementation
factory Result.fromJson(Map<String, dynamic> json) => switch (json[keyType]) {
'QuestionnaireState' => Result<QuestionnaireState>.parseJson(json)
..result = QuestionnaireState.fromJson(
List<Map<String, dynamic>>.from(json[keyResult] as List),
),
'bool' => Result<bool>.parseJson(json)
..result = json[keyResult] as bool,
_ => throw UnknownJsonTypeError(json[keyType]),
} as Result<T>;