You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using the get_it dependency injection package in a Flutter web app, and I encountered an issue when reloading the page.
In my Flutter web app, I initialize dependencies using get_it only after a user successfully authenticates. This setup works perfectly during normal usage. However, when the page is refreshed or reloaded, all the registered dependencies in get_it are lost, leading to "dependency not found" errors. This issue affects the app’s functionality post-authentication after a reload.
Steps to Reproduce:
Set up a Flutter web app with the get_it package.
Configure the app to initialize dependencies using get_it only after the user successfully authenticates.
Authenticate a user and verify that dependencies are properly registered and accessible.
Refresh or reload the web page in the browser.
Attempt to access a previously registered dependency.
Notice the "dependency not found" error, indicating the dependencies are lost.
Expected Behavior:
There should be a way to handle page reloads in web environments to ensure that dependencies are either persisted or re-initialized automatically. Guidance on best practices for using get_it in Flutter web apps, specifically when dependencies are tied to authentication states, would be very helpful.
The text was updated successfully, but these errors were encountered:
hmmm, can you provide a small repro project? That definitely shouldn't happen. Without seeing your code I fear I have no idea to find out what is happening
Hi, I am using the get_it dependency injection package in a Flutter web app, and I encountered an issue when reloading the page.
In my Flutter web app, I initialize dependencies using get_it only after a user successfully authenticates. This setup works perfectly during normal usage. However, when the page is refreshed or reloaded, all the registered dependencies in get_it are lost, leading to "dependency not found" errors. This issue affects the app’s functionality post-authentication after a reload.
Steps to Reproduce:
Expected Behavior:
There should be a way to handle page reloads in web environments to ensure that dependencies are either persisted or re-initialized automatically. Guidance on best practices for using get_it in Flutter web apps, specifically when dependencies are tied to authentication states, would be very helpful.
The text was updated successfully, but these errors were encountered: