close method
Closes the instance. This method should be called when the instance is no longer needed. Once close is called, the instance can no longer be used.
Implementation
@override
Future<void> close() async {
// Cancel the event bus subscription to avoid memory leaks
_eventBusStreamSubscription?.cancel();
// Close the cubit
super.close();
}