ApplicationHost constructor

ApplicationHost(
  1. List<BaseService Function()> factories, {
  2. bool failWithServices = true,
  3. LogBackend? logBackend,
  4. Function? onInitialized,
  5. List<String> args = const <String>[],
  6. Map<String, dynamic> config = const <String, dynamic>{},
})

Creates a ServiceHost instance.

failWithServices service hosts terminates the app if a single service fails to initialize. logBackend initializes LogService with custom backend. onInitialized is called when service initialization is done. Feed the command line arguments from the applications main function into args for the ConfigService to detect configuration arguments. config provides default configuration values to the ConfigService.

Implementation

ApplicationHost(
  super.factories, {
  super.failWithServices = true,
  super.logBackend,
  this.onInitialized,
  super.args = const <String>[],
  super.config = const <String, dynamic>{},
});