dispose method

  1. @override
void dispose()
override

Clean up function to be called when this object is removed from the tree.

This also removes this object as an observer from the WidgetsBinding instance.

Implementation

@override
void dispose() {
  WidgetsBinding.instance.removeObserver(this);
  super.dispose();
}