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
But Is there a way to create a scoped service per screen or page?
In .net we have like an AddScoped(MyService()), which registers the service with a scoped lifetime, Scoped Service are the same within an http request, but different across different http requests.
is that possible with get_it? a scope per screen and when the screen is closed, these scoped service will be disposed as well
The text was updated successfully, but these errors were encountered:
In general scopes are organized in a stack. Each object registered in a lower scope is accessible from higher scopes unless you register the sane type in a higher scope than that instance will shadow the already registered one.
As said you can use watch_it's pushScope function that will create a new scope when the widget is built the first time and Pop it when the widget gets destroyed.
Am 1. Sept. 2024, 21:28 +0100 schrieb malabuyocfritz1984 ***@***.***>:
Hi,
I'm new to get_it so apologies in advance.
But Is there a way to create a scoped service per screen or page without having to re-register the same service in another screen scope?
In .net we have like an AddScoped(MyService()), which registers the service with a scoped lifetime, Scoped Service are the same within an http request, but different across different http requests.
so I'm wondering if there is a way to do that in get_it? a scope per screen and when the screen is closed, these scoped service will be disposed as well
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm new to get_it so apologies in advance.
But Is there a way to create a scoped service per screen or page?
In .net we have like an AddScoped(MyService()), which registers the service with a scoped lifetime, Scoped Service are the same within an http request, but different across different http requests.
is that possible with get_it? a scope per screen and when the screen is closed, these scoped service will be disposed as well
The text was updated successfully, but these errors were encountered: