dispose method

  1. @mustCallSuper
void dispose()

Releases everything this controller owns. The page that created the controller calls this from its own State.dispose(); a subclass that adds its own controllers overrides this and ends with super.dispose().

Both the text controllers and the URx fields are ChangeNotifiers, so without this every page visit leaves its listeners behind.

Implementation

@mustCallSuper
void dispose() {
  controllerStartDate.dispose();
  controllerEndDate.dispose();
  state.dispose();
  state2.dispose();
  pageNumber.dispose();
  totalPages.dispose();
  tagOrderBy.dispose();
  fields.dispose();
}