YamlMap.wrap constructor

YamlMap.wrap(
  1. Map dartMap, {
  2. dynamic sourceUrl,
  3. CollectionStyle style = CollectionStyle.ANY,
})

Wraps a Dart map so that it can be accessed (recursively) like a YamlMap.

Any SourceSpans returned by this map or its children will be dummies without useful location information. However, they will have a reasonable implementation of SourceSpan.getLocationMessage. If sourceUrl is passed, it's used as the SourceSpan.sourceUrl.

sourceUrl may be either a String, a Uri, or null.

Implementation

factory YamlMap.wrap(Map dartMap,
        {sourceUrl, CollectionStyle style = CollectionStyle.ANY}) =>
    YamlMapWrapper(dartMap, sourceUrl, style: style);