0PricingLogin
Dart Academy · Lesson

Adding, Removing, and Updating Items

Mutate a list safely.

Lists Can Change

Most Dart lists are growable, meaning you can add and remove items after creating them. That makes them perfect for data that changes over time.

Add to the End

The add method appends one item to the back of the list. The list grows by one and the new item takes the last index.

var todos = ['wake up'];
todos.add('code');

All lessons in this course

  1. Creating Lists and Indexing
  2. Adding, Removing, and Updating Items
  3. Searching and Sorting Lists
  4. Transforming With map, where, and toList
← Back to Dart Academy