Skip to content

Commit

Permalink
Fix mistake in resetLazySingleton method
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Dec 24, 2023
1 parent 178dd6d commit 5ab952b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ build/
# Omit committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

# Local overrides of pub packages.
pubspec_overrides.yaml
2 changes: 1 addition & 1 deletion packages/flutter_ioc_get_it/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ dependencies:
path: ../../flutter_ioc_get_it

environment:
sdk: '>=2.18.1 <3.0.0'
sdk: '>=2.18.1 <4.0.0'
10 changes: 8 additions & 2 deletions packages/flutter_ioc_get_it/lib/src/ioc_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,20 @@ class GetItIocContainer extends IocContainer {

@override
FutureOr<void> resetLazySingleton<T extends Object>({
Object? instance,
T? instance,
String? instanceName,
FutureOr<void> Function(T)? onDispose,
}) =>
_container.resetLazySingleton(
instance: instance,
instanceName: instanceName,
disposingFunction: onDispose,
disposingFunction: (T instance) {
if (onDispose == null) {
return null;
}

return onDispose(instance);
},
);

@override
Expand Down
6 changes: 3 additions & 3 deletions packages/flutter_ioc_get_it/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: flutter_ioc_get_it
description: An implementation of the flutter_ioc package based on get_it.
version: 1.0.0
version: 1.2.0

publish_to: none

environment:
sdk: '>=2.18.1 <3.0.0'
sdk: '>=2.18.1 <4.0.0'

dependencies:
flutter_ioc:
git:
url: https://github.com/baseflow/flutter_ioc
path: packages/flutter_ioc
ref: flutter_ioc_v2.0.0
get_it: ^7.2.0
get_it: ^7.6.4

dev_dependencies:
lints: ^2.0.0
Expand Down

0 comments on commit 5ab952b

Please sign in to comment.