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.
677
questions
1
vote
1
answer
30
views
How to refresh pages when snapshot.data changes in flutter?
I have shared preferences called 'loginStatus' where to store login status data whether user is login or not using future builder. if false then user is push to loginScreen, if true then user is push ...
0
votes
0
answers
17
views
Performance issues with animations using StreamBuilder and flutter_animate
I'm encountering performance issues with animations in my Flutter app after transitioning from using FutureBuilder to StreamBuilder and integrating StreamProvider to fetch data dynamically from ...
2
votes
1
answer
31
views
Flutter State Management Issue - Contant Reloading of UI
I would like some advice in general in regard to coding with Flutter.
I'm currently working on a mobile application and I keep running into the same issue. The future builders and stream builders are ...
1
vote
1
answer
51
views
Flutter: Navigate inside FutureBuilder
How to go to next screen in Futurebuilder?
Basically, the conditions are:
If snapshot has no data, [return CircularProgressIndicator()]
else if 'keyword' = 'target', go to NextScreen,
else return [...
0
votes
0
answers
59
views
FutureBuilder with Directory(previous/path).list runs second time for previous directory
Cosider this simplified example:
class _MyExampleState extends State<MyExample> {
String home = "/storage/emulated/0/Home";
String folder = "/storage/emulated/0/Home/Folder&...
0
votes
1
answer
78
views
Flutter, converting json into list issue: making listview, futurebuilder from data from http.get
I am trying to receive data (list) from the database and save the data as list type, and show the data in front end by using futurebuilder, listview. But I guess the code could not convert the json ...
0
votes
1
answer
21
views
Flutter SliverGrid with Future Builder, undefined name: snapshot issue
`Hi, I'm trying to show a list of country flags using Flutter, SliverGrid and FutureBuilder.
In the showCountries(), 'childCount: snapshot.data.length' line, getting an error: undefined 'snapshot' and ...
0
votes
0
answers
39
views
how to get String from getMetadata and not Future<String> [duplicate]
I'm trying to get the Custom Metadata from a pdf I uploaded to Firebase but I keep getting
The argument type 'Future' can't be assigned to the parameter type 'String'.
This is the widget in question-...
0
votes
0
answers
26
views
How can I get a document with an ID that matches an ID in another collection?
Thank you so much to anyone who can help me. I am coming back to Flutter after a long break and attempting to follow an existing code base to solve my query, but it's not working.
I have two ...
0
votes
1
answer
51
views
Flutter FutureBuilder camera has been intialized already
I'm new to Flutter and I want to make a simple camera screen using FutureBuilder. This is my code
import 'dart:developer';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
...
0
votes
1
answer
33
views
Flutter FutureBuilder Tap List Item Extract Index Number
I need to extract FutureBuilder list item index to edit the list item on another screen MyForm.
In the code below where the snapshot has data, I create the list.
When I tap on a list item, I will go ...
0
votes
0
answers
22
views
Future that returns large data works on emulator but not physical device
I have a page that returns a list of audio files on the host device and i want to use the details of these files to create a list of audio files but it doesn't work on physical device(keeps loading) ...
1
vote
0
answers
23
views
Flutter FutureBuilder returns a K:V object on initial child().get() but only V remains on state changes
This is a behavior I'm not understanding but am sure I've got something wrong. Components: Flutter, Realtime Database, FutureBuilder. Modified code:
[FormView class omitted but extends StatefulWidget]
...
0
votes
1
answer
27
views
Flutter FutureBuilder cover AnimatedSwitcher
everyone. I have a flip-animation while clicking button (It works fine.). However, when I wrap it with futurebuilder, my widget will show in the new state without animation after clicking button (The ...
0
votes
0
answers
61
views
Create a stream builder for JSON data Flutter
I'm getting JSON data from API using stream and the snapshot.data shows null.
It works fine on FutureBuilder but I need Streambuilder for continues data.
Here is the full code:
Stream: (my current ...
-1
votes
1
answer
37
views
Tap of textfield causing unnecessary widget rebuild
Description:
I've encountered an issue in my Flutter application where tapping on a TextField is causing an unexpected widget rebuild. This behavior is leading to some performance concerns and is not ...
-1
votes
2
answers
49
views
The non-nullable local variable 'result' must be assigned before it can be used Flutter
I am taking Angela Yu's Flutter and Dart course and it is very outdated and I am getting a lot of errors.
This is an async await demo and the syntax has changed since she made the course. I have tried ...
-1
votes
1
answer
79
views
Which State Management approach is more preferable to update the data in real time? [closed]
We are working on Parking Management Application for our university where we are receiving the vehicle information. And if the entered vehicle is not registered, security guard have an option to ...
0
votes
2
answers
48
views
FutureBuilder weird behaviour
I have a FutureBuilder which the future is this :
Future<Tutor> future(Object? args) async {
print("running future ...${args}");
String title = "";
String ...
1
vote
2
answers
46
views
How to clone Future in Dart/Flutter
I have a custom FLutter widget that receives a future as a parameter to it's constructor and has FutureBuilder inside.
I want to add the ability to rerun this future in case of connection error, but ...
0
votes
2
answers
40
views
my Future builder is returning error i have no clue what to do
here is my Future builder its returning an error i think its because of riverpod but i cant find a solution. the error is at the bottom
i tried changedDependencies and didnt work im receiving the list ...
0
votes
1
answer
40
views
How do I access the return data from a FutureBuilder?
I am having a trouble accessing a single data from Firestore. Since accessing data from Firestore is a future whenever I try to call it from initState and setState it, it just prints null so I decided ...
0
votes
0
answers
26
views
Why snapshot.connectionState in FutureBuilder is directly going to ConnectionState.done in the Below code
ResultAPI resultsAPI = ResultAPI();
@override
Widget build(BuildContext context) {
return Material(
child: FutureBuilder(
future: resultsAPI.getResult(2081951044),
...
0
votes
2
answers
68
views
how to call setState inside FutureBuilder<List<dynamic>>in flutter
I am trying to call setState inside a ListView.builder which itself is inside a FutureBuilder
class BidScreen extends StatefulWidget {
const BidScreen({super.key});
@override
State<BidScreen&...
0
votes
0
answers
29
views
Convert from FutureBuilder to StreamBuilder? [Flutter]
can anyone convert this function and body to stream builder i want to get countinous updated data instead of one time calling (Streambuilder instead of Futurebuilder)
issue: with this future builder ...
0
votes
1
answer
42
views
Why FutureBuilder never reload data when it changed in Flutter
I try to upload an image inside FutuerBuilder in flutter but nothing happen to the UI. I have to leave the current page and enter it again to see changes. That is happenn in uploading the image, but ...
0
votes
1
answer
33
views
Why ref.read(myProvider.notifier).getData() need to use initState become a late Future variable then could been use in future?
I am the new guy who learn flutter about 4 months, and I can't understand this:
There is two code:
Code 1.
late Future _placesFuture;
@override
void initState() {
_placesFuture = ref.read(...
0
votes
1
answer
26
views
Why do I have to hot reload flutter for the future builder to return
I have a problem where when i launch the assignment page from the phone no List is returned by the future but when I hot reload a list is returned.
Here is the Future code that fetches the list from ...
0
votes
1
answer
46
views
using ChangeNotifierProvider with FutureBuilder issue
i have a class that is called page1 and within it i have a ChangeNotifierProvider and a consumer as a child which has a FutureBuilder as a child within it, here is the code for it
class Page1 extends ...
0
votes
0
answers
49
views
Flutter + Provider + FutureBuilder Null check operator on initialization app
The error is occurring Null check operator used on a null value with the context used to get the provider.
The error happens to some users.
Occurs in line:
`await _userDataController.loadSync(context, ...
0
votes
0
answers
32
views
How to update ListView.builder in a StreamBuilder Flutter
I am trying to solve the following problem.
In my app I am trying to creat an AppBar where all your friends are. The first Stream Builder is for checking if you got a new friend or lost one. Inside is ...
0
votes
2
answers
52
views
Flutter InfiniteScroll with Listview.builder refresh the data instead of adding it to the list
i am very new in flutter...
So, i tried to follow tutorial that sometimes i change it litle bit so it could run like i want it to. so, i am making an infinitescroll to get the data from API which has ...
0
votes
0
answers
52
views
FilePicker.platform.pickFiles() does not show dialog from Futurebuilder
My code is as follows:
import 'package:flutter/material.dart';
import 'package:file_picker/file_picker.dart';
void main() {
return runApp(MyApp());
}
class MyApp extends StatefulWidget {
@...
0
votes
0
answers
55
views
Call Future method inside Future method in flutter
I have two future functions that does not have any kind of errors. additionally these functions are asynchronous functions. but when I try to call fetchStoryData from inside getRecentProgress, it is ...
0
votes
1
answer
29
views
Unable to update FutureBuilder after inserting data in sqlite (Flutter)
I am new to Flutter development and I am trying to create a simple application.
In my application there are 3 widgets:
First Widget is like home screen which has Bottom Navigation and a Floating ...
0
votes
0
answers
32
views
Snapshot in Futurebuilder is not null but still getting snapshot.hasData as false
I am calling two futures in the Futurebuilder in which one of them is returning the complete data but the on returning an empty list as a list of data is expected but for now that data is empty. Even ...
0
votes
0
answers
50
views
Flutter PaginatedDataTable from GET Request, Problems Parsing Response List
Using Flutter 3.10 Web, building a List of Users for FutureBuilder with PaginatedDataTable. I have the following in a single dart file:
import 'dart:async';
import 'dart:convert';
import 'package:...
0
votes
0
answers
83
views
Why is snapshot.data empty when using FutureBuilder with PaginatedDataTable in Flutter 3.10 for Web?
Flutter 3.10: FutureBuilder with PaginatedDataTable from GET Response, but snapshot.data is Empty.
I am creating an app which include a User List page showing records in a PaginatedDataTable inside a ...
0
votes
1
answer
47
views
How to get a string from the FutureString
I am new to flutter i want to get string from other class and when i calls the function it returns either future string or null But my console is printing the address ,
please any one can help me
...
0
votes
1
answer
31
views
Why is are there duplicates of same data while reading documents from sub-collection in FIrestore
I am trying to get the document IDs or the data inside the those documents of sub-collection which are present within a existing document which belongs to a Bigger collection.
The structure is as ...
0
votes
3
answers
70
views
No Such Method Error The getter data was called in null response flutter dart
Here I have json response model,
{
"success": true,
"data": {
"news": [
{
"id": 3,
"user_id&...
0
votes
1
answer
104
views
Futurebuilder connectionState.done returning true, even though my data is not yet ready and returning null. Wont rebuild after data available
I've been trying to figure this out so far with no luck.
I have a streambuilder which pulls the user's closest 8 locations like this:
Stream<List<DocumentSnapshot>> stream() =>
geo....
0
votes
1
answer
40
views
Duplicate data displayed from previous firestore database fetches
I am new to coding in dart, and I was trying to build a basic app with a firebase baackend for authentication and firestore for CRUD functionalities. The authentication and creation of new user is a ...
0
votes
1
answer
142
views
Futurebuilder not updating with the future value as it may be initializing before the data is ready
As of now, my futurebuilder never builds, it will remain in the 'Loading'... state forever. If I hot reload, or change something once the app is loaded it does load at that point though. Right now I ...
0
votes
0
answers
47
views
Flutter FutureBuilder DB query always returns empty snapshot data
I am using SQFLite DB with a single table.
This table has one ID record with a true/false flag value of zero or one.
When I update the UI, the DB record value changes to zero if visible or one if ...
-1
votes
1
answer
110
views
FutureBuilder flutter
I am creating an app like snapchat where the app start with camera page and before this it ask user for camera and microphone permission if the user grant both permission then the camera widget will ...
0
votes
1
answer
115
views
how to display multiple card data from api in Flutter
I want to fetch and display multiple records from DB via Api based on phone number. but I am getting only last record data. if record 1 available is it will display record 1, then add record 2 it will ...
0
votes
0
answers
127
views
Show toast message or dialogue Using FutureBuilder
I want when user sends wrong data to the server then futureBuilder shows a dialogue or toast message above all other widgets to the user without removing all other widgets because FutureBuilder only ...
1
vote
1
answer
45
views
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 ...
0
votes
1
answer
80
views
Why do I get screen blinks when I update Image.memory()?
I get a QR code for authorization via the REST API and display it on the screen via Image.memory().
After the QR is shown on the screen, I start sending authorization requests to the server.
But since ...