DownloadOptions constructor

DownloadOptions({
  1. required String url,
  2. String? filename,
  3. FilenameConflictAction? conflictAction,
  4. bool? saveAs,
  5. HttpMethod? method,
  6. List<HeaderNameValuePair>? headers,
  7. String? body,
})

Implementation

DownloadOptions({
  /// The URL to download.
  required String url,

  /// A file path relative to the Downloads directory to contain the
  /// downloaded
  /// file, possibly containing subdirectories. Absolute paths, empty paths,
  /// and paths containing back-references ".." will cause an error.
  /// [onDeterminingFilename] allows suggesting a filename after the file's
  /// MIME type and a tentative filename have been determined.
  String? filename,

  /// The action to take if `filename` already exists.
  FilenameConflictAction? conflictAction,

  /// Use a file-chooser to allow the user to select a filename regardless of
  /// whether `filename` is set or already exists.
  bool? saveAs,

  /// The HTTP method to use if the URL uses the HTTP[S] protocol.
  HttpMethod? method,

  /// Extra HTTP headers to send with the request if the URL uses the HTTP[s]
  /// protocol. Each header is represented as a dictionary containing the keys
  /// `name` and either `value` or
  /// `binaryValue`, restricted to those allowed by XMLHttpRequest.
  List<HeaderNameValuePair>? headers,

  /// Post body.
  String? body,
}) : _wrapped = $js.DownloadOptions(
        url: url,
        filename: filename,
        conflictAction: conflictAction?.toJS,
        saveAs: saveAs,
        method: method?.toJS,
        headers: headers?.toJSArray((e) => e.toJS),
        body: body,
      );