Issue I have a MainPage, where I have a ListView of my rooms. The ListView uses the response from my getUserRooms service. Everything works fine; I can’t understand why The ListView doesn’t update when my createRoom request gets called, which
Continue readingTag: flutter-state
How to update a list in initState() flutter after the api call?
Issue So I have a Stateful Widget which has a List variable I want to update from the API call. My issue is that the List is empty even after I do the fetchItems() in the initState(). How can I
Continue readingWhy setState is not working, is there any mistake in my code?
Issue I tried to show a circular progress indicator while loading when clicked on the elevated button here I used setState to update the state, but somehow state is not getting updated. I didn’t understand why it’s not getting updated
Continue readingCustom Widget revising animation in gridview
Issue I have a custom widget that changes color when tapped inside a gridview. When I scroll to the bottom and scroll back up to the top selected widget its animation is reversed. I’m pretty sure that it has something
Continue readingFlutter – updating state and THEN navigating away
Issue I have a stateful widget called AuthenticatingScreen where I’m trying to perform the following flow… Output message letting the user know we are logging them in Get user oAuth token (calls to service file) Update the message to let
Continue readingToggle switch animation not working in flutter
Issue `I am trying to implement a toggle switch in which when I toggle the switch I display two different things but I’m getting an error while I use setstate with my logic or something like that if I remove
Continue readingFile_picker in stateless bloc widget
Issue How do you go about using file_picker package in flutter and bloc management? https://pub.dev/packages/file_picker I have following code: class NewAuction extends StatelessWidget { late final FilePickerResult? filePickerResults; final _formKey = GlobalKey<FormState>(); final _priceController = TextEditingController(); final _descriptionController = TextEditingController();
Continue readingsetState in showModalBottomSheet using TimePicker
Issue I am having a problem. When I am showing my showModalBottomSheet I have a GeestureDetector on a Container, when pressed the TimePicker pops up and I can select a time. I take that value and set the state on
Continue readingWhen to use Consumer & when to use context.watch to access the provider values?
Issue Recently I discovered that we can access the provider value using either Consumer<Model>(build: (context, value, child){ return Widget(child: value.valueName), }, ) Or using context.watch<Model>().valueName What is the best practice? Solution They are the same. it depends on your needs.
Continue readingCan't use a setState call in the onchanged callback in flutter
Issue I am trying to map a TextFormFields value to a state variable in flutter class _PageState extends State<AddPage> { String _tag = ”; // this is the state variable @override Widget build(BuildContext context) { final _formKey = GlobalKey<FormState>(); ….
Continue reading