buildClient method

  1. @protected
T buildClient(
  1. HttpServiceConfig<T> config
)

Implementation

@protected
T buildClient(HttpServiceConfig<T> config) {
  final builder = config.builder;
  final client = config.client;
  if (builder != null) {
    final builtClient = builder(client);
    return builtClient;
  } else {
    final builtClient = client;
    if (builtClient is! T) {
      throw HttpServiceException(
        'The client should be of type `$T`',
      );
    }
    return builtClient;
  }
}