closeWith method
Associates the Timer with the Closer context. You can
provide an optional onClose
callback function to define custom actions
to be performed when the Timer is closed.
Example usage:
void initState() {
super.initState();
someStream.listen(processEventsData).closeWith(this);
}
Implementation
void closeWith(HasCloser hasCloser, {void Function()? onClose}) {
hasCloser.closer.addClosable(_ClosableTimer(this, onClose));
}