Dart Programming - List.first Property



This property returns the first element in the list.

Syntax

List.first

Usage of List.first property

Example

void main() { 
   var lst = []; 
   lst.add(12); 
   lst.add(13); 
   print("The first element of the list is: ${lst.first}"); 
}  

Output

It will produce the following output − .

The first element of the list is: 12  
dart_programming_lists.htm
Tutorix - AI Tutor
Advertisements