Issue I’m new to Bloc architecture and I watched some tutorials lately. I have page which is StatelessWidget and inside I’m using BlocProvider to initialize Bloc inside my UI. It will return different widgets based on state changes. But even
Continue readingCategory: Bloc
Could not find the correct Provider<T> above this BlocConsumer<T, S> Widget
Issue First of all, I read almost all question related to this error and I couldn’t find any answer to question. I’m trying to use BlocProvider to provide a child widget with BlocProvider in SignInPage: class SignInPage extends StatelessWidget {
Continue readingFlutter bloc – do not call the api every time (use the same State in different views)
Issue I’m using flutter bloc pattern in my flutter app. I have bottom navigation bar with several tabs in one page. Two of them are using the same api call (the same State). When the user taps on 1 of
Continue readingA build function returned null,The offending widget is: BlocBuilder<NotificationBloc, NotificationState> in flutter_bloc package
Issue I am a beginner in flutter as well as in flutter_bloc where i’m trying to get the widget in blocbuilder but getting the “A build function returned null. The offending widget is:BlocBuilder. Build functions must never return null.” Below
Continue readingFlutter could not find the correct Provider above BlocConsumer Widget
Issue I’m using Flutter Bloc for a project. This is the structure: MultiBlocProvider( providers: [ BlocProvider<BlocA>( create: (context) { return BlocA() ..add(FetchEvent()); }, ), BlocProvider<BlocC>( create: (context) { return BlocC()..add(FetchEvent()); }, ), ], child: IndexedStack( index: _pageNum, children: [ ChildA(),
Continue readingHow to use Flutter Bloc with Firebase Phone Auth
Issue I’m trying to implement Firebase phone authorization using Flutter Bloc pattern. I have the following code import ‘dart:async’; import ‘package:bloc/bloc.dart’; import ‘package:firebase_auth/firebase_auth.dart’; import ‘./bloc.dart’; class AuthBloc extends Bloc<AuthEvent, AuthState> { final FirebaseAuth _auth = FirebaseAuth.instance; @override AuthState get initialState
Continue readingChild bloc calling its ancestor mapEventToState
Issue I’m trying to create a CustomBloc that handles common events. CustomBloc is extended by many other Blocs to add functionality. My problem is the call of super.mapEventToState in CustomBloc descendants never gets executed. class CustomBloc extends Bloc<BlocEvent, BlocState> {
Continue readingTriggering initial event in BLoC
Issue example_states: abstract class ExampleState extends Equatable { const ExampleState(); } class LoadingState extends ExampleState { // } class LoadedState extends ExampleState { // } class FailedState extends ExampleState { // } example_events: abstract class ExampleEvent extends Equatable { //
Continue readingFlutter bloc – Show snackbar on state change
Issue I am trying to log in with Google. When googleSignInAccount I yield new state with PlatformExecption. Now, How can I access that value in order to do some changes. try{ final GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn(); if(googleSignInAccount == null){
Continue readingI am using BLOC to make a simple counter app , but my counter is not updating when I am incrementing / decrementing it? I used BlocBuilder to build UI
Issue I have wrapped MaterialApp under the BlocProvider and also I have used BlocBuilder for building the UI ( counter text ) I have two floating action buttons each of which call Incrementevent() and Decrementevent() respectively but still, the UI
Continue reading