Issue I’ve trying to show my int state of Cubit using BlockBuilder, that’s my code: class CounterCubit extends Cubit<int> { CounterCubit() : super(0); void increment() => emit(state + 1); void decrement() => emit(state – 1); } class CounterContainer extends StatelessWidget
Continue readingTag: flutter-bloc
Error: Type argument 'RoutesBloc' doesn't conform to the bound 'BlocBase<S>' of the type variable 'B' on 'BlocBuilder'
Issue I’m getting this error and I have no clue where it’s coming from. class Routes extends StatelessWidget { @override Widget build(BuildContext context) { return BlocBuilder<RoutesBloc, RoutesEvent>( // <– It occurs here builder: (context, state) { return Text(‘…’); }, );
Continue readingFlutter – Removing markers from Google Maps Widget
Issue I’m building a flutter app and using BLoC for state management, where the user can select the current location of the camera, click "confirm" and a marker will be added in that place by the name of ‘dep’ (departure),
Continue readingHow to manually change app language with Flutter_localizations and Bloc?
Issue void main() async { runApp(MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key key}) : super(key: key); @override Widget build(BuildContext context) { return BlocProvider( create: (context) => LanguageCubit(), child: BlocBuilder<LanguageCubit, Locale>(builder: (context, lang) { return MaterialApp( locale: lang, title:
Continue readingThe argument type 'MyBloc' can't be assigned to the parameter type 'MyBloc Function(BuildContext)
Issue I’m trying to add flutter_bloc to my flutter application. I have Home page and when click on a button in home page Need to Navigation to a different page. Navigation is working without any issue, But When Wrap the
Continue readingHow to add multiple state in one cubit in flutter bloc pattern?
Issue I was developing an application in flutter which does OTP based authentication to log in. Earlier I was managing the states in the class itself so that I can use the setState method to render the UI accordingly. Then
Continue readingBloc is either calling multiple times or not getting called at all
Issue I have 2 screens Screen A Screen B I go from screen A to Screen B via the below code onTap: () { Navigator.pushNamed(context, ‘/screen_b’); }, Screen B code class ScreenB extends StatefulWidget { @override _ScreenBState createState() => _ScreenBState();
Continue readingFlutter Cubit: good way to get stored variable?
Issue I’m using Flutter and Cubit for the first time, and I would like to know if this is a good way to retrieve a stored variable, in my cas the current loggued user. After loggued in, the user can
Continue readingFlutter bloc listener not listening to state changes
Issue I am using flutter_bloc library to create a verification code page. Here is what I tried to do. class PhonePage extends StatelessWidget { static Route route() { return MaterialPageRoute<void>(builder: (_) => PhonePage()); } @override Widget build(BuildContext context) { return
Continue readingTwo successive BLOCs in flutter_bloc
Issue I want to split my BLOC into two BLOCs: the one who does preparing job the main one Let’s call it PrepBloc and MainBloc. Is it reasonable way to put one inside another like this: BlocProvider<PrepBloc>( create: ……, child:
Continue reading