The List is to create an integer indexed collection of objects, that each objects are identified or accessed by index.
An List
or Array
is a data structure consisting of a collection of elements like values or variables.
Array is a collection of objects. In Dart, arrays are List objects.
A list may contain zero or more objects.
A non-empty list has first element at 0
index and last element at list.length-1
index
You can create and initialize lists in multiple ways:
The List class also defines several methods for manipulating list values or variables, like, add, remove and sort etc.
Note: Learn more about Lists in Learn Dart Collections Course.