Finishes this block when future
completes. Returns a Future
chained to future
.
Source
Future finishWhenComplete(Future future) {
if (future is! Future) {
throw new ArgumentError.value(future,
'future',
'Must be a Future');
}
return future.whenComplete(() {
finish();
});
}