GitHubClient constructor

GitHubClient({
  1. Client? client,
  2. DiskCache? cache,
  3. Duration timeout = const Duration(seconds: 10),
})

Creates a GitHubClient.

  • client: optional injectable HTTP client for testing.
  • cache: optional DiskCache for caching responses.
  • timeout: per-request timeout.

Implementation

GitHubClient(
    {http.Client? client,
    DiskCache? cache,
    Duration timeout = const Duration(seconds: 10)})
    : _http = client ?? http.Client(),
      _cache = cache,
      _timeout = timeout;