List Extension | List Methods | List Properties
List Extension:
Lists in Dart implement the Iterable interface, which provides a set of methods for traversing the elements in the list.
Iterable<E>
List Methods:
add()
addAll()
insert()
remove()
removeAt()
removeLast()
removeRange()
clear()
indexOf()
lastIndexOf()
sort()
forEach()
map()
where()
toList()
getRange()
sublist()
asMap()
List Properties:
first: It returns the first element in the List.
last: It returns the last element in the List.
isEmpty: It returns true if the List is empty and false if the List is not empty.
isNotEmpty: It returns true if the List is not empty and false if the List is empty.
length: It returns the length of the List.
reversed: It returns a List in reverse order.
single: It is used to check if the List has only one element and returns it.