Questions tagged [flutter-future]

71 questions
0
votes
1 answer

type 'Future' is not a subtype of type 'ApplicationMeta'

I get this error 'type 'Future' is not a subtype of type 'ApplicationMeta'. I create a payment function. payment function type is future. This function returns installedUpiapps in the list. I need to pass an argument to appWidget. But I get…
0
votes
1 answer

Result of consuming a Future with future.then() seems to only live inside the .then function()

I am building an app as a project for university and one of the requirements is to play videos within the app. I have links to exercise videos (bicep curls and so on) stored in a column of a table in SQLite. I am using Moor in order to interact with…
0
votes
0 answers

Unhandled Exception: setState() called in constructor:

I know that there are a lot of similar questions but none helped me, that's why I'm posting this one, so please bear with me. My screen is: import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import…
0
votes
1 answer

FutureBuilder does not complete when using an Anmiation inside

I have a FutureBuilder, where I retrieve data from Firestore. I do that in initState, as it was often suggested here. Future _tour; @override void initState() { super.initState(); _tour =…
Lars
  • 1,250
  • 9
  • 25
0
votes
3 answers

Why the function is returning an empty list in Flutter

So Here's the code. The error is when calling loadSounds function from outside the class returns an empty list. But when loadSounds is called from loadcategories it works fine and returns a list containing instances of Sound. Even priniting the…
Shivam Singh
  • 87
  • 2
  • 11
-1
votes
1 answer

Future.delayed method not working in Flutter

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 Duration(milliseconds: 300), method());
-1
votes
1 answer

Flutter: Dart Cast Error (Null check operator used on null value)

I am new with Flutter, I am trying to open camera, for this I followed example code but when ever I debug my app it gives me Exception as shown in image Here's my code: import 'dart:async'; import 'package:flutter/material.dart'; import…
-1
votes
2 answers

Flutter futurebuilder nested futures returning null

I am trying to work with different user roles and after logging in they should be directed to different pages however the futurebuilder I am trying to use to do so returns null. The element.data['role'] is correct and is being printed out before the…
eoghanC01
  • 41
  • 4
-2
votes
2 answers

What should I do when I have to use "void function() async" as a last resort in Flutter?

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 function() async instead of void function() async. However, I can't use await in Widget…
My Car
  • 4,198
  • 5
  • 17
  • 50
-2
votes
1 answer

FutureBuilder doesn't wait until future completes

In my app I want to initialize something before my widgets will be created. I need to do it exactly in App class and trying to use FutureBuilder for this purpose. But _AppBlocProvider's build method is called before initInjectionContainer(), for…
Yaro Best
  • 29
  • 1
  • 5
-5
votes
1 answer

I have List i need to convert ApplicationMeta type

List apps = []; @override void initState() { UpiPay.getInstalledUpiApplications().then((value) { setState(() { this.apps = value; print('successfully append'); }); }).catchError((e) { print('im in error…
1 2 3 4
5