scope
A Dependency injection (Inversion of Control) library. Supports nested Scopes and multiple values of the same type.
5.1.0
238K downloads/mo
#787 most downloaded on pub.dev
onepub-dev/scope
What this package is like to depend on
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 12 months
Nearly every release is documented
notes for 14 of 15 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
16 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
16 releases · Mar 2021 to Aug 2024Releases
latest 16-
5.1.013 Aug 2024Release notes
Open source →- changed ScopeKey ctors so they are consts. The examples that show them being consts are now correct.
-
5.0.027 Jul 2024 -
4.1.127 Jul 2024Release notes
Open source →- Fixed an error in the README example. Use of wrong type.
- Cleared out a few lint fixes.
-
4.1.001 Aug 2023 -
4.0.117 May 2023 -
4.0.015 May 2023 -
3.0.016 Oct 2022Release notes
Open source →-
BREAKING: The Scope.run method is now asynchronous. Use Scope.runSync to run a synchronous method. You will likely have to change how you call the run method. If you have been using something like:
final scope = Scope() ..value<int>(keyAge, 10) ..run(() { Future.delayed(oneSecond, () { print('Age: ${use(keyAge)}'); }); });You will need to change it to:
final scope = Scope() ..value<int>(keyAge, 10); await scope.run(() async { Future.delayed(oneSecond, () { print('Age: ${use(keyAge)}'); }); }); -
added copyright notices.
-
Created an example of how overrides work.
-
Changed the debugName on ScopeKey.withDefault to optional to match ScopeKey.
-
Added missing types from global scope unit tests.
-
-
2.3.0-beta.115 Jan 2022 pre-releaseRelease notes
Open source →- Added a GlobalScope object which implements a Singleton pattern which can be overriden by injecting a Scope.
-
2.2.108 Jan 2022Release notes
Open source →- Improved debug messages for ScopeKeys by providing the type and debug name if available.
-
2.2.007 Jan 2022Release notes
Open source →- ENH: Added new method hasScopeValue
- ENH: added withDefault argument to
useto provide site specific defaults - BREAKING: Subtle change to method hasScopeKey. Previously it return true if the key was in scope or if it had a default value. Use hasScopeValue to get the original implementation and use hasScopeKey to check if a key exists.
-
2.1.207 Jan 2022 -
2.1.107 Jan 2022 -
2.1.007 Jan 2022Release notes
Open source →- Deprecated factory in favour of single. Added sequence in favour of the originally planned generator.
-
2.0.206 Jan 2022 -
2.0.006 Jan 2022 -
1.0.010 Mar 2021Nothing published for this version