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.
Questions tagged [flutter-futurebuilder]
667 questions
2
votes
1 answer
Futurebuilder in StatelessWidget - Flutter
I have the following code in a Stateful Widget and the future: in Futurebuilder correctly calls the function _getCategory()
class Categories extends StatefulWidget {
@override
_CategoriesState createState() => _CategoriesState();
}
class…

gputhige
- 109
- 2
- 11
2
votes
2 answers
Bad state no element in Flutter Using FutureBuilder and Provider
Using Provider and FutureBuilder, I just deleted data from database, it got removed at the same time, it shows a red screen with bad state no element. There is no problem to add data, do not show this problem.
Code is given below
stacktrace
ter…

c49
- 360
- 1
- 7
- 18
2
votes
3 answers
Flutter : initial value not updating in Form (FormBuilder)
_updatePersonalFormScreen(String loginId) async {
if (!DartUtility.isNullEmptyOrWhitespace(loginId)) {
_personalInfo = await _service.getUserPersonalDetails(loginId);
setState(() {
if (_personalInfo != null) {
…

Noorus Khan
- 1,342
- 3
- 15
- 33
2
votes
1 answer
Flutter: type 'Future' is not a subtype of type 'Widget' // MaterialPageRoute(null))
I am trying to navigate to the camera screen and when I trigger the navigation, I get the error
Another exception was thrown: type 'Future' is not a subtype of type 'Widget'
Another exception was thrown: setState() or markNeedsBuild()…

Indigo
- 167
- 1
- 2
- 13
2
votes
1 answer
Provider rebuilds the widget, but nothing shows up until a "Hot restart"
I am building a flutter app and I get some data from a future, I also got the same data with a changenotifier. Well the logic is that while some object doesn't have data because its waiting on the future then display a spinning circle. I have…

user10601874
- 133
- 8
2
votes
2 answers
Item builder not getting triggered in futurbuilder Flutter
Scaffold(body: FutureBuilder(
future: fetchTracks(),
builder: (BuildContext context, AsyncSnapshot snapshot){
if(snapshot.hasData)
{
ListView.builder(
scrollDirection: Axis.vertical,
itemExtent: 130.0,
…

Graycodder
- 447
- 5
- 15
2
votes
1 answer
How to update widget state built inside FutureBuilder
Before, I used ListBuilder to generate a list of 70 numbers and it worked but it took a long time to generate the 70 numbers into custom widgets and also when I tapped a number just to change the background color state, it took a couple of…

Lemayzeur
- 8,297
- 3
- 23
- 50
2
votes
2 answers
FutureBuilder doesn't wait for future to complete
I am using API call to get data and display in a ListView.
Here is the future builder class:
Widget futureBuilder() {
return FutureBuilder
- >(
future: _getProjects(),
builder: (context, snapshot) {
…

Hirak Chhatbar
- 3,159
- 1
- 27
- 36
1
vote
1 answer
Refresh FutureBuilder after snapshot.hasError | Flutter
i want to rebuild my FutureBuilder after if's builder leads to snapshot.hasError
I tried using Statefullbuilder to rebuild my FutureBuilder by making and changing random bool, is it a way to resolve problem? I really can't find out until problem…

Malak
- 336
- 2
- 13
1
vote
2 answers
how to access json array in FutureBuilder in flutter
I have created my model class and through Dio I store and display the server information in my class but my problem is that I want to access the jsonarray of chart fields json object and display them in FutureBuilder app response.
[
{
…

Artin Yunesi
- 45
- 5
1
vote
2 answers
How do I wait for an async function to execute and pass the value to the build tree in flutter
I am getting the referer for a header with a Future function and then I am trying to pass that to a build widget:
referer() async {
refererFinal = await getReferer();
}
Map loadHeaders() {
Map headers = new…

BradG
- 673
- 1
- 14
- 26
1
vote
0 answers
Flutter How to visualize nested maps from Firebase
Im working on a project that it has nested maps in Firebase.
First of all here is Firebase document screenshot:
And this one is my how to fetch this document function to my model:
Future personelleriGetir(String id) async {
try…

Tolga Yılmaz
- 506
- 1
- 3
- 15
1
vote
2 answers
Using a FutureBuilder but then modifying a local value in Flutter
I'm trying to get my head around how I should manage reading data from a database in Flutter (or any API/backend).
Without a database and just using state that's local to the widget I'd expect to write something similar to the following. I am…

Grant J
- 1,056
- 3
- 10
- 18
1
vote
1 answer
change variable depend on dropdown selection in StreamBuilder, Flutter
I'm currently writting a following code which
fetch data and assign it as initial data
create dropdown inside of streambuilder
when dropdown is changed, change variable
Now I am aware that this won't work because running setState will rerun…

Akira Yoshimura
- 71
- 7
1
vote
2 answers
Flutter - FutureBuilder not waiting for "future" to return
I check some similar topics regarding this, but couldn't find a solution to my problem.
I created a FutureBuilder on my Home screen, because I want to use the result of an asynchronous function (that reads a JSON) to build it. I'm calling this async…

Fabrício Carraro
- 11
- 2