shift method
T?
shift()
Removes and returns the first element of the list.
Returns null
if the list is empty.
Implementation
T? shift() {
if (isEmpty) return null;
return removeAt(0);
}
Removes and returns the first element of the list.
Returns null
if the list is empty.
T? shift() {
if (isEmpty) return null;
return removeAt(0);
}