Dart Programming - List.last Property



This property returns the last element of the list.

Syntax

List.last 

Usage of last property

Example

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

Output

It will produce the following output

The last element of the list is: 13 
dart_programming_lists.htm
Advertisements