Metadata.deserialize constructor

Metadata.deserialize(
  1. dynamic serialized
)

Deserializes the result of Metadata.serialize into a new Metadata.

Implementation

Metadata.deserialize(serialized)
    : testOn = serialized['testOn'] == null
          ? PlatformSelector.all
          : PlatformSelector.parse(serialized['testOn'] as String),
      timeout = _deserializeTimeout(serialized['timeout']),
      _skip = serialized['skip'] as bool,
      skipReason = serialized['skipReason'] as String,
      _verboseTrace = serialized['verboseTrace'] as bool,
      _chainStackTraces = serialized['chainStackTraces'] as bool,
      _retry = serialized['retry'] as int,
      tags = Set.from(serialized['tags'] as Iterable),
      onPlatform = {
        for (var pair in serialized['onPlatform'])
          PlatformSelector.parse(pair.first as String):
              Metadata.deserialize(pair.last)
      },
      forTag = (serialized['forTag'] as Map).map((key, nested) => MapEntry(
          BooleanSelector.parse(key as String),
          Metadata.deserialize(nested))),
      languageVersionComment = serialized['languageVersionComment'] as String;