Host constructor

Host(
  1. HostType type,
  2. String authority, [
  3. bool ssl = true
])

Creates host config of corresponding type.

Implementation

factory Host(HostType type,
  String authority, [
    bool ssl = true,
  ]
) {
  switch (type) {
    case HostType.api:
      return ApiHost(authority, ssl);
    case HostType.image:
      return ImageHost(authority, ssl);
    case HostType.thumbnail:
      return ThumbnailHost(authority, ssl);
  }
}