Dart Programming - List.last Method



Returns the last element in the list.

Syntax

List.last 

Example

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

It will produce the following output

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