Questions tagged [flutter-futurebuilder]

For questions relating to Flutter's FutureBuilder class. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.

Reference:

667 questions
1
vote
0 answers

ElevatedButton in futurebuilder

I have a futureBuilder which populates a listView from Json. On every iteration of my list, I'm calling a custom widget, which returns a card. Works like a charm. But whenever I try and add interactivity inside my child widget like an…
1
vote
5 answers

Why is there an error with snapshot.data.length?

I am trying to parse data from an API. For that, I am using FutureBuilder to list all the parsed data in a ListView. I've performed a check for nullity of snapshot.data but I keep on getting this error in the segment snapshot.data.length, it says,…
Shourya Shikhar
  • 1,342
  • 1
  • 11
  • 29
1
vote
3 answers

The getter 'docs' isn't defined for the type 'AsyncSnapshot'

After migrating to null safety getting error The getter 'docs' isn't defined for the type 'AsyncSnapshot'. Try importing the library that defines 'docs', correcting the name to the name of an existing getter, or defining a getter or field…
1
vote
1 answer

The argument type 'User?' can't be assigned to the parameter type 'Future?'

With reference to the recent changes regarding FirebaseUser to User. FirebaseAuth.instance.currentUser() is not found at all (while throughing error "The expression doesn't evaluate to a function, so it can't be invoked." The solution to that…
1
vote
1 answer

The method '[]' was called on null. Receiver: null Tried calling: []("subcategory")

i am trying to get data from firebase using flutter with futurebuilder this the code FutureBuilder( future: _services.category.doc(_provider.selectedCategory).get(), builder: (BuildContext context,…
ryan chandra
  • 321
  • 3
  • 11
1
vote
0 answers

Again Reload progress dialog in FutureBuilder on refresh button in Flutter

I want to shown progress dialog again on refresh button means want to refresh FutureBuilder.No progress dialog is showing on refresh button. FutureBuilder( future: request, builder: …
Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105
1
vote
1 answer

How implement StreamBuilder correctly flutter

I'm newbie in flutter . I'm working on project where i used Futurebuilder to fetch data from server but I would like to change it now by StreamBuilder. what I should modify in this case .How i can move to StreamBuilder correctly ? this is my code…
lucky
  • 185
  • 5
  • 18
1
vote
2 answers

Flutter API calls with Future Builder returns error when future method called inside initState()

I was trying to call APIs that need to be loaded the first time the page is built. So I used FutureBuilder and written an initState call. Every page works fine but only on one page, I faced an issue with context. Then I understood about…
Ameena Shafeer
  • 626
  • 3
  • 18
1
vote
1 answer

Calling multiple functions in FutureBuilder causes an error

I am retrieving data from Firestore in the form of two functions (_onpressed() and _drname()) and called both of them in FutureBuilder. Function 1 is Future _onPressed() async { if (widget.brew.id == currentid.userid()) { return await db …
1
vote
1 answer

FutureBuilder keep loading

I have FutureBuilders all over my app and the problem is when opening a page there would be CircularProgressIndicators everywhere on the screen, and whenever the page rebuilds itself the CircularProgressIndicators is displays again. I have 2…
1
vote
2 answers

Expected a value of type 'ProductList', but got one of type '_Future'

I am trying to consume a rest api data returning a list of maps each map contain product details, so i code classes for product as well as productList with fromJsom method implemented, then i am trying to dispaly thoes products in my flutter app…
ELHIT Fatima
  • 23
  • 1
  • 8
1
vote
1 answer

JSON.DECODE returning null value, Flutter

I am trying to create a quizapp in which i create cards, like when user click on specific card then it will be redirect to that quizpage. here is the where i am trying to get json file data which are quiz questions class getjson extends…
TimeToCode
  • 1,458
  • 3
  • 18
  • 60
1
vote
1 answer

Flutter futureBuilder is rendering unknown faded card

Within my app i av a section to search from network, I have used future and futureBuilder to display result but it happen that on a real device the outcome is not what is expected (Unknown result) but on emulator the block of code is working as…
1
vote
2 answers

A build function returned null , FutureBuilder

I am trying to create a quiz app, in which when user click on one card, let say Python card so user will be redirected to python questions screen. for this i found "futurebuilder" which is used to do this. here is the class loadjson where i'm using…
TimeToCode
  • 1,458
  • 3
  • 18
  • 60
1
vote
2 answers

Flutter future Boolean function always return default value

I have a Future boolean function in that function I checked some data using the map function. if and else both conditions set the boolean variable is true. but it always returns the default false value. below code is my function. Future