URLBuilder class

URLBuilder facilitates the building of imgix URLs.

params

  • domain : Domain of urls to be generated.
  • shouldUseHttpsByDefault : If true,generated urls start with "https" prefix. Otherwise, "http".
  • defaultSignKey : Key to sign generated url.
  • includeLibParam : If true, generated Urls contain libParam. LibParam is "dart-$IMGIX_LIB_VERSION"

Constructors

URLBuilder({required String domain, bool shouldUseHttpsByDefault = true, String? defaultSignKey, bool includeLibParam = false})

Properties

hashCode int
The hash code for this object.
no setterinherited
isHttps bool
no setter
isSigned bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildDPRBasedSrcsetEntries(String path, {Map<String, String> params = const <String, String>{}}) Map<String, String>
buildSrcsetEntries returns srcset urls paired with quality as Map<int,String>. Key is quality("1"~"5") and value is path.
buildParams(Map<String, String> params) String
buildParams uri-encodes query parameter keys and values, and then concatenates them into String with delimiter '&'.
buildSrcset(String path, {Map<String, String> params = const <String, String>{}, SrcsetOption options = const SrcsetOption.base()}) String
buildSrcsetEntries(String path, {Map<String, String> params = const <String, String>{}, required Iterable<int> targets}) Map<int, String>
buildSrcsetEntries returns srcset urls paired with width as Map<int,String>. Key is width and value is path.
createPlainURLString(String path) String
createPlainURLString generates imgix url with default options.
createSrcsetFromWidths(String path, {Map<String, String> params = const <String, String>{}, required List<int> widths}) String
createURL(String path) Uri
create an Uri instance which wraps Imgix URL String.
createURLString(String path, {Map<String, String> params = const <String, String>{}, bool? useHttps, bool? includeLibraryParams}) String
createURLString generates imgix url with optional query parameters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setDefaultIncludeLibParamStatus(bool useLibParam) → void
setDefaultIncludeLibParamStatus toggles the _shouldIncludeLibParamByDefault on and off.
setDefaultSignKey(String signKey) → void
setDefaultUseHttpsStatus(bool useHttps) → void
setDefaultUseHttpsStatus sets a builder's _useHttpsByDefault field to true or false.
toString() String
A string representation of this object.
inherited
withSignature(String path, String queryParams, String signKey) String
withSignature adds md5 signature to query parameter.

Operators

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