UniqueList<E>.empty constructor
Creates a new empty list.
If growable
is false
, which is the default, the list is a fixed-length
list of length zero. If growable
is true
, the list is growable and
equivalent to <E>[]
.
If strict
is true
, a DuplicateValueError will be thrown when a value
is added to the list that already exists in the list.
If nullable
is true
, the list may contain multiple instances of null
,
otherwise, null
will be treated like any other value and only
one instance of null
may be contained in the list.
Implementation
factory UniqueList.empty({
bool growable = false,
bool strict = false,
bool nullable = true,
}) {
return UniqueList<E>._(List<E>.empty(growable: growable),
nullable: nullable, strict: strict, growable: growable);
}