- changed ScopeKey ctors so they are consts. The examples that show them being consts are now correct.
- updated dev dependencies.
- Fixed an error in the README example. Use of wrong type.
- Cleared out a few lint fixes.
- update links to doc and repo.
- upgraded dependencies
- upgraded to dart 3.0.
-
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.
- Added a GlobalScope object which implements a Singleton pattern which can be overriden by injecting a Scope.
- Improved debug messages for ScopeKeys by providing the type and debug name if available.
- ENH: Added new method hasScopeValue
- ENH: added withDefault argument to
use
to 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.
- purged singleton from the doc as it is now single.
- purged the term generator for the code/doco as it should be sequence.
- Deprecated factory in favour of single. Added sequence in favour of the originally planned generator.
updated description again.
Updated readme and pubspec description.
- renamed packaged to scope.
- changed hasScopeKey to not throw an exception internally as it is a pain when debugging with all exception catching on.
updated lib to confirm with naming conventions.
Initial release.