dispose method
Cancels the subscription to the state stream.
This method should be called to release resources when the object is no longer needed. It safely cancels the active subscription to prevent memory leaks.
Implementation
Future<void> dispose() async {
await _stateStreamSubscription?.cancel();
}