Asset

View as Markdown

Asset

The asset provides asset methods

version

Specify the version number of the asset that you wish to retrieve. If the version is not specified, the details of the latest version will be retrieved..

import contentstack;


final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");

final asset = stack.asset("assetUid")..version();

includeFallback

Retrieve the published content of the fallback locale if an entry is not localized in specified locale.

import contentstack;


final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");

final asset = stack.asset("assetUid")..includeFallback();

includeDimension

include the dimensions (height and width) of the image in the response. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, and PSD.

import contentstack;


final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");

final asset = stack.asset("assetUid")..includeDimension();

environment

To fetch the content based on specific environment

NameTypeDescription
environment (required)String

The environment

import contentstack;


final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");