CombinedCondition.deserialize constructor Null safety
Factory constructor to parse a CombinedCondition instance from the given JSON map.
The jsonMap
argument must not be null.
Implementation
factory CombinedCondition.deserialize(Map<String, String> jsonMap) {
assert(jsonMap != null);
if (jsonMap['conditionName'] != 'CombinedCondition') {
throw SerializationException('Error occurred during deserializing the CombinedCondition JSON string: $jsonMap');
}
if (jsonMap['conditions'] == null) {
return const CombinedCondition(<SerializableWaitCondition>[]);
}
final List<SerializableWaitCondition> conditions = <SerializableWaitCondition>[];
for (final Map<String, dynamic> condition in (json.decode(jsonMap['conditions']!) as List<dynamic>).cast<Map<String, dynamic>>()) {
conditions.add(_deserialize(condition.cast<String, String>()));
}
return CombinedCondition(conditions);
}