fluttercommunity/flutter_after_layout

I want to wait for some data to load before i show the dialog

Emmanuelfrimpong opened this issue · 3 comments

in my project i get data from database on initialization, and i want to show dialog after the data is fetched .
can this library help me? the dialog pop up even before the data is fetched.

Use a Future to fetch your date in the function and then to show the dialog when it's competed

in my project i get data from database on initialization, and i want to show dialog after the data is fetched .
can this library help me? the dialog pop up even before the data is fetched.

Make sure you await while you access the database.
You could paste the code for a more precise answer. Also, I believe this is not the right place to ask How to questions :)

You can now override afterFirstLayout as a Future as of v1.2.0. Just remember to call if(mounted) before you try and use your context.