Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

popScopeUntil should allow baseScope with inclusive: false #299

Closed
ccadieux opened this issue Nov 1, 2022 · 3 comments
Closed

popScopeUntil should allow baseScope with inclusive: false #299

ccadieux opened this issue Nov 1, 2022 · 3 comments

Comments

@ccadieux
Copy link

ccadieux commented Nov 1, 2022

Thank you for adding the inclusive flag on popScopeUntil. I feel the assert needs to be updated with the new flag though.
https://github.com/fluttercommunity/get_it/blob/master/lib/get_it_impl.dart#L795

This should be valid but fails due to the current assert. Since it's popping everything except the baseScope.

  await GetIt.I.popScopesTill('baseScope', inclusive: false);

Current:

assert(scopeName != _baseScopeName, "You can't pop the base scope");

Suggested

assert(inclusive && scopeName != _baseScopeName, "You can't pop the base scope");
@escamoteur
Copy link
Collaborator

Sorry for the late response, I had to take a longer break due to health issues. Thanks for this catch, will be fixed in the next release

thomas-watchenterprise pushed a commit that referenced this issue May 8, 2023
@escamoteur
Copy link
Collaborator

fixed in V7.6.0

@ccadieux
Copy link
Author

ccadieux commented May 9, 2023

Thank you. Good to see you back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants