We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
popScopesTill pops scopes including the one passed. This behaviour is a bit odd until generally means up to but not including.
I ended up having to write my own function to accomplish this behaviour. It would be nice if the library provided this even if it's just a toggle.
Future<void> popScopesTill<T extends Object>( {String scopeName = 'baseScope'}) async { while (GetIt.I.currentScopeName != scopeName) { await GetIt.I.popScope(); } }
Something like this maybe:
@override Future<bool> popScopesTill(String scopeName, [bool inclusive = true]) async { assert(scopeName != _baseScopeName, "You can't pop the base scope"); if (_scopes.firstWhereOrNull((x) => x.name == scopeName) == null) { return false; } String? _scopeName; do { _scopeName = _currentScope.name; await popScope(); } while (inclusive ? _scopeName : _currentScope.name != scopeName); onScopeChanged?.call(false); return true; }
The text was updated successfully, but these errors were encountered:
good point, included in next release
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
popScopesTill pops scopes including the one passed. This behaviour is a bit odd until generally means up to but not including.
I ended up having to write my own function to accomplish this behaviour. It would be nice if the library provided this even if it's just a toggle.
Something like this maybe:
The text was updated successfully, but these errors were encountered: