Questions tagged [flutter-future]
71 questions
0
votes
1 answer
Flutter FutureBuilder called twice
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 page:
class HomePage extends StatefulWidget {
…

jsfrz
- 99
- 9
0
votes
1 answer
Flutter: Cannot retrieve data from a Future function on FutureBuilder
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 credentials from VeryfiDart are removed.
The showImage…

Centauri_42
- 33
- 3
0
votes
1 answer
How can I use a Variable of JSON data in Flutter (not a listview)
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 2 strings of JSON (it's correct JSON I've checked…

JeeJee Studio
- 57
- 1
- 10
0
votes
1 answer
Flutter/Dart FutureBuilder - How to store a snapshot.data in a variable and pass the value to other widget?
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 result = '0.00';
Row(children: [
const…

JOTARM
- 1
0
votes
2 answers
How to listen for state changes inside a FutureBuilder widget and reflect the state change?
to demonstrate the problem, let me write down some code for a FutureBuilder.
FutureBuilder(future: _myFuture, builder: (context, snapshot) {
if(snapshot.hasData) {
// !!!! IMPORTANT !!!
// Pay attention to the _isFirstText…

CodeR_Ax20
- 91
- 1
- 8
0
votes
1 answer
How to add a marker to a google map upon tapping button on the parent widget in flutter
I have the following class for a google map in Flutter.
class ExchangeHousesMap extends StatefulWidget {
final List markers;
final double initialLatitude;
final double initialLongitude;
const ExchangeHousesMap({
Key? key,
…

CodeR_Ax20
- 91
- 1
- 8
0
votes
2 answers
A value of type 'Future' can't be assigned to a variable of type 'AppDatabase'
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 'package:flutter/material.dart';
import…

Roar Grønmo
- 2,926
- 2
- 24
- 37
0
votes
0 answers
How to deal with Future wait list when using progress bar in Flutter
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 LinearProgressIndicator dows not work but from…

Emma Alden
- 129
- 16
0
votes
1 answer
My stateful widget does not update the ui, even though I am calling setState and passing the correct value to the widget class
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 State {
String bankName; …

gfit21x
- 141
- 9
0
votes
3 answers
The getter 'length' isn't defined for the type 'Future>'
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? _name;
String? _notes;
String? _expiryDate;
…

mlazzarotto91
- 103
- 3
- 13
0
votes
1 answer
Instance of '_Future' instead of input value in Translator package from Flutter
this scope gives me Instance of _Future but I want to get that translated text.
Future translate(String input) async {
final translator = GoogleTranslator();
var result;
var translation = await translator
.translate(input, to: 'tr')
…

bach
- 33
- 4
0
votes
1 answer
Flutter await not working with Firestore QuerySnapShot
I am trying to get users contacts and search my database(firestore) for each contact's phone number .
I successfully achieve getting contacts and querying firestore for each number but i when I want to await to get() the results of the query flutter…

R3HP
- 470
- 4
- 13
0
votes
1 answer
How to get notified for a parallel futures in flutter
Hello I am doing parallel network calls in flutter using the following code.
List results = await Future.wait([
apiCall1(),
apiCall2(),
...more api calls
]);
I need to update the status of each api call. Is there a…

raphire
- 198
- 9
0
votes
2 answers
how create future function in flutter?
i trying to create post function in flutter
here is my code:
Future makePostRequest() async {
String requestResult;
var body = this.toMapRequest();
String requestUrl = RequestZarinpal.PAYMENT_REQUEST_URL;
String…

asal rad
- 43
- 1
- 5
0
votes
1 answer
Call widget in Future function Flutter
Basically I have a button(GestureDetector) which to call Future function in the same file. The thing is the widget in that function does not appear as it should but the background process is successfully running.
The trigger:
showDialog(
context:…

Mohamad Aiman
- 43
- 1
- 11