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:
Dart
void main()
{
List? gfg = List.filled(5, null, growable: false );
gfg[0] = 'Geeks' ;
gfg[1] = 'For' ;
gfg[2] = 'Geeks' ;
print(gfg);
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:
Dart
void main()
{
var gfg = [ 'Geeks' , 'For' ];
print(gfg);
gfg.add( 'Geeks' );
print(gfg);
}
|
Output:
[Geeks, For]
[Geeks, For, Geeks]
Adding multiple values to the growable list:
Dart
void main()
{
var gfg = [ 'Geeks' ];
print(gfg);
gfg.addAll([ 'For' , 'Geeks' ]);
print(gfg);
}
|
Output:
[Geeks]
[Geeks, For, Geeks]
Adding a value to the growable list at a specific index:
Dart
void main()
{
var gfg = [ 'Geeks' , 'Geeks' ];
print(gfg);
gfg.insert(1, 'For' );
print(gfg);
}
|
Output:
[Geeks, Geeks]
[Geeks, For, Geeks]
Adding multiple values to the growable list at specific indexes:
Dart
void main()
{
var gfg = [ 'Geeks' ];
print(gfg);
gfg.insertAll(1, [ 'For' , 'Geeks' ]);
print(gfg);
print(gfg[1]);
}
|
Output:
[Geeks]
[Geeks, For, Geeks]
For
Types of List (Basis of its Dimensions)
There are various numbers on the list based on dimension, but the most popular among them are:
- 1-Dimensional (1-D) List
- 2-Dimensional (2-D) List
- 3-Dimensional (3-D) List
- Multidimensional List
Here, we have already discussed the 1-D list.
2-Dimensional (2-D) List
Here, the list is defined in two dimensions and thus forming the look of the table.
Creating 2-D List:
Dart
void main()
{
int a = 3;
int b = 3;
var gfg = List.generate(a, (i) = > List(b), growable: false );
print(gfg);
for ( int i = 0; i < 3; ++i) {
for ( int j = 0; j < 3; ++j) {
gfg[i][j] = i + j;
}
}
print(gfg);
}
|
Output:
[[null, null, null], [null, null, null], [null, null, null]]
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
Another way of creating a 2-D List:
Dart
void main()
{
var gfg = List.generate(3, (i) = > List.generate(3, (j) = > i + j));
print(gfg);
}
|
Output:
[[0, 1, 2], [1, 2, 3], [2, 3, 4]]
There is also another way of creating a 2-D list, i.e giving the values associated with the indexes and it will lead to the creation of the 2-D list.
3-Dimensional (3-D) List
The representation of a 3-D list is quite difficult but its creation is similar to that of a 2-D list.
Example:
Dart
void main()
{
var gfg = List.generate(3, (i) = > List.generate(3,
(j) = > List.generate(3,
(k) = > i + j + k)));
print(gfg);
}
|
Output:
[[[0, 1, 2], [1, 2, 3], [2, 3, 4]], [[1, 2, 3], [2, 3, 4], [3, 4, 5]], [[2, 3, 4], [3, 4, 5], [4, 5, 6]]]
Note: In a similar fashion one can create an n-dimensional List i.e by using the “List.generate()” method.
Similar Reads
Dart Programming - Map
In Dart programming, Maps are dictionary-like data types that exist in key-value form (known as lock-key). There is no restriction on the type of data that goes in a map data type. Maps are very flexible and can mutate their size based on the requirements. However, it is important to note that all l
7 min read
Dart - Sort a List
The List data type is similar to arrays in other programming languages. A list is used to represent 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. Sorting of the list depends
2 min read
Dart - Private Properties
A property is a field variable declared inside a class. There are three types of properties in Dart: Read-only Property: You can only read these values, access to modifying them is not givenWrite-Only Property: New Values can be set, but do not allow access to their values.Read/Write-Only Property:
2 min read
Dart - Type System
The Dart programming language is considered type-safe, meaning it ensures that the variableâs value always matches the variableâs static type through a combination of static type checking and runtime checking. It is also known as Sound Typing. It comes in handy while debugging the code at compile ti
3 min read
Dart - Generics
In Dart, by default collections are heterogeneous. However, by the use of generics, we can make a collection to hold homogeneous values. The use of Generics makes the use of a single compulsory data type to be held inside the collection. Such collections are called type-safe collections. By the use
2 min read
How to Combine Lists in Dart?
The List data type in Dart programming is similar to arrays in other programming languages. A list is used to represent 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. There ar
3 min read
Dart - Data Types
Like other languages (C, C++, Java), whenever a variable is created, each variable has an associated data type. In Dart language, there are the types of values that can be represented and manipulated in a programming language. In this article, we will learn about Dart Programming Language Data Types
9 min read
Dart - Finding Minimum and Maximum Value in a List
In Dart, we can find the minimum and maximum valued element present in the given list in seven ways: Use the for loop to find the largest and smallest elements.Use the sort function to find the largest and smallest elements.Using forEach loop to find the largest and smallest element.Using only the r
5 min read
Dart vs Kotlin: Top Differences
Choosing a programming language is always a difficult task for developers, especially when two languages are popular, widely used, and provide efficient tools and features. Kotlin and Dart are two popular candidates that developers can go for as both languages offer distinct sets of features and too
8 min read
Top 10 Flutter Tools for App Development in 2025
In the rapidly changing arena of mobile application development, Flutter has emerged as a robust framework for cross-platform application development: Android, iOS, Web, and Desktop. With its rich set of features, tools, and ever-growing community, Flutter has empowered developers to create high-per
10 min read