Replies: 6 comments
-
Can you load your data in main() before starting the UI portion of your app? |
Beta Was this translation helpful? Give feedback.
-
I don't know why I didn't think about it sooner! Now i have the current structure:
|
Beta Was this translation helpful? Give feedback.
-
The only thing i can think is that those futures are way too long: When the app is in HOT state it just works. |
Beta Was this translation helpful? Give feedback.
-
I don't know what the hot and cold states are. |
Beta Was this translation helpful? Give feedback.
-
COLD is when the app is not opened anywhere, Hot it is in background or in somewhere else. |
Beta Was this translation helpful? Give feedback.
-
If I were you, I'd only do the things in |
Beta Was this translation helpful? Give feedback.
-
I need to load a json from an API using a future on startup BEFORE anything, even before the MaterialApp.router(), because i need to parse some urls and find some ids and redirect to some slugs.
When i open the app from a link, the app opens but it just go to the initialLocation, but if the app is alwready open or in second plane, the link just works!
I tried to use android:launchMode="singleTask" but the problem persists.
So the code is like this:
`
`
This findProgramIdBySlug function search on the json loaded in the future for an ID that the slug belongs, so in my URL things be like:
mywebsite/program and not mywebsite/91589asf9851u987h1892yu58h7!3.
This makes the sharing of links user-friendly for us, but im not getting it to work whe the link need to open the app for the first time.
Beta Was this translation helpful? Give feedback.
All reactions