Dart Programming - ListFirst Method


Advertisements

This property returns the first element in the list.

Syntax

List.first

Example

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

It will produce the following output −.

The first element of the list is: 12  
dart_programming_lists.htm
Advertisements