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
1
vote
0 answers
Is it OK to rename build to _build and call it from a FutureBuilder when adding Firebase to an existing Flutter app?
I'd created a MyApp class that was moderately complex (for me as a new flutter user)--
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return…

j-vasil
- 139
- 1
- 9
1
vote
1 answer
Flutter FutureBuilder: type 'Response' is not a subtype of type 'String'
I'm trying to use flutter's FutureBuilder with an http.get() as the future parameter like so:
child: FutureBuilder(
future: http.get(
Uri.http('192.168.31.144:8000', 'api/v1/login')),
builder: (context, snapshot) {
if…

manchitro
- 131
- 1
- 11
1
vote
1 answer
How to change Flutter widget Visibility using Firebase Realtime Database and FutureBuilder?
Well,
My realtime database looks like: Database
My app looks like: Slidable button
The slidable button is wrapped in Visibility() widget, so, I'm trying to set this one invisible when child "inService" sets in "true" vice versa. I'd really thank if…

Edwin Andrango
- 33
- 3
1
vote
1 answer
How to return response from HttpClientResponse in flutter
I am using HttpClient in flutter to get data from my API, here is my function
I am trying to return the value from the response function.
Future SendOTPtoVerify(
{String endpoint, String number, String OTP}) async {
try {
var…

Ishak Hari
- 148
- 15
1
vote
1 answer
Flutter/ Dart Users sharing same screen at the same time
I am receiving data from an API and displaying it in a specific page. I want to display the data dynamically, that when an user selects an object from a list view builder, it refresh the database automatically and removes it from the other user's…

cabral279
- 97
- 10
1
vote
1 answer
How to cache a future string in flutter
I am iterating through a listview of objects and retrieving favicon URL's from package:favicon/favicon.dart as a future: in a FutureBuilder. I then use these URL's to return and cache the favicon images in containers as leading listtile icons with a…

metamonkey
- 427
- 7
- 33
1
vote
0 answers
Flutter FutureBuilder throwing exception with Firebase Phone Auth "Null check operator used on a null value"
I am receiving following exception when using a FutureBuilder to build itself using a future "firebaseAuthSvc.signinwithphoneno(widget.pin, widget.verificationID)" that return Firebase Authentication UserCredential.
════════ Exception caught by…

Aatif Jamal
- 21
- 2
1
vote
1 answer
Flutter - whenComplete() not working as expected when using Providers
I'm trying to display a loading while doing an API Request and when finished to show the list with the response or a custom widget to show a message(EmptyListWidget). The problem is that the whenComplete() method is being executed before the async…

Martim Silva
- 49
- 5
1
vote
2 answers
Future Builder is returning null data from API even if snapshot is not null
I'm getting null values in my ListView.builder inside the FutureBuilder from the API call, when I print out the response body, it is not empty and when I print out the snapshot.hasData it returns true. When I hardcode the values for return object…

GrandMagus
- 600
- 3
- 12
- 37
1
vote
1 answer
How to save state of previous page on navigation in flutter
I am building a flutter application in which I have 2 screens.I have API calls on both screens.When I navigate on 2nd screen and return back to 1st screen then build function of 1st Screen runs as expected and API is called again(In future of…

Gautam Goyal
- 230
- 1
- 4
- 16
1
vote
1 answer
How to dynamically build rich text with FutureBuilder in Flutter
I am trying to look for '@' in a piece of text and then asynchronously gather a displayName for that tag. The problem I am running into is that my FutureBuilder keeps returning null.
The error I get is this.
════════ Exception caught by widgets…

khagen
- 77
- 1
- 8
1
vote
2 answers
Flutter Futurebuilder data sorting only update after hot reload
the change of filter does not refresh the displaying data, how can i ask futurebuilder to build again based on new where() query?
here is my code:
FutureBuilder(
…

icantcode
- 142
- 1
- 15
1
vote
0 answers
Data From multiple FutureBuilders in flutter
I'm fetching data from an api source , the data is fetched properly , then i store the data in sqflite , so basically after doing both , i need to check if there is connection so that i show data from internet other than that i get data back from…

Taki
- 3,290
- 1
- 16
- 41
1
vote
1 answer
Future Builder not working with Geolocator with flutter
I am a little new to flutter and I am using Geolocator plugin for the first time. I am trying to have a FutureBuilder that finds the city of the user when built but it never leaves the loading screen
this is my current code:
class Home extends…

RyanBuss01
- 203
- 1
- 11
1
vote
2 answers
How to update the future in FutureBuilder to get new data while using GetX
I am using GetX and FutureBuilder to build a list of Cards from my DB.
Lets say I have 10 products in DB then 10 cards are shown. When I add one more product, the Cards on the HomeScreen aren't updated and I have to Navigate in and Out of page to…

Firaun
- 369
- 1
- 5
- 21