close method Null safety
override
Closes the stream.
No further events can be added to a closed stream.
The returned future is the same future provided by done. It is completed when the stream listeners is done sending events, This happens either when the done event has been sent, or when the subscriber on a single-subscription stream is canceled.
A broadcast stream controller will send the done event even if listeners are paused, so some broadcast events may not have been received yet when the returned future completes.
If no one listens to a non-broadcast stream, or the listener pauses and never resumes, the done event will not be sent and this future will never complete.
Implementation
Future close();