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
4
votes
0 answers

Update List in FutureBuilder using GetX in Flutter

I'm using the FutureBuilder with GetX and I want to update(add, Edit or remove) the below type of list. var cardListDetails = Future.value([]).obs; Thanks in advance
Alpit Panchal
  • 709
  • 1
  • 7
  • 25
4
votes
3 answers

How to hide Floating Action Button in Flutter

I am a beginner in Flutter and I am using Futurebuilder and provider for the first time. Finally I have created an app that adds places. Using below code, I have achieved the app almost. But a little problem appears now. When app getting data from…
4
votes
4 answers

Flutter: How to fetch data from api only once while using FutureBuilder?

How can I fetch data only once while using FutureBuilder to show a loading indicator while fetching? The problem is that every time the user opens the screen it will re-fetch the data even if I set the future in initState(). I want to fetch the data…
AhWagih
  • 485
  • 5
  • 14
3
votes
1 answer

FLUTTER: RangeError (index): Index out of range: no indices are valid: 0 (Pass Parameters)

I hope you can help me find a way to solve this problem that arises, I am trying to pass the data from the list and the index to the next tab. but I get this error: RangeError (index): Index out of range: no indices are valid: 0 I leave the code…
3
votes
1 answer

How to use nested (or several) Future.builder in Flutter?

I have three separate get requests to the server and I want to use them at the same time in one Future.builder, but at the same time I created three separate get-requests uding Future to get data from these three requests. I also saw that in…
inkwelll075
  • 494
  • 4
  • 19
3
votes
1 answer

How to load other static elements before FutureBuilder finishes fetching items

I would like to load static elements like bottom navigation bar before FutureBuilder will be loaded. So it should looks like this. When we enter the new screen, CircularProgressIndicator is shown in the middle and other elements like bottom…
kpoads
  • 51
  • 6
3
votes
3 answers

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

Currently, I am working on updating the codebase for a Flutter project which was developed on previous versions. The error occurred once we updated to the latest version of Dart and Flutter. The code here is related to when we are returning the list…
cleopatez
  • 197
  • 1
  • 1
  • 17
3
votes
0 answers

Flutter - how to correctly unit test FutureBuilder

I'm trying to unit test widgets inside a FutureBuilder but I can't figure it out. I've got a widget that has a FutureBuilder with a builder that returns a CameraPreview widget when the connection state is done: body: FutureBuilder( …
3
votes
0 answers

Flutter Google Ads for iOS showing a temporary Interstitial for NativeAd in ListView

I've migrated to the new Google Mobile Ads package in Flutter. My interstitial works perfectly but my Native ad show a temporary ad over the majority of my screen before loading into my ListView Container awaiting it with a FutureBuilder. If I…
Charles Jr
  • 8,333
  • 15
  • 53
  • 74
3
votes
1 answer

In Flutter, make a HTTP request, then depending on response, update the UI or open a new page

I am developing a Flutter app where it acts as a client, connecting to a server via an API. The app makes requests and depending on the response it progresses the state. My question is the following: Can I make a request, and then depending on the…
Nearchos
  • 153
  • 1
  • 11
3
votes
5 answers

Flutter - Page Does Not Appear to Push Until FutureBuilder is Done

I have a page that shows a list of items. This page is reached by button click on a previous page. I use a FutureBuilder to populate the list of items when the retrieval is complete. While the ConnectionState is "waiting," I show a circular progress…
mac
  • 485
  • 1
  • 6
  • 29
3
votes
1 answer

Flutter DataTable Layout

I've got some layout trouble with DataTable in Flutter with a FutureBuilder, I've called the API and naturally it will display it like this: Understandable, since I'm building a list of tables it will return multiple tables back. I want to map out…
3
votes
1 answer

Flutter FutureBuilder widget not responding to Future resolution when chaining Futures with await

I am using a flutter widget's initState() method to create two future ints; delayed which is a simple Future.delay, and delayedAwaited, which awaits on the delayed variable and doubles its value. The build() method includes two FutureBuilders, one…
3
votes
1 answer

Flutter : why future builder run more than one time

I have page contain future builder to get username from shared preference : Widget build(BuildContext context) { return Consumer(builder: (context, prod, child) { return FutureBuilder( future:…
Sermed mayi
  • 697
  • 7
  • 26
2
votes
1 answer

How can i make future function to wait for a stream to complete?

Future notifyRead(Guid characteristic, BuildContext context) async { try { if (await FlutterBlue.instance.isOn) { BluetoothCharacteristic charToTarget = _characteristics .firstWhere((element) => element.uuid ==…
1
2
3
44 45