createClient method
Creates a borrowed client. The test owns this controller and must close it.
Implementation
HttpClient createClient(
{String? baseUrl,
Map<String, String> defaultHeaders = const {},
List<HttpInterceptor> interceptors = const [],
Duration? timeout}) {
if (_closed) throw StateError('Testing controller closed.');
final options = HttpClientRegistrationBuilder(
baseUrl: baseUrl,
defaultHeaders: defaultHeaders,
interceptors: interceptors,
timeout: timeout)
.build()
.options;
return HttpClientService(transport: this, options: options);
}