Created
June 8, 2021 00:34
-
-
Save diefferson/36cf606caf24993ecd3dbe629b43dd81 to your computer and use it in GitHub Desktop.
Stark Get Injections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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