environment method

void environment(
  1. String environment
)

Enter the name of the environment if you wish to retrieve the assets published in a particular environment. environment required

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

Implementation

void environment(String environment) {
  assetParameter['environment'] = environment;
}