Questions tagged [flutter-future]

71 questions
0
votes
1 answer

Is there a way to change the written date using Cupertino date picker?

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. With normal date picker it is possible but after…
0
votes
0 answers

Future.catchError doesn't catch error thrown by camera plugin's CameraController.initialize

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 throw an exception. I was trying this…
cpper
  • 142
  • 2
  • 13
0
votes
1 answer

Can I make Image.network() to a Future?

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 Exception('Image URL is null'); try{ final ref…
0
votes
2 answers

Flutter: _TypeError

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 xxx = []; @override void initState() { super.initState(); …
macropyre
  • 45
  • 3
0
votes
0 answers

How to use my ImagePaths function into my file so I have access to the index and .length of my list?

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 and I'm not sur how to "call" them in flutter. Can someone…
Coca95
  • 31
  • 5
0
votes
1 answer

getting the return value of Future Function in Flutter without Stateless/Stateful Widget

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 FirebaseFirestore.instance …
0
votes
0 answers

Keep reviving a null value after calling a future function, but the data is clearly there

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 error saying that the value being added is null,…
0
votes
1 answer

How to use function to call it inside the button?

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 appears, the page behind it wouldn't disappear,…
0
votes
1 answer

How to use a async function inside a ListView.builder?

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 other users name in the chat. the issue I am…
Juan Casas
  • 268
  • 2
  • 13
0
votes
1 answer

Error :The method 'update' isn't defined for the type 'DatabaseException'. Error: The method 'delete' isn't defined for the type 'DatabaseException'

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/path_provider.dart'; import…
0
votes
0 answers

How can I build a widget conditionally, based on various different futures that could be called from a few buttons?

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 pseudo code: No data (first/last name null && null…
RobbB
  • 1,214
  • 11
  • 39
0
votes
1 answer

Pass token between future classes in flutter

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 Future fetchAuthStart() async { …
Dymond
  • 2,158
  • 7
  • 45
  • 80
0
votes
0 answers

Future> returns empty - Flutter

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, though, the return looks like this when printed [[],…
Globe
  • 514
  • 3
  • 17
0
votes
1 answer

Flutter How to reach into Future>> inner map

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 .collection('users') …
0
votes
1 answer

The method '[]' was called on null, but it's not null

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 this is not null. Here is my code: var…