/simple_clean_getit_generator

Simple getIt generator

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

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