📄️ Counter Service
Here’s a quick example showing how to add a service to the Dependy module and retrieve it.
📄️ Multiple Services
In this example, we’ll demonstrate how to use Dependy to manage multiple services within a module and retrieve them when needed. We'll create two simple services, LoggerService and MathService, register them in a DependyModule, and then access and use them in our main function.
📄️ Depends on
In this example, we demonstrate how Dependy handles services with dependencies on other services, using a configuration service (ConfigService), a logging service (LoggerService), and a calculator service (CalculatorService).
📄️ Combine Modules
In this example, we demonstrate how to use Dependy to manage services with dependencies on each other in a modular system. The code demonstrates how to structure and use different modules to create services like DatabaseService, ApiService, AuthService, and PaymentService.
📄️ Scopes
This example demonstrates how to use Dependy to manage scoped services alongside singleton services in a Dart application.
📄️ Eager Module
This example demonstrates how to use the Dependy library to create an eager-loaded module where all dependencies are resolved synchronously. The asEager() extension allows you to eagerly resolve and instantiate services immediately when the module is created, rather than lazily resolving them on demand.