whenComplete method

FutureOr<T> whenComplete(
  1. FutureOr<void> action()
)

Implementation

FutureOr<T> whenComplete(FutureOr<void> Function() action) {
  final that = this;
  if (that is Future<T>) {
    return that.whenComplete(action);
  }
  final f = action();
  if (f is Future) {
    return f._innerThen((_) => that, onError: (e) => that);
  }
  return that;
}