completed property

Future<Database> completed

Provides a Future which will be completed once the transaction has completed.

The future will error if an error occurrs on the transaction or if the transaction is aborted.

Source

Future<Database> get completed {
  var completer = new Completer<Database>();

  this.onComplete.first.then((_) {
    completer.complete(db);
  });

  this.onError.first.then((e) {
    completer.completeError(e);
  });

  this.onAbort.first.then((e) {
    // Avoid completing twice if an error occurs.
    if (!completer.isCompleted) {
      completer.completeError(e);
    }
  });

  return completer.future;
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-indexed_db/Transaction/completed.html