ModelDownloader constructor

ModelDownloader({
  1. Uri? baseUrl,
  2. HttpClient? httpClient,
})

Creates a downloader.

baseUrl lets you point at a mirror or an internal copy; it must end with a slash for the file name to resolve against it. Pass httpClient to reuse a client you already configured — proxies, certificates, timeouts; in that case closing it stays your responsibility.

Implementation

ModelDownloader({Uri? baseUrl, HttpClient? httpClient})
  : baseUrl = baseUrl ?? defaultBaseUrl,
    _httpClient = httpClient ?? HttpClient(),
    _ownsClient = httpClient == null;