stop method

void stop()

Stops listening for notifications and cleans up resources.

Cancels the stream subscription and any retry timers.

Implementation

void stop() {
  _isListening = false; // Set the flag to indicate listening has stopped.
  _notificationSubscription?.cancel(); // Cancel the stream subscription.
  _retryTimer?.cancel(); // Cancel any retry timers.
  print('Stopped listening to notifications.');
}