Questions tagged [flutter-state]

369 questions
0
votes
0 answers

setState() or markNeedsBuild called during build while setting Provider value

class UserModel extends ChangeNotifier{ User _user; set setuser(User user) { _user = user; notifyListeners(); } User get getuser{ return _user; } } class UserLoader extends…
0
votes
0 answers

Variables reset to default whenever I navigate with the bottomNavigationBar but reappear if I add a new item to my list

The Function of the App It has a two items in the bottom navigation bar where in the first section (Courses) the user can add a list of courses and it will update their overall GPA and highest average for them each time they add a new one. The other…
0
votes
1 answer

How to retrieve metadata from firebase storage?

info(String choice) async { print(choice); if (choice == 'Created on') { print('hii'); StorageReference imageRef = storageRef.child(imageLocation); await imageRef .getMetadata() .then((value) =>…
0
votes
1 answer

In Flutter, how can I read data from a child widget when callbacks are not available within the build method of the child?

I have an AppBar button where I want to read a childData list and do something with it: class _ParentState extends State { .... Widget build(BuildContext context) { return Scaffold( appBar: AppBar( actions: [ …
0
votes
1 answer

How to use bloc in flutter without using any library

I want to manage the states of my app with bloc pattern, I have searched on the internet and find a lot of topics, but all are using third party libraries as I don't want. So is there any resources or example which can help us to use bloc pattern…
Muhammad
  • 2,572
  • 4
  • 24
  • 46
0
votes
1 answer

How to call an async method in initState in flutter

I need to get some information from an endpoint. I have this method: List cardsList = List(); List cardsId = List(); addToList() async { var jsonData = await Provider.of(context).cardsList; print(jsonData); …
The Mir
  • 400
  • 1
  • 8
  • 17
0
votes
1 answer

Unable to access fetched data in initState in Flutter

I have class named Cards that has a method getCards that returns back a Future. I use this method to get cards from an endpoint. Cards: import 'dart:convert'; import 'package:http/http.dart' as http; import…
The Mir
  • 400
  • 1
  • 8
  • 17
0
votes
1 answer

Flutter Bloc conflicting states

I'm trying to build a login activity using Bloc, with the help of the tutorials available at https://bloclibrary.dev/. I've successfully combined the Form Validation and Login Flow into a working solution, but things took a messy turn when adding a…
PM4
  • 624
  • 1
  • 5
  • 18
0
votes
0 answers

Streambuilder not getting called inside dialog box in flutter

I am using below code. I click some button and if my OTP match below method is getting called. and in that method i am calling bloc. Widget i am using is Statefulwidget. void matchOtp() { showDialog( context: context, builder:…
ios developer
  • 3,363
  • 3
  • 51
  • 111
0
votes
2 answers

save state from outer widget

I have an outer scaffold with an app bar with an action button that when clicked I want to save the state of an inner Stateful widget to perm storage - what is the best way to be able to call the inner widget method from the outer app bar and also…
Damian Hamill
  • 83
  • 1
  • 6
0
votes
1 answer

In flutter, can you set the appbar backgorund to change base on the value of a dropdown box?

my drop down box cycles through 5 strings ['blue','red','yellow','orange','grey'] I want my appbar title to be that dropdown box and for the value in the dropdown to determine the appbar color DropDownWidget ddw = DropDownWidget(); var color = { …
0
votes
1 answer

Flutter provider throwing error setState() or markNeedsBuild() called during build

I am trying to learn how to use the provider package, version 4.0+. I have copy-pasted solution provided by flutter team and run it on my emulator. The problem is, when I run it for the first time (cold start), I am getting the following error…
Robert J.
  • 2,631
  • 8
  • 32
  • 59
0
votes
1 answer

Issues with Flutter state

This is an experiment with Flutter. I was trying to create a paragraph generator in Flutter. Made a UI Loaded the data from a List. data.dart class MyData { static final List data1 = [ '0Title Of Page', '3Paragraph title…
Vettiyanakan
  • 7,957
  • 6
  • 37
  • 55
0
votes
1 answer

Which one is faster and performant Provider, bloc pattern or flutter_redux?

I need manage the states globally, I find a lot of way, in terms of managing the state by using Provider bloc pattern redux and etc. But actually I dont know, which one is faster and performant? Example: I am working on chat application, which I…
Muhammad
  • 2,572
  • 4
  • 24
  • 46
-1
votes
0 answers

after update qty I call get cart details but screen not showing updates in cart in flutter

enter code here onChanged: (value) { setState(() { cartProduct_list[0].products![index].quantity = value.toString(); }); isload = true; …
Jaini Shah
  • 45
  • 3
1 2 3
24
25