jugger.dart
jugger.dart copied to clipboard
Pre-resolving Future?
Hi there. Wondering if there's a way to pre-resolve a future. e.g.
@provides
static Future<PackageInfo> providePackageInfo() => PackageInfo.fromPlatform();
Then have a dependency that uses PackageInfo directly instead of Future<PackageInfo>:
@inject
DependentConstructor(PackageInfo pi);
From what I've tried so far, this isn't possible. Only the Future can be injected:
@inject
DependentConstructor(Future<PackageInfo> piFuture);