Hosts.multiple constructor

Hosts.multiple({
  1. List<ApiHost> api = defaultApiHosts,
  2. List<ImageHost> image = defaultImageHosts,
  3. List<ThumbnailHost> thumbnail = defaultThumbnailHosts,
})

Creates a hosts config with multiple host of each type.

Implementation

Hosts.multiple({
  List<ApiHost> api = defaultApiHosts,
  List<ImageHost> image = defaultImageHosts,
  List<ThumbnailHost> thumbnail = defaultThumbnailHosts,
}) : hosts = {
  HostType.api: api,
  HostType.image: image,
  HostType.thumbnail: thumbnail,
} {
  if (api.isEmpty || image.isEmpty || thumbnail.isEmpty)
    throw ArgumentError('Missing hosts definition.');
}