SpanScanner constructor Null safety

SpanScanner(
  1. String string,
  2. {dynamic sourceUrl,
  3. int? position}
)

Creates a new SpanScanner that starts scanning from position.

sourceUrl is used as SourceLocation.sourceUrl for the returned FileSpans as well as for error reporting. It can be a String, a Uri, or null.

Implementation

SpanScanner(String string, {sourceUrl, int? position})
    : _sourceFile = SourceFile.fromString(string, url: sourceUrl),
      super(string, sourceUrl: sourceUrl, position: position);