Programmation Dart - Méthode ListFirst

Cette propriété renvoie le premier élément de la liste.

Syntaxe

List.first

Exemple

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

Il produira ce qui suit output -.

The first element of the list is: 12