YamlList.wrap constructor

YamlList.wrap(
  1. List dartList, {
  2. dynamic sourceUrl,
  3. CollectionStyle style = CollectionStyle.ANY,
})

Wraps a Dart list so that it can be accessed (recursively) like a YamlList.

Any SourceSpans returned by this list 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 YamlList.wrap(List dartList,
        {sourceUrl, CollectionStyle style = CollectionStyle.ANY}) =>
    YamlListWrapper(dartList, sourceUrl, style: style);