Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@diefferson
Created June 8, 2021 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diefferson/36cf606caf24993ecd3dbe629b43dd81 to your computer and use it in GitHub Desktop.
Save diefferson/36cf606caf24993ecd3dbe629b43dd81 to your computer and use it in GitHub Desktop.
Stark Get Injections
import 'package:stark/stark.dart';
// get simple injection
final MyUseCase useCase = Stark.get();
final useCase = Stark.get<MyUseCase>();
// get named injection
final api = Stark.get<Api>(named: "DEFAULT");
// get injection passing params
final Api api = Stark.get(params: { "token" : "Bearer lorenipsum"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment