first property
The first element.
Throws a StateError if this
is empty.
Otherwise returns the first element in the iteration order,
equivalent to this.elementAt(0)
.
Implementation
@override
E get first => elements.first;
Updates the first position of the list to contain value
.
Equivalent to theList[0] = value;
.
The list must be non-empty.
If the list is strict, a DuplicateValueError will be thrown
if value
already exists in the list, unless value
is equivalent
to the element being set.
Implementation
@override
set first(E value) {
if (value != elements.first && _contains(value)) {
throw DuplicateValueError(value);
}
elements.first = value;
}