ImageRenderMethodForWeb enum

Currently there are 2 different ways to show an image on the web with both their own pros and cons, using a custom HttpGet or an HTML Image element mentioned here on a GitHub issue.

When using HttpGet the image will work on Skia and it will use the CachedNetworkImageProvider.headers when they are provided. In this package it also uses any url transformations that might be executed by the CachedNetworkImageProvider.cacheManager. However, this method does require a CORS handshake and will not just work for every image from the web.

The HtmlImage does not need a CORS handshake, but it also does not use your provided headers and it does not work when using Skia to render the page.

Constants

HtmlImage → const ImageRenderMethodForWeb

HtmlImage uses a default web image including default browser caching. This is the recommended and default choice.

const ImageRenderMethodForWeb(0)
HttpGet → const ImageRenderMethodForWeb

HttpGet uses an http client to fetch an image. It enables the use of headers, but loses some default web functionality.

const ImageRenderMethodForWeb(1)
values → const List<ImageRenderMethodForWeb>

A constant List of the values in this enum, in order of their declaration.

const List<ImageRenderMethodForWeb>

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited