HttpApiProvider constructor

HttpApiProvider({
  1. Client? client,
})

Pass a client to reuse connections across requests, or to substitute a MockClient from package:http/testing.dart in tests. When omitted a private client is created and owned by this provider.

Implementation

HttpApiProvider({http.Client? client})
  : _client = client ?? http.Client(),
    _ownsClient = client == null;