Skip to content

anggaaryas/simple_clean_getit_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Clean GetIt Generator

Simple generate service locator using GetIt and clean architecture.

Whats the different with other library?

this library simplify the implementation and can inject the service locator in order

How to use

  1. Install get_it (https://pub.dev/packages/get_it)
  2. Install build_runner (https://pub.dev/packages/build_runner)
  3. this library support adding Repository, DataSource, and Service.

for example:

@AddRepositoryOf(services: [AuthRepository, UserInfoRepository], tag: "Remote")
class RemoteRepository implements AuthRepository, UserInfoRepository{
   
   // some implementation...

}
  1. then run build_runner command:
     flutter pub run build_runner build
  1. Then there will be a new file called service_locator.g.dart inside lib/

Supported Annotation

@AddRepositoryOf()

@AddDataSourceOf()

@AddServiceOf()

About

Simple getIt generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published