I have a bloc that i registered in multibloc provider in main.dart under mutiblocprovider.
This bloc provider have functions that i need to work inside its constructor.
class BlocA extends Bloc<BlocAEvent, BlocAState> {
BlocA({
required this.repository,
required this.userInfo
}) : super(const BlocAState()) {
// i have a functions here that uses userInfo.
on<Events>(_events);
}
But for some reason after the app loaded (homescreen after loggedIn), userInfo is empty, and it only contains record/data after hot reload.
I understood this because the BlocA won’t be reinitialized because its already been initialized from the start.
Have you encountered the same scenario? what did you do to make it work.