Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 885 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 885 Bytes

Flutter Injectable Example

This is an example of how to implement Dependency Injection in your own Flutter project.

Requirements

How to Add Dependencies

To add a dependency, all you need to do is call this code below:

@InjectableInit
void configureDependencies() => getIt.init();  

To handle the generation file run this command on your terminal

flutter pub run build_runner build --delete-conflicting-outputs

It will generates a new file 'injection.config.dart', which will include all dependencies for all use cases.

and on your main func

void main() {
  configureDependencies(); 
  ........