Class configuration
0 min
The Optimizely Configured Commerce Mobile SDK relies on GetIt for the service locator. To add a new service, follow these steps:
- Define your interface with the new methods.
- Implement your interface.
- Add your class to the GetIt Service Locator in lib/core/injection/injection_container.dart.
- (Optional) Add your class to the CoreServiceProvider: lib/features/domain/service/interfaces/core_service_provider_interface.dart and lib/features/domain/service/core_service_provider.dart
When added in injection_container.dart, you can access your service from anywhere using CoreServiceProvider or with sl<YourInterfaceName>().yourProperty.