close method
Closes the Event stream, telling it that no further events will be dispatched.
Returns a Future
which resolves when the underlying StreamController
has finished closing.
Implementation
Future<Null> close(DispatchKey key) async {
if (key != _key) {
throw ArgumentError(
'Event.close() expected the "${_key.name}" key but received the '
'"${key.name}" key.');
}
await _streamController.close();
}