serialize method Null safety

  1. @override
Map<String, String> serialize()
override

Serializes the object to JSON.

Implementation

@override
Map<String, String> serialize() {
  final Map<String, String> jsonMap = super.serialize();
  final List<Map<String, String>> jsonConditions = conditions.map(
    (SerializableWaitCondition condition) {
      assert(condition != null);
      return condition.serialize();
    }).toList();
  jsonMap['conditions'] = json.encode(jsonConditions);
  return jsonMap;
}