Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

If have a variable: Future<CarList?> carList; I set this variable every couple of seconds via a backend call. In UI, I use FutureBuilder to show carList, which works OK. But outside UI, how can ...
May's user avatar
  • 167
1 vote
1 answer
50 views

Hello i have a flutter program structured like so: In this code i have a Navigation Bar with 3 pages, To make the code cleaner, i decided to write the code of the 3 pages in each of their own separate ...
DrakeJest's user avatar
  • 197
0 votes
1 answer
53 views

I'm encountering an issue where a specific line in my asynchronous method isn't executing when called from initState. Here's the method in question: Future<void> loadNetworkImages() async { ...
StativBus's user avatar
0 votes
1 answer
147 views

How can I stop freezing my UI when I run two functions in the init state? Those two functions are the APIs which are getting me data from backend and I want it to display on screen. Also I want to ...
Ahmed Raza's user avatar
0 votes
1 answer
188 views

I need to check my file reading was successful and return true or false. I need to use async and await function because it needs to return true otherwise no point continuing. I get a run time error ...
fluttergogo's user avatar
0 votes
0 answers
31 views

ResultAPI resultsAPI = ResultAPI(); @override Widget build(BuildContext context) { return Material( child: FutureBuilder( future: resultsAPI.getResult(2081951044), ...
Phani's user avatar
  • 3
0 votes
1 answer
241 views

The current date is already written in the text button. When you press it, a CupertinoDatePicker pops up, but I want to change the written date instantly when I change the date in CupertinoDatePicker. ...
anıl's user avatar
  • 1
0 votes
0 answers
141 views

I'm trying to understand why my code doesn't work. I'm using the Flutter camera plugin, and want to handle cases when camera permissions are denied. In such cases CameraController.initialize should ...
cpper's user avatar
  • 161
0 votes
1 answer
934 views

I want to perform a method after a delay in flutter, and I came across Future.delayed method, but the method was being called immediately without a delay. I tried the following: Future.delayed(const ...
Othman Shawgan's user avatar
1 vote
1 answer
955 views

I have two process which both come with a loading time and therefore with separate LoadingIndicator Widgets: Future getImageURL(String? pictureUrl) async { if (pictureUrl == null) throw ...
Yuki's user avatar
  • 325
0 votes
2 answers
74 views

I'm trying to get datas from api and add them a list. But at this moment, I see datas i got but I can't get it out of the function. What should i do? function List<dynamic> xxx = []; @...
macropyre's user avatar
0 votes
0 answers
35 views

my ImagePaths function is supposed to return a list and I want to access that list in my Carousel but I can't seem to figure out how to do so.. The ".lenght" and the [index] are not working ...
Coca95's user avatar
  • 41
0 votes
1 answer
277 views

I just want to return the value of each condition and use it as the value of the function. Here is my code for it. var getStuff = chechIfExisting(); chechIfExisting() async { var isExisting = await ...
flutternewbiee's user avatar
1 vote
1 answer
121 views

in want create table from api response.i created data table using future builder. The future builder fires api twice not not return any data class HomeScreen extends StatefulWidget { const HomeScreen(...
Hari .S's user avatar
  • 109
0 votes
0 answers
76 views

I am trying to use a geolocator and then put the values from the data received from a plug in into a list so I can then sort it. The problem is that when I try to add said data to the list, I get an ...
Grace Thomas's user avatar
0 votes
1 answer
75 views

Currently, I use Navigation to bring up Dialog. But of course, the page will be changed, and the screen will only display the Dialog. Like I've shown below. I want to fix it, so that when the Dialog ...
Bilbo Baggins's user avatar
1 vote
1 answer
248 views

I'm trying to login in users using a third party api. But the problem is whenever an error occurs and the catch error is executed the "then" function that holds the navigation to the ...
Ariyo's user avatar
  • 49
3 votes
1 answer
2k views

I've been reviewing the RiverPod 2 tutorial at https://codewithandrea.com/articles/flutter-state-management-riverpod/ In the section dealing with Future providers there is a code snippet as shown ...
user2868835's user avatar
  • 1,714
0 votes
1 answer
822 views

Is there anyway to get a future when displaying a list? I have list with two user id's ( one of them is the userlogged in, the other one is the user to chat with ). my goal is to get and display the ...
user avatar
1 vote
1 answer
781 views

With null safety enabled, I'm using the new dart version <2.18.1>. this is my code import 'dart:async'; import 'dart:io'; import 'package:path/path.dart'; import 'package:path_provider/...
induwara widarshana's user avatar
0 votes
0 answers
59 views

I have created a reusable CircleAvatar widget which builds itself based on it's parameters. The parameters are using .watch() from riverpod & so update automatically. This translates to, in rough ...
RobbB's user avatar
  • 1,364
-2 votes
2 answers
1k views

My function is as follows: void function() async { … } I used the above function in Widget build(BuildContext context). Actually, I want it to be Future<void> function() async instead of void ...
My Car's user avatar
  • 4,650
0 votes
1 answer
79 views

I been reading multiple threads about passing data between futures, but for some reason I can get this to work.:( I have two futures, where the first future is doing post request to retrieve a token ...
Dymond's user avatar
  • 2,297
1 vote
1 answer
287 views

I have screens in a TabBarView that share data so I decided to wrap the TabBarView in a FutureBuilder and pass the data from that into both screens. The Future is called fetchUsersAndPosts() and it is ...
Globe's user avatar
  • 564
0 votes
0 answers
82 views

I have a Future where users and posts are fetched from Firebase, turned into objects, added to either postsList or the usersList, and finally, the return is [usersList, postsList]. For so reason, ...
Globe's user avatar
  • 564
1 vote
1 answer
643 views

I have a stateful widget whose state builds a ListView. The ListView gets its data from an http API. I am using a Future<void> method called getData to retrieve this data and populate a List<&...
barry's user avatar
  • 4,167
0 votes
1 answer
3k views

I need help with my flutter code which involves firebasefirestore. This is my code. I'd like to retrieve from the database the image_url from the map. final userData = FirebaseFirestore.instance ...
Yarin0600's user avatar
0 votes
1 answer
53 views

That title error is pointed on this line: Text('${intData['summary']['intrested']}') I want to display here data from backend, but I don't know how to accomplish that I am getting this error, but ...
Karol Wiśniewski's user avatar
0 votes
1 answer
720 views

I have a page with a FutureBuilder and a custom widget with multiple FutureBuilders. My goal is to get Future after opening this page, but my FutureBuilders keep calling the Future twice. This is my ...
jsfrz's user avatar
  • 149
1 vote
0 answers
234 views

I'm learning flutter by building an app. I have a like button where I'm displaying the count of likes using a FutureBuilder like this : FutureBuilder( future: likeNotifier.getLikesCount( ...
rawm's user avatar
  • 319
0 votes
1 answer
157 views

I'm building a receipt scanner using the Flutter OCR plugin provided by Veryfi. Here's a Stream function that reads an image and returns a dynamic array containing the necessary values. Note the ...
Centauri_42's user avatar
3 votes
3 answers
4k views

I am trying to write a dart code program which can register users and sign in users, upon error print its description which i will eventually use in a Toast but it given an error on catchError Future&...
Hashan Ranasinghe's user avatar
1 vote
0 answers
1k views

i am trying to call an (Future) http post request in a ChangeNotifier class. That means, after the Future is completed, the notifyListeners() should be called (see example below). No matter, what I ...
Uwe.Schneider's user avatar
0 votes
1 answer
3k views

I'm asking after looking into a lot of examples and similar questions, but I can't get my head around. I just want to get certain data from an id in a json map into Flutter. What I receive via php is ...
JeeJee Studio's user avatar
1 vote
1 answer
2k views

when i try to use CircularProgressIndicator with slow async method, indicator is not shown. When i replace slow custom method with Timer.pereodic() that works fine. I am new in Flutter and do not ...
ohlushenok's user avatar
2 votes
2 answers
973 views

In my app I have a screen which contains 3 different future builders, I would like to update the data recovered from a future builder. I tried the setState () method but this updates all 3 future ...
Luca Orlandi's user avatar
1 vote
1 answer
595 views

In Flutter, I am trying to make a dependent dropdown with the following json. I Want the Dropdown to be in this format First, Independent Dropdown dataNames Second, Dependent Dropdown indexes of the ...
Joel Lee's user avatar
2 votes
1 answer
1k views

CollectionReference users = FirebaseFirestore.instance.collection('Users'); FirebaseAuth auth = FirebaseAuth.instance; String uid = FirebaseAuth.instance.currentUser!.uid.toString(); var ...
이우석's user avatar
1 vote
1 answer
621 views

I have a flutter app which tries to compare two sets of app version numbers, the first version number is stored locally using hive and the second version number is from firestore. I can fetch the data ...
Kevnlan's user avatar
  • 577
0 votes
1 answer
1k views

I'm new to Flutter, and I can't achieve display the snapshot.data value in a widget outside from futureBuilder scope, It's possible to do this? if not, what is the better way to do this? //... var ...
JOTARM's user avatar
  • 1
1 vote
0 answers
451 views

I have this Future and my code template like this: Future getDevices() async { stream.listen(); Timer.periodic(Duration(seconds:5), (timer) { POST TO SERVER.then((value){ return Future.value(...
Baran Gungor's user avatar
1 vote
2 answers
2k views

to demonstrate the problem, let me write down some code for a FutureBuilder. FutureBuilder(future: _myFuture, builder: (context, snapshot) { if(snapshot.hasData) { // !!!! IMPORTANT !!! ...
CodeR_Ax20's user avatar
0 votes
1 answer
537 views

I have the following class for a google map in Flutter. class ExchangeHousesMap extends StatefulWidget { final List<Marker> markers; final double initialLatitude; final double ...
CodeR_Ax20's user avatar
1 vote
0 answers
126 views

I have two class methods inside my Stateful widget. As you can see one method is called inside the other one. 1st class method Future<void> _getExchangeHousesList() async { const url = ...
CodeR_Ax20's user avatar
2 votes
0 answers
532 views

In my flutter application, I'm trying to change the background color of text in list items for an audio playing. So each list item has one audio file. I have to detect when the audio ends and then ...
Noor's user avatar
  • 225
0 votes
2 answers
259 views

I am trying to create a persistent interface which forks db calls to floor or another self made web db static store. Anyway... The interface part is looking like this: peristent_interface.dart import '...
Roar Grønmo's user avatar
  • 4,078
0 votes
0 answers
496 views

As I read Future cant be cancelled in flutter. I am downloading multiple files and showing the progress with LinearProgressIndicator. When user press back button and then come to loading screen again ...
Emma Alden's user avatar
0 votes
1 answer
114 views

I ran into a bit of a problem in flutter that I could not figure out myself. So I have the following code (only the important parts of the code are pasted), class _PrimaryDetailsEditState extends ...
gfit21x's user avatar
  • 151
0 votes
3 answers
5k views

I'm writing a kind of todo list in Flutter, with null safety enabled. I'm storing the list of todo on a sqlite db using sqflite. The Item class is the following: class Item { int? _id; String? ...
mlazzarotto91's user avatar
1 vote
3 answers
2k views

Background Inside the state object of my stateful widget, I have the following code. class _PendingJobsState extends State<PendingJobs> { List<String> pendingJobs = []; <---------...
gfit21x's user avatar
  • 151