ServiceContainer<T extends Service> constructor

const ServiceContainer<T extends Service>({
  1. Key? key,
  2. required ServiceFactory<T> factory,
  3. required ServiceWidgetBuilder<T> builder,
})

Creates a ServiceContainer that manages a Service instance.

The factory must not be null and is used to create the service. The builder must not be null and is used to build the UI using the service.

Implementation

const ServiceContainer({
  super.key,
  required this.factory,
  required this.builder,
});