jugger.dart icon indicating copy to clipboard operation
jugger.dart copied to clipboard

Pre-resolving Future?

Open noelmansour opened this issue 1 year ago • 0 comments

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);

noelmansour avatar Nov 22 '23 02:11 noelmansour