simple_clean_getit_generator 0.1.2 simple_clean_getit_generator: ^0.1.2 copied to clipboard
Simple Service Locator generator using GetIt on clean architecture
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 #
- Install get_it (https://pub.dev/packages/get_it)
- Install build_runner (https://pub.dev/packages/build_runner)
- this library support adding Repository, DataSource, and Service.
for example:
@AddRepositoryOf(services: [AuthRepository, UserInfoRepository], tag: "Remote")
class RemoteRepository implements AuthRepository, UserInfoRepository{
// some implementation...
}
- then run build_runner command:
flutter pub run build_runner build
- Then there will be a new file called
service_locator.g.dart
inside lib/