cubit property
T
get
cubit
Returns the BLoC instance associated with this view.
This getter automatically retrieves the appropriate BLoC instance
from the dependency injection system based on the generic type T
.
Returns
An instance of type T
that extends Cubit
Throws
- Exception if the BLoC instance is not registered in the dependency injector
Access Pattern
In StatefulWidget implementations, access this through widget.cubit
:
@override
void initState() {
super.initState();
widget.cubit.initialize(); // Access cubit through widget
}
Implementation
T get cubit => WalletInjector.instance.getIt.get<T>();