Skip to content

Commit

Permalink
V7.1.1
Browse files Browse the repository at this point in the history
I forgot to add the last change to the GetIt class. It was only added to
GetItImplementation
  • Loading branch information
escamoteur committed May 5, 2021
1 parent 515ca3f commit 4bc79ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [7.1.1] - 05.05.2021

* `pushNewScope()` now got an optional `init` parameter where you can pass a function that registers new objects inside the newly pushed Scope. Doing the registration in this function ensures that the `onScopeChanged` call-back is called after the objects are registered.

## [7.1.0] - 05.05.2021

* The new `Disposable` interface had a typo that now got corrected. You could call this a breaking change but as the last version change is just three days old I guess not many people will be affected by this correction.
Expand All @@ -13,8 +17,6 @@ The getit_mixin has a matching `rebuiltOnScopeChange` method.
/// the correct Objects after a scope change
void Function(bool pushed)? onScopeChanged;
```
* `pushNewScope()` now got an optional `init` parameter where you can pass a function that registers new objects inside the newly pushed Scope. Doing the registration in this function ensures that the `onScopeChanged` call-back is called after the objects are registered.

## [7.0.0] - 02.05.2021

This is a breaking change because there were some inconsistencies in the handling of the disposal functions that you can pass when registering an Object, pop a Scope or use `unregister()` `resetLazySingleton()`´. Some of accepted a `FutureOr` method type, others just a `void` which meant you couldn't use async functions consistently. With this release you can use async functions in all disposal functions which unfortunately also required to change the signatures of the following functions:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ Another example could be a shopping basket where you want to ensure that not a c
/// by using the name.
/// [dispose] function that will be called when you pop this scope. The scope
/// is still valied while it is executed
void pushNewScope({String scopeName, ScopeDisposeFunc dispose});
/// [init] optional function to register Objects immediately after the new scope is
/// pushed. This ensures that [onScopeChanged] will be called after their registration
void pushNewScope({void Function(GetIt getIt)? init,String scopeName, ScopeDisposeFunc dispose});
/// Disposes all factories/Singletons that have ben registered in this scope
/// and pops (destroys) the scope so that the previous scope gets active again.
Expand Down
3 changes: 3 additions & 0 deletions lib/get_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ abstract class GetIt {
/// by using the name.
/// [dispose] function that will be called when you pop this scope. The scope
/// is still valied while it is executed
/// [init] optional function to register Objects immediately after the new scope is
/// pushed. This ensures that [onScopeChanged] will be called after their registration
void pushNewScope({
void Function(GetIt getIt)? init,
String? scopeName,
ScopeDisposeFunc? dispose,
});
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: get_it
description: Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App"
version: 7.1.0
version: 7.1.1
maintainer: Thomas Burkhart (@escamoteur)
authors:
- Flutter Community <[email protected]>
Expand Down

0 comments on commit 4bc79ce

Please sign in to comment.