Issue I seem to lose application state whenever I perform a hot reload. I am using a BloC provider to store application state. This is passed at the App level in the main.dart and consumed on a child page. On
Continue readingTag: bloc
Router 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 readingContext: Navigator operation requested with a context that does not include a Navigator
Issue I know there are several similar questions listed, but I can not resolve it after I tried some solutions from previous questions. 🙁 I want to do a network check and show a dialog if it has no network
Continue readingContext: Navigator operation requested with a context that does not include a Navigator
Issue I know there are several similar questions listed, but I can not resolve it after I tried some solutions from previous questions. 🙁 I want to do a network check and show a dialog if it has no network
Continue readingContext: Navigator operation requested with a context that does not include a Navigator
Issue I know there are several similar questions listed, but I can not resolve it after I tried some solutions from previous questions. 🙁 I want to do a network check and show a dialog if it has no network
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 readingUI not being updated after state change
Issue I am stuck in a weird situation. Have cross-checked all the reference. Problem is my timer is not updating the modelBottomSheet. This is my WorkOutTracker class WorkOutTracker extends StatefulWidget { const WorkOutTracker({Key? key}) : super(key: key); @override State<WorkOutTracker> createState()
Continue readingBlocProvider.of cannot find the Bloc created earlier
Issue When trying to intercept the backbutton press, I want to reset the state of the main Bloc to the initial state, so I want to add a kind of reset event when pressing back. I can’t wrap my head
Continue readingConcepts of BlocListener, BlocBuilder, and BlocProvider
Issue I am having difficulty understanding this structure. My idea is simple: I have a MultiBlocProvider in my build with two BlocProviders. The first one uses AuthBloc and immediately calls my GetToken, and the second one prepares my provider (TokenBloc).
Continue reading