Register dependencies
Use Get.put for immediate registration.
Immediate registration
service_locator.dart
final authService = Get.put(AuthService());
final controller = Get.put(LoginController(authService));Docs mirror / Dependency management
The same DI helpers remain available: register eagerly, register lazily, and wire route-level bindings without changing your app architecture.
Register dependencies
Get.put for immediate registration.Immediate registration
service_locator.dart
final authService = Get.put(AuthService());
final controller = Get.put(LoginController(authService));Lazy registration
Get.lazyPut when you want deferred creation.Lazy registration
bindings.dart
Get.lazyPut<ApiClient>(() => ApiClient());
Get.lazyPut<ProfileController>(() => ProfileController(Get.find()));Bindings
Bindings example
profile_binding.dart
class ProfileBinding extends Bindings {
@override
void dependencies() {
Get.lazyPut<ProfileController>(() => ProfileController(Get.find()));
}
}