Issue I am having a problem with my project. The problem is that I have when I push and go to another page and I run a BlocProvider to run a bloc function in that page, the BlocListener in the
Continue readingTag: flutter-bloc
Bloc builder cannot detect the cubit provided
Issue I’m creating a page named Products Page, and it has this structure : @override Widget build(BuildContext context) { return Scaffold( body: _buildBody(), ); } Widget _buildBody() { return Padding( padding: const EdgeInsets.only(top: 60, left: 20, right: 20), child: Column(
Continue readingHandle BlocProvider with Modal Bottom Sheet
Issue I have a statefull widget with a Gesture detector within a Bloc Provider. @override Widget build(BuildContext context) { return RepositoryProvider.value( value: _authRepository, child: BlocProvider( create: (context) => AuthBloc(authRepository: AuthRepository()), child: Scaffold( body: GestureDetector( onTap: () { showSignInBottomSheet(context); }, ),
Continue readingFlutter : how to change automatically from splash screen to next screen?
Issue I’m having an issue with moving from the splash screen to the next screen in my application. When the app first starts, I want to display a splash screen, and after that I try to use pushReplacement to go
Continue readingHow to get same instance of an object using a parameter such as ID, with getIt/injectable in flutter?
Issue I am new to using getIt as dependancy injection, I used to use Riverpod. in riverpod we have family providers, where I can use an ID parameter to get the same instance of an object. Now, in my current
Continue readingFlutter BLoC et workmanager : how to make unique repositories initialisation pattern?
Issue I use the BLoC, and workmanager libraries. Actually, the code runs fine. But, looks like smell code. My problem : I have to initialise all my repositories for the MultiRepositoryProvider which wraps my MainApp() widget. At this point, basic
Continue readingBLoC builder doesn't rerender UI
Issue I would like to get todos from API, set them to state and show them on screen. On initState method I am starting request. After recieving it in my BLoC, I set it in state. But todos don’t visible
Continue readingRouter based navigation with flutter bloc
Issue I am trying to build my own router similar to go_router, based on flutter_bloc. What I am trying to achieve is very similar to this guide that inspired the minimal implementation below: import ‘package:flutter/foundation.dart’; import ‘package:flutter/material.dart’; import ‘package:flutter_bloc/flutter_bloc.dart’; void
Continue readingAdding custom duration to flutter_bloc's timer example
Issue I am learning flutter_bloc and did the timer example at https://bloclibrary.dev/#/fluttertimertutorial?id=flutter-timer-tutorial However the timer always resets to 60 seconds, so I wanted to the ability to set a custom initial duration. My approach: Add a field initialDuration to TimerState
Continue readingBlocBuilder only build once and stop rebuild with subsequent emit
Issue I have an IconButton that click on it will pin/unpin the window, and the icon will change according to pinned or not. The first click on the button will trigger a rebuild event, but subsequent click does not. And
Continue reading