diff --git a/.gitignore b/.gitignore index 65c34dc..de71c2a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/packages/flutter_ioc_get_it/example/pubspec.yaml b/packages/flutter_ioc_get_it/example/pubspec.yaml index 3ff694b..dd87ce8 100644 --- a/packages/flutter_ioc_get_it/example/pubspec.yaml +++ b/packages/flutter_ioc_get_it/example/pubspec.yaml @@ -9,4 +9,4 @@ dependencies: path: ../../flutter_ioc_get_it environment: - sdk: '>=2.18.1 <3.0.0' \ No newline at end of file + sdk: '>=2.18.1 <4.0.0' \ No newline at end of file diff --git a/packages/flutter_ioc_get_it/lib/src/ioc_container.dart b/packages/flutter_ioc_get_it/lib/src/ioc_container.dart index b351cdc..bbaeb29 100644 --- a/packages/flutter_ioc_get_it/lib/src/ioc_container.dart +++ b/packages/flutter_ioc_get_it/lib/src/ioc_container.dart @@ -75,14 +75,20 @@ class GetItIocContainer extends IocContainer { @override FutureOr resetLazySingleton({ - Object? instance, + T? instance, String? instanceName, FutureOr Function(T)? onDispose, }) => _container.resetLazySingleton( instance: instance, instanceName: instanceName, - disposingFunction: onDispose, + disposingFunction: (T instance) { + if (onDispose == null) { + return null; + } + + return onDispose(instance); + }, ); @override diff --git a/packages/flutter_ioc_get_it/pubspec.yaml b/packages/flutter_ioc_get_it/pubspec.yaml index 1b9ecb3..3815298 100644 --- a/packages/flutter_ioc_get_it/pubspec.yaml +++ b/packages/flutter_ioc_get_it/pubspec.yaml @@ -1,11 +1,11 @@ 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: @@ -13,7 +13,7 @@ dependencies: 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