SassList constructor Null safety

SassList(
  1. Iterable<Value> contents,
  2. ListSeparator separator,
  3. {bool brackets = false}
)

Returns an empty list with the given separator and brackets.

Implementation

SassList(Iterable<Value> contents, this.separator, {bool brackets = false})
    : _contents = List.unmodifiable(contents),
      hasBrackets = brackets {
  if (separator == ListSeparator.undecided && asList.length > 1) {
    throw ArgumentError(
        "A list with more than one element must have an explicit separator.");
  }
}