Skip to content

Commit

Permalink
fix: add generic type annotation to registerSingleton() call
Browse files Browse the repository at this point in the history
This fixes the now (from Dart SDK 3 onwards required) generic type annotation when calling `registerSingleton` from GetIt. Check the following issue: 
fluttercommunity/get_it#331 (comment)
  • Loading branch information
flawnn authored Mar 12, 2024
1 parent d584155 commit e99bc44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion injectable/lib/src/get_it_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class GetItHelper {
if (_canRegister(registerFor)) {
if (preResolve) {
return factoryFunc().then(
(instance) => getIt.registerSingleton(
(instance) => getIt.registerSingleton<T>(
instance,
instanceName: instanceName,
signalsReady: signalsReady,
Expand Down

0 comments on commit e99bc44

Please sign in to comment.