getFileIcon method

Future<String?> getFileIcon(
  1. int downloadId,
  2. GetFileIconOptions? options
)

Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message. |downloadId|: The identifier for the download. |callback|: A URL to an image that represents the download.

Implementation

Future<String?> getFileIcon(
  int downloadId,
  GetFileIconOptions? options,
) async {
  var $res = await promiseToFuture<String?>($js.chrome.downloads.getFileIcon(
    downloadId,
    options?.toJS,
  ));
  return $res;
}