version method

void version(
  1. int 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. To retrieve a specific version, keep the environment parameter blank. version required

var stack = contentstack.Stack(apiKey, deliveryToken, environment);
final asset = stack.asset(asset_uid)..version(2);
asset.fetch<AssetModel, void>().then((response) {
  print(response);
}).catchError((error) {
  print(error['error_code']);
});

Implementation

void version(int version) {
  assetParameter['version'] = version.toString();
}