dispose method Null safety

void dispose()

The dispose method should always be called before this Molecule is destroyed. It will close _controller. Think of this as a destructor that you have to manually call.

Implementation

void dispose() {
  _controller.close();
}