addAll<T extends RealmObject> method

void addAll<T extends RealmObject>(
  1. Iterable<T> items, {
  2. bool update = false,
})

Adds a collection RealmObjects to this Realm.

If the collection contains items that are already managed by this Realm, they will be ignored. This method behaves as calling add multiple times.

By setting the update flag you can update any existing object with the same primary key. Updating only makes sense for objects with primary keys, and is effectively ignored otherwise.

Implementation

void addAll<T extends RealmObject>(Iterable<T> items, {bool update = false}) {
  for (final i in items) {
    add(i, update: update);
  }
}