Flutter run a function before the buildcontext with FutureBuilder

The problem I have is that I want to run a function before the buildcontext is rendered. What the function does is read the storage to get the token. The function work...

How to keep changing a Images every 5 seconds in Flutter?

State Variables : <pre><code>var moviePhotos = [ "http://www.kiwithebeauty.com/wp-content/uploads/2017/11/BLACK-PANTHER-COLLAGE-KIWI-THE-BEAUTY-MOVIE-MARVEL-800x...

How to create an async callback in Flutter/Dart?

I'm trying to add an async callback to a model in a flutter application so the model can give the view an opportunity to show some dialog before the model continues on...

How Can I get a list of all StreamSubscriptions from the stream

I have a <code>Stream</code> which is listened by <code>StreamProvider</code>. <strong>Question is how to get list of all <code>subscribers</code> of the one pa...

How do I use an async method to build a List Object?

I am getting an error that says that the method .length is calling on a null object _genreList. I am using an async method to get data from a local asset sqlit...

How I can reduce the time of a for loop in Flutter?

I have a method called getNearByPlaces(), then I have for loop that iterates over each place_id, and send a request to google API, to get the name of the place_id, so...

Flutter async await not working as expected

Since I have started Flutter am facing an issue related to Flutter async-await. Most of the time I try to use Future and await for the result it skips the await and ge...

Calling await inside an onTap closure in Flutter

I have a button that writes to the <code>SharedPreferences</code> object. Creating the instance of <code>SharedPreferences</code> is asynchronous, just as writing to i...

Flutter FutureBuilder snapshot returns Instance of Object instead of data

i am new to flutter and trying to display data from a http post referencing from [1]<a href="https://flutter.dev/docs/cookbook/networking/background-parsing" re...

Flutter - How to return current user from Firestore

Trying to retrieve the authenticated user details from the existing Firestore user document, I get the following error: <blockquote> The getter 'uid' was cal...

Show circular progress indicator, async task

I am trying to show a circular progress indicator, while I run an async task. The async task is triggered by a button click and is also directing the user to a new pag...

While the inner method async does the outer method has to be async?

I have an <code>async</code> method. Can I call it from an non-async method? Like the following My method <pre><code> void method() async{ await 'something...

Can I use an asynchronous function in a stream.map()?

Is it possible to pass an asynchronous function into a stream.map() function? <pre><code>final CollectionReference myCollection = FirebaseFirestore.instance.co...

async operation within an async function

For an instance, let's suppose I am calling a function in initState which gets some documents from the Firebase collection. I am iterating on those documents using asy...

Async function returns two different results after another

I have written an async Flutter/Dart function which behaves unexpectedly in my opinion. Following code structure: <pre><code>static Future&lt;bool&gt; verifySometi...