Skip to content

Commit

Permalink
V7.6.9
Browse files Browse the repository at this point in the history
  • Loading branch information
escamoteur committed Apr 11, 2024
1 parent fc5eee7 commit 1acf4b7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [7.6.9] - 11.04.2024
* fig for bug that was introduced in 7.6.8 https://github.com/fluttercommunity/get_it/issues/358

## [7.6.8] - 03.04.2024
* merged PR by @venkata-reddy-dev https://github.com/fluttercommunity/get_it/pull/356 adding new `skipDoubleRegistration` flag for testing

Expand Down
17 changes: 9 additions & 8 deletions lib/get_it_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ class _TypeRegistration<T extends Object> {
namedFactories.clear();
}

bool get isEmpty => factories.isEmpty && namedFactories.isEmpty;

_ServiceFactory<T, dynamic, dynamic>? getFactory(String? name) {
return name != null ? namedFactories[name] : factories.firstOrNull;
}
Expand Down Expand Up @@ -1289,16 +1291,15 @@ class _GetItImplementation implements GetIt {
),
);

final typeRegistration = factoryToRemove.registeredIn;

if (instanceName != null) {
factoryToRemove.registeredIn.namedFactories.remove(instanceName);
typeRegistration.namedFactories.remove(instanceName);
} else {
final factories = factoryToRemove.registeredIn.factories;
if (factories.contains(factoryToRemove)) {
factories.remove(factoryToRemove);
if (factories.isEmpty) {
factoryToRemove.registrationScope.typeRegistrations.remove(T);
}
}
typeRegistration.factories.remove(factoryToRemove);
}
if (typeRegistration.isEmpty) {
factoryToRemove.registrationScope.typeRegistrations.remove(T);
}

if (factoryToRemove.instance != null) {
Expand Down
18 changes: 5 additions & 13 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ packages:
dependency: "direct dev"
description:
name: lint
sha256: d758a5211fce7fd3f5e316f804daefecdc34c7e53559716125e6da7388ae8565
sha256: "77b3777e8e9adca8e942da1e835882ae3248dfa00488a2ebbdbc1f1a4aa3f4a7"
url: "https://pub.dev"
source: hosted
version: "2.3.0"
version: "2.2.0"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -345,22 +345,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web:
dependency: transitive
description:
name: web
sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa
url: "https://pub.dev"
source: hosted
version: "0.4.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: "045ec2137c27bf1a32e6ffa0e734d532a6677bf9016a0d1a406c54e499ff945b"
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
url: "https://pub.dev"
source: hosted
version: "2.4.1"
version: "2.4.0"
webkit_inspection_protocol:
dependency: transitive
description:
Expand All @@ -378,4 +370,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.0 <4.0.0"
dart: ">=3.1.0 <4.0.0"
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.6.8
version: 7.6.9
maintainer: Thomas Burkhart (@escamoteur)
homepage: https://github.com/fluttercommunity/get_it
funding:
Expand Down

0 comments on commit 1acf4b7

Please sign in to comment.