UniqueList<E>.strict constructor

UniqueList<E>.strict()

Creates a new UniqueList that throws DuplicateValueErrors if a value is added to the list already exists in the list.

If length is provided, a fixed-length list will be created, otherwise a growable list will be created. Note: To create a growable, strict and non-nullable list, use UniqueList.empty and set the strict and nullable parameters to true and false respectively.

Implementation

factory UniqueList.strict() =>
    UniqueList._(<E>[], strict: true, growable: true);