push method

A new child with a unique key made on this device, ordered by creation time. It only makes the reference: nothing is written until you call set on it. Throws an ArgumentError under .info.

await db.ref('messages').push().set(<String, Object?>{'text': 'hi'});

Implementation

DatabaseReference push() {
  validateWritablePath('push', spec.path);
  return DatabaseReference.internal(
    database,
    QuerySpec.defaultAt(spec.path.child(ChildKey(database.nextPushId()))),
  );
}