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
0
votes
1 answer

FutureBuilder snapshot.data getting set to null before the http call

I am trying to modify the List fetched during the future call and not call the future function again, so assigned a variable to future option of FutureBuilder and called the actual function in the initState(), but now the build function is rendering…
Amit Dubey
  • 75
  • 1
  • 8
0
votes
3 answers

Migrating to null safety: The argument type 'Object?' can't be assigned to the parameter type 'List'

After migrating to null safety I'm getting an error on ListView as "The argument type 'Object?' can't be assigned to the parameter type 'List'." I'm getting error on return ListView(children: snapshot.data,); Can anyone help me to fix this error…
0
votes
1 answer

Future Buider does not get the data until after multiple iterations. In Flutter

I have an asynchronous function that obtains information from my bd in firebase, when debugging this code fragment I can see that the data is obtained without any problem, this data will be used to display in widgets and I pass it through a future…
0
votes
1 answer

How can I use carousel with hero in flutter?

I am trying to make a animation show bookmark. Just like the example on this website.The orignial example is too complicated. So I put part of code from the example of flutter doc. To learn the easiest animation. I have put same tag in both hero,but…
0
votes
2 answers

how to return single circular Indicator for 2 futurebuilder for the same screen in flutter?

I have a widget like this, import 'package:flutter/material.dart'; class TestWidget extends StatelessWidget { const TestWidget({ Key? key }) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( body:…
Aman Chaudhary
  • 802
  • 3
  • 10
  • 27
0
votes
0 answers

How to make flutter display lot of data from json

I got a page in flutter than contains future builder, and the result of it displayed in list view builder. When I get small amount of data, flutter display the data without any problem. But when I get large amount of data, it display nothing. What I…
Heri Kwok
  • 1
  • 2
0
votes
3 answers

FLutter File initialization failed

I created an app to pick an image from the gallery and display it. I have created a File called "image" as mentioned below. File image; Then I created a function to pick the image as follow void _pickImageCamera() async { final picker =…
0
votes
1 answer

Flutter futurebuilder snapshot is null after database query until hot reload

I am querying database to populate listview inside build method but future builder is returning null in snapshot at first run. It gives RangeError (index): Invalid value: Valid value range is empty. But when I press hot reload, the data appears…
Noor
  • 193
  • 1
  • 2
  • 15
0
votes
3 answers

Flutter Firestore - To retrieve document snapshots belonging to only a certain set of ids and show that data on screen

I am passing my constructor list of Firestore Document Ids and I want to retrieve and show data belonging to those ids only in my 'LinksData' collection. So basically I want to retrieve the Document snapshot of all documents belonging to id's that…
0
votes
1 answer

Using StatefulWidget List having FutureBuilder as child shows no data till i hot reload and then calls future with no data immediately

I have a stateful widget which will show list of products, data will be fetched from api so I used future builder. Here problem is I can see data in log but not on widget class, it shows length 0 of list but as soon as I reload data shows for second…
0
votes
1 answer

Displaying JSon Data to DataTable Flutter

I am trying to display JSON data to a DataTable in Flutter. The data is coming from an API, getting data is no problem. But I am running to a problem displaying the list of some data in DataTable, I think is because of the JSON structure. Here is…
0
votes
2 answers

How do I correctly implement a FutureBuilder in Flutter in this case?

I am trying to display a horizontally scrollable ListView of different images. This is supposed to be achieved with the Widget MultipleImageDemo. I use MultipleImagePicker in loadAssets() to create a list of Assets of the images that are selected…
0
votes
1 answer

Cannot get List data from SharedPreferences using FutureBuilder call

I have a String List in my shared preferences that's meant to store account numbers which can then be used to make a call from the API: List accountList = []; Future _getListData() async { SharedPreferences myPrefs = await…
0
votes
1 answer

How to resolve The method '<' was called on null. Receiver: null Tried calling: <(0.0)?

I was trying to calculate the percentage by retrieving the required field values from the firestore using FutureBuilder, while doing so I'm facing this error. Can someone please let me know the reason of this error and where I'm going doing wrong in…
0
votes
2 answers

The method 'getUserData' was called on null. Receiver: null Tried calling: getUserData()

I'm trying to get the user's currency from my server. Until now I'm able to do that but the problem is the data keeps rebuild itself everytime the app gets rebuilt. I tried to fix that by this way : Future userDataFuture; ApiService…