Relative Content

Tag Archive for flutterdartbloc

BlocListener doesn’t listen – Flutter

I’m building a simple signup process with Firebase Auth and Bloc. When the user creates an account it triggers an event of the SignUpBloc called SignUpRequired. On that event, an account on Firebase is created and emits the state SignUpSuccess (and there are also SignUpProcess and SingUpError). I’m using a simple bloc observer to verify every step. It works totally fine, however, the BlocListener doesn’t listen to any change of the bloc state.

BlocListener doesn’t listen – Flutter

I’m building a simple signup process with Firebase Auth and Bloc. When the user creates an account it triggers an event of the SignUpBloc called SignUpRequired. On that event, an account on Firebase is created and emits the state SignUpSuccess (and there are also SignUpProcess and SingUpError). I’m using a simple bloc observer to verify every step. It works totally fine, however, the BlocListener doesn’t listen to any change of the bloc state.

Could not find the correct Provider above this Builder Widget

class ProfileView extends StatelessWidget { const ProfileView({super.key}); @override Widget build(BuildContext context) { return BlocProvider( create: (_) => ProfileCubit( context.read<AuthenticationRepository>(), context.read<RemoteRepository>(), sessionCubit: context.read<SessionCubit>(), ), child: const ProfileViewContent(), ); } } class ProfileViewContent extends StatefulWidget { const ProfileViewContent({super.key}); @override State<ProfileViewContent> createState() => _ProfileViewContentState(); } class _ProfileViewContentState extends State<ProfileViewContent> with TickerProviderStateMixin { @override Widget build(BuildContext context) { return […]