teardown method Null safety

Future teardown(
  1. {St? emptyState}
)

Closes down the store so it will no longer be operational. Only use this if you want to destroy the Store while your app is running. Do not use this method as a way to stop listening to onChange state changes. For that purpose, view the onChange documentation.

Implementation

Future teardown({St? emptyState}) async {
  if (emptyState != null) _state = emptyState;
  _stateTimestamp = DateTime.now().toUtc();
  return _changeController.close();
}