Search code snippets, questions, articles... Chrome Extension

Dart Program to remove the last element from a List

To remove the last item or element from a list using Dart - you can use the .removeLast() method.
void main() {
  List<int> numberList = [1, 2, 3, 4, 5];
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

.removeLast() method in Dart

The above code will pop the last element from the list.

Was this helpful?
Join Devsheet Ask a Question