In Dart programming, List data type is similar to arrays in other programming languages. List is used to representing a collection of objects. It is an ordered group of objects. The core libraries in Dart are responsible for the existence of the List class, its creation, and manipulation.
Logical Representation of List

The index of the element represents the position of the specific data and when the list item of that index is called the element is displayed. Generally, the list item is called from its index.
Types of List
There are broadly two types of lists on the basis of their length:
- Fixed Length List
- Growable List
Fixed Length List
Here, the size of the list is declared initially and can't be changed during runtime.
Syntax:
List ? list_Name = List.filled(number of elements, E, growanle:boolean);
Example:
void main()
{
List? gfg = List.filled(5, null, growable: false);
gfg[0] = 'Geeks';
gfg[1] = 'For';
gfg[2] = 'Geeks';
// Printing all the values in List
print(gfg);
// Printing value at specific position
print(gfg[2]);
}
Output:
[Geeks, For, Geeks, null, null] Geeks
Growable List
This type of list is declared without declaring the size of the list. Its length can be changed during runtime.
Adding a value to the growable list:
void main()
{
var gfg = [ 'Geeks', 'For' ];
// Printing all the values in List
print(gfg);
// Adding new value in List and printing it
gfg.add('Geeks'); // list_name.add(value);
print(gfg);
}
Output:
[Geeks, For] [Geeks, For, Geeks]
Adding multiple values to the growable list:
void main()
{
var gfg = [ 'Geeks' ];
// Printing all the values in List
print(gfg);
// Adding multiple values in List and printing it
// list_name.addAll([val 1, val 2, ...]);
gfg.addAll([ 'For', 'Geeks' ]);
print(gfg);
}
Output:
[Geeks] [Geeks, For, Geeks]
Adding a value to the growable list at a specific index:
void main()
{
var gfg = [ 'Geeks', 'Geeks' ];
// Printing all the values in List
print(gfg);
// Adding new value in List at
// specific index and printing it
// list_name.insert(index, value);
gfg.insert(1, 'For');
print(gfg);
}
Output:
[Geeks, Geeks] [Geeks, For, Geeks]
Adding multiple values to the growable list at specific indexes:
void main()
{
var gfg = [ 'Geeks' ];
// Printing all the values in List
print(gfg);
// Adding new value in List at
// specific index and printing it
// list_name.insertAll(index, list_of_values);
gfg.insertAll(1, [ 'For', 'Geeks' ]);
print(gfg);
// Element at index 1 in list
print(gfg[1]);
}