dispose method

void dispose()

Disposes of the AuthManager and its resources.

This should be called when the AuthManager is no longer needed to prevent memory leaks, for example, in a Riverpod provider's onDispose callback. It cancels the auth state subscription and disposes the ValueNotifiers.

Implementation

void dispose() {
  _logger.info('Disposing AuthManager.');
  _authSubscription.cancel();
  currentUserNotifier.dispose();
  currentProfileNotifier.dispose();
}