The Dart Content Delivery SDK (contentstack package on pub.dev) is planned for deprecation. We recommend using the Content Delivery API for new integrations.
The Dart Content Delivery SDK (contentstack package on pub.dev) is planned for deprecation. We recommend using the Content Delivery API for new integrations.
Contentstack is a headless CMS with an API-first approach. It is a CMS that developers can use to build powerful cross-platform applications in their favorite languages. Build your application front end, and Contentstack will take care of the rest. Read More.
Contentstack provides Dart Delivery SDK to build applications on top of Dart. Given below is the detailed guide and helpful resources to get started with our Dart Delivery SDK.
This guide will help you get started with Contentstack Dart SDK to build Flutter apps powered by Contentstack.
To use the Contentstack Dart SDK with your existing project, perform the following steps:
Create a New Flutter Project in VS Code
Create a New Project in Android Studio
Add Dart Dependencies to Your Project
To use Contentstack's Dart SDK in your existing project, you need to add the following code within your pubspec.yaml file:
dependencies: contentstack: any
You can download the latest dependency version here.
Contentstack offers six regions North America (NA), Europe (EU), Azure North America (AZURE_NA), Azure Europe (AZURE_EU), GCP North America (GCP_NA), and GCP Europe (GCP_EU) as data centers to store customers' account details and data. These regions are independent of each other and therefore have a dedicated set of instructions to use SDKs offered by Contentstack.
To use SDKs for the Europe, Azure NA, Azure EU region, GCP NA, or GCP EU you will have to make certain changes in the configuration of the SDK, as detailed below, and the rest of the instructions remain the same.
Add this to your package's pubspec.yaml file:
dependencies: contentstack: ^any
To initialize the SDK, enter the stack’s API key, delivery token, and environment name where you will publish the content, as shown in the snippet below:
import 'package:contentstack/contentstack.dart' as contentstack;
final stack = contentstack.Stack(apiKey, deliveryToken, environment, region: contentstack.Region.<add_your_region>);Note: By default, the SDK uses the North American region. Configuration changes are not required for North American region users.
Refer the below code if you want to use the Europe, Azure North America, Azure Europe, GCP North America region, or GCP Europe.
import 'package:contentstack/contentstack.dart' as contentstack;
final stack = contentstack.Stack(apiKey, deliveryToken, environment, region: contentstack.Region.<add_your_region>);Once you have initialized the SDK, you can query entries to fetch the required content.
For Setting the branch for Europe, Azure North America, Azure Europe, GCP North America, or GCP Europe refer the code below:
For Setting Branch
import 'package:contentstack/contentstack.dart' as contentstack;
final stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment', branch: 'branch');Contentstack SDKs let you interact with the Content Delivery APIs and retrieve content from Contentstack. They are read-only in nature. The SDKs fetch and deliver content from the nearest server via Fastly, our powerful and robust CDN.
Get a Single Entry
To retrieve a single entry from a content type, use the code snippet given below:
import contentstack
stack = contentstack.Stack(api_key='api_key', delivery_token='delivery_token', environment='environment')
contentType = stack.content_type("content_type_uid")
entry = content_type.entry("entry_uid")
response = entry.fetch()Get Multiple Entries
To retrieve multiple entries of a particular content type, use the code snippet given below:
import contentstack
stack = contentstack.Stack(api_key='api_key', delivery_token='delivery_token', environment='environment')
query = stack.content_type("content_type_uid").query()
response = query.find()In a single instance, the Get Multiple Entries query will retrieve only the first 100 items of the specified content type. You can paginate and retrieve the rest of the items in batches using the skip and limit parameters in subsequent requests.
final stack = contentstack.Stack( "apiKey", "deliveryToken", "environment");
final query = stack.contentType("contentTypeUid").entry().query().skip(20).limit(20);
await query.find().then((response){
print(response);
}).catchError((onError){
print(onError.message);
});
Stack an instance of ContentType, asset, assetQuery, and sync
In this API request, you need to provide the sync_token that you received in the last complete sync process. If there are more than 100 records, you will get a pagination_token instead
| Name | Type | Description |
|---|---|---|
syncToken | String | sync token fetches only the content that was added after your last sync |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.syncToken("syncToken")The Sync API takes care of syncing your Contentstack data with your app and ensures that the data is always up-to-date by providing delta updates.
| Name | Type | Description |
|---|---|---|
contentTypeUid | String | content type UID. e.g., products This retrieves published entries of specified content type. |
fromDate | String | Enter the start date. e.g., 2018-08-14T00:00:00.000Z This retrieves published entries starting from a specific date |
locale | String | Enter locale code. e.g., en-us This retrieves published entries of the specific locale |
publishType | PublishType | Applicable values are:
If you do not specify any value, it will bring all published entries and published assets. |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.sync("contentTypeUid", "fromDate", "locale", PublishType.Entry_Published)Adds host for the request
| Name | Type | Description |
|---|---|---|
host (required) | String | The host for the API url |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHost("host") </span>adds header using header key and value
| Name | Type | Description |
|---|---|---|
key (required) | String | The header key |
value (required) | String | the header value |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.setHeader("headerKey", "headerValue") </span>Remove header using headerKey
| Name | Type | Description |
|---|---|---|
headerKey (required) | String | The header key |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
stack.removeHeader("headerKey") </span>| Name | Type | Description |
|---|---|---|
paginationToken (required) | String | The pagination token |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var response = stack.paginationToken("paginationToken") </span>The Image Delivery API is used to retrieve, manipulate and/or convert image files of your Contentstack account and deliver it to your web or mobile properties.
| Name | Type | Description |
|---|---|---|
imageUrl (required) | String | Base Image Url of the image you want to manipulate |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var image = stack. </span>ContentType accepts contentTypeId in as the parameter
| Name | Type | Description |
|---|---|---|
queryParams (required) | Map | ContentType accepts query params as parameter |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.ContentType accepts contentTypeId in as the parameter
| Name | Type | Description |
|---|---|---|
contentTypeId (required) | String | ContentType accepts contentTypeId as the parameter |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var contentType = stack.contentType("contentTypeId")It also returns the content of each asset in JSON format.
| Name | Type | Description |
|---|---|---|
uid (required) | String | Asset uid |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var assets = stack.assetQuery()This call fetches the latest version of a specific. asset of a particular stack.
| Name | Type | Description |
|---|---|---|
uid (required) | String | Asset uid |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var asset = stack.asset("uid")Live preview of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var preview = stack.getLivePreviewhost of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var host = stack.hostenvironment of the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var environment = stack.environmentendpoint for the api
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var endpoint = stack.endpointdelivery token for the stack
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
var deliveryToken = stack.deliveryTokenan instance of the stack
| Name | Type | Description |
|---|---|---|
apiKey (required) | String | apiKey of the stack |
deliveryToken (required) | String | Delivery Token for the stack |
environment (required) | String | Environment of the stack |
apiVersion | String | apiVersion is version of the API Default: v3 |
region | Region | DB region for your stack. You can choose from six regions namely, NA, EU, Azure NA, Azure EU, GCP NA, and GCP EU. |
host | String | host of the api |
livePreview | dict | live preview for the stack |
client | BaseClient | Client to make API request |
import Contentstack
final stack = contentstack.Stack(apiKey, deliveryToken, environment);apiKey of for the stack
import Contentstack
final stack = contentstack.Stack("", "", "");
var apiKey = stack.apiKeyThe asset provides asset methods
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();
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();
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();
To fetch the content based on specific environment
| Name | Type | Description |
|---|---|---|
environment (required) | String | The environment |
import contentstack;
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
The AssetQuery provides query on assets
Included branch in the response.
import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..includeBranch();
Specify the version number of the asset that you wish to retrieve.
import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..version(3);
includes the relative URLs of the assets in the response
import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..relativeUrls();
Retrieve the published content of the fallback locale if an entry is not localized in specified locale.
import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..includeFallback();
include the dimensions (height and width) of the image in the response.
import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..includeCount();
To retrieve the count of entries.
import contentstack
var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..includeCount();
Enter the name of the [environment] if you wish to retrieve the assets published in a particular environment.
| Name | Type | Description |
|---|---|---|
environment (required) | String | The Environment |
import Contentstack
final stack = final contentType = stack.contentType(“content_type_uid”);
final asset = stack.assetQuery()..environment();ImageTransformation provides Query on image URL
The brightness parameter allows you to increase or decrease the intensity with which an image reflects or radiates perceived ligh.
| Name | Type | Description |
|---|---|---|
brightness (required) | int | you can also define brightness using any decimal number |
import contentstack;
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final imageTransformation = stack.imageTransform(imageUrl).brightness(3)
The blur parameter allows you to decrease the focus and clarity of a given image. To specify the extent to which you need to increase the blurriness of an image, use any decimal number (float) between 1 and 1000.
| Name | Type | Description |
|---|---|---|
blur (required) | int | It can accept hexadecimal, combination of (Red, Blue, Green) and (Red, Blue, Green, Alpha) |
import contentstack;
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final imageTransformation = stack.imageTransform(imageUrl).bgBolor('Red')
he bg-color function lets you set a backgroud color for the given image. This is useful when applying padding or for replacing the transparent pixels of an image..
| Name | Type | Description |
|---|---|---|
bgColor | String | It can accept hexadecimal, combination of (Red, Blue, Green) and (Red, Blue, Green, Alpha) |
import contentstack;
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final imageTransformation = stack.imageTransform(imageUrl).bgBolor('Red')
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.
| Name | Type | Description |
|---|---|---|
auto | String | auto parameter is set to webp |
format | String | The format |
import contentstack;
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final imageTransformation = stack.imageTransform(imageUrl).auto(auto: 'webp', format: 'pjpg')
Content provides an instance of and entry and query
This call returns information of a specific content type. It returns the content type schema, but does not include its entries.
| Name | Type | Description |
|---|---|---|
queryParams | Map<String, dynamic> | The Query Parameters |
import Contentstack
final stack = final contentType = stack.contentType(“content_type_uid”);
final Map queryParameter = {"key": "value"};
queryParameter[“include_snippet_schema”] = true;
queryParameter[“limit”] = 3;
final response = contentType.fetch(queryParameter);This function provide option to get single entry as well as all the entries
| Name | Type | Description |
|---|---|---|
entry_uid | String | the entry uid |
import Contentstack
final stack = contentstack.Stack('apiKey','deliveryToken','environment');
final contentType = stack.contentType();
final entry = contentType.entry(entryUid: 'entry_uid');This call returns comprehensive information of all the content types available in a particular stack in your account.
| Name | Type | Description |
|---|---|---|
queryParam | Map<String, String> | Query parameters |
import Contentstack
final stack = contentstack.Stack('apiKey','deliveryToken','environment');
final contentType = stack.contentType().query();
var response = contentType.find();This method includes the Global field's schema along with the content type schema.
import Contentstack
final stack = contentstack.Stack('apiKey','deliveryToken','environment');
final contentType = stack.contentType().query();
contentType.includeGlobalField()This method includes the includeCount method facilitate to find the total count of content types available in your stack.
import Contentstack
final stack = contentstack.stack("apiKey", "delieveryToken", "environment")
final entry = stack.contentType("contentType").entry("uid");
entry.includeCount();The Entry provides data based on entry uid
Specifies an array of only keys in BASE object that would be included in the response.
| Name | Type | Description |
|---|---|---|
fieldUid (required) | List<String> | The field uid is list of string |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.only(fieldUid);This method also includes the content type UIDs of the referenced entries returned in the response.
| Name | Type | Description |
|---|---|---|
locale (required) | String | The locale code |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.locale('en-eu');This method also includes the content type UIDs of the referenced entries returned in the response.
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeReferenceContentTypeUID();Include Reference: When you fetch an entry of a content type that has a reference field, by default, the content of the referred entry is not fetched. It only fetches the UID of the referred entry, along with the content of the specified entry.
| Name | Type | Description |
|---|---|---|
referenceFieldUid (required) | String | referenceFieldUid Key who has reference to some other class object |
includeReferenceField | Include | includeReference provides three options, none, only and except |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeReference("referenceFieldUid", IncludeReference.none(fieldUidList: null));Includes branch in the response
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeBranch();Include Embedded Objects (Entries and Assets) along with entry/entries details
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeEmbeddedItems();Retrieve the published content of the fallback locale if an entry is not localized in specified locale.
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeFallback();Include Content Type of all returned objects along with objects themselves
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.includeContentType();Specifies list of field uids that would be excluded from the response.
| Name | Type | Description |
|---|---|---|
fieldUid (required) | List<String> | field uid which get excluded from the response |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.except(fieldUid); // This method adds key and value to an Entry.
| Name | Type | Description |
|---|---|---|
key (required) | String | The key as string which needs to be added to an Entry |
value (required) | String | The value as string which needs to be added to an Entry |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final entry = stack.contentType('contentType').entry("uid");
entry.addParam(key, value);The Query provides entries based on queries applied
Get entries containing the field values matching the condition in the query.
| Name | Type | Description |
|---|---|---|
fieldUid (required) | String | The field uid |
queryOperation (required) | QueryOperation | The QueryOperation |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.where("fieldUid", QueryOperation);The number of objects to skip before returning any.
| Name | Type | Description |
|---|---|---|
skipCount (required) | Int | No of objects to skip from returned objects |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.skip(4);Add a custom query against specified key.
| Name | Type | Description |
|---|---|---|
key (required) | String | key for the query |
value (required) | String | value for the query |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.addQuery("param_key", "param_value");This method adds key and value to an Entry.
| Name | Type | Description |
|---|---|---|
key (required) | String | key by which you can sort the results in descending order |
value (required) | String | value of the param against the key |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.param("Key", "Value");Sort the results in descending order with the given key.
| Name | Type | Description |
|---|---|---|
key (required) | String | key by which you can sort the results in descending order |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.orderByDescending("descendingKey");sort the results in ascending order with the given key.
| Name | Type | Description |
|---|---|---|
key (required) | String | key by which you can sort the results in ascending order |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.ascending("ascKey");A limit on the number of objects to return.
| Name | Type | Description |
|---|---|---|
limitCount (required) | int | the count you want to limit your response |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.limit(2);Add a custom query against specified key. parameters The key and value pair that will be added to the Query
| Name | Type | Description |
|---|---|---|
parameters (required) | Map | comma-separated string value |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.addParams("keyword1", "keyword2", "keyword3");This method adds key and value to the Query as Query parameter.
| Name | Type | Description |
|---|---|---|
key (required) | String | Key of the query parameter |
value (required) | String | Value of the Query parameter against the key |
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('contentType').entry().query();
query.addParam("Key", "Value")includes branch in the response
import Contentstack
final stack = contentstack.stack(apiKey, delieveryToken, environment)
final query = stack.contentType('room').entry().query();
query.includeBranch()Get entries having values based on referenced fields This query retrieves all entries that satisfy the query conditions made on referenced fields.
| Name | Type | Description |
|---|---|---|
referenceUid (required) | String | The referenced uid |
reference (required) | QueryReference | It accepts Enum type QueryReference.include() OR QueryReference.NotInclude() and it accepts instance of Query |
import Contentstack
final query = stack.contentType('room').entry().query();
query.referenceSearch('fieldUid', QueryReference.include(query: query));
await query.find().then((response){
print(response);
});
adds header to the request
| Name | Type | Description |
|---|---|---|
key (required) | String | key of the header |
value (required) | String | value of the header against the key |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.setHeader("key", "value")Removed header from the request by key
| Name | Type | Description |
|---|---|---|
key (required) | String | key of the header |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.removeHeader("key")entries that satisfy at least one of the given conditions provided
| Name | Type | Description |
|---|---|---|
listOfQuery (required) | QueryOperator.and(queryObjects: List<Query>) | QueryOperator using and/or functions that accepts list of queries |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");final query = stack.contentType('contentTypeUid').entry().query();query.operator(QueryOperator.OR);
final stackInstance1 = Credential.stack(); final queryBase1 = stackInstance1.contentType('room').entry().query(); queryBase1.where('title', QueryOperation.equals(value: 'Room 13'));
final stackInstance2 = Credential.stack(); final queryBase2 = stackInstance2.contentType('room').entry().query(); queryBase2.where('attendee', QueryOperation.equals(value: 20));
final List listOfQuery = [queryBase1, queryBase2];
query.operator(QueryOperator.or(queryObjects: listOfQuery));
await query.find().then((response)
{
print(response.toString());
}).catchError((onError){
print(onError);
});provides data that contains only mentinoed keywords
| Name | Type | Description |
|---|---|---|
fieldUid (required) | List<String> | Array of the only reference keys to be included in response |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.only(fieldUid);[locale] is the code of the language in which the entries need to be included.
| Name | Type | Description |
|---|---|---|
locale (required) | String | [locale] is code of the language of which the entries needs to be included. |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.locale("locale_code");This method also includes the content type UIDs of the referenced entries returned in the response
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.includeReferenceContentTypeUID();When you fetch an entry of a content type that has a reference field, by default, the content of the referred entry is not fetched. It only fetches the UID of the referred entry, along with the content of the specified entry
| Name | Type | Description |
|---|---|---|
referenceFieldUid (required) | String | Key who has reference to some other class object |
includeReferenceField | IncludeReference | provides three options, none, only and except i.e accepts list of fieldUid |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.includeReference("referenceFieldUid", IncludeReference.except(fieldUidList: fieldUid));;Include Embedded Objects (Entries and Assets) along with entry/entries details
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.includeEmbeddedItems();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 query = stack.contentType('contentTypeUid').entry().query();
query.includeFallback();Include Content Type of all returned objects along with objects
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.includeContentType();Specifies list of field uids that would be excluded from the response. [fieldUid] field uid which get excluded from the response.
| Name | Type | Description |
|---|---|---|
fieldUid (required) | List<String> | fieldUid is String type of List |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
query.except(fieldUid);This method adds key and value to an Entry.
| Name | Type | Description |
|---|---|---|
key (required) | String | key of the parameter |
value (required) | String | value of the param against the key |
import Contentstack
final stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
final query = stack.contentType('contentTypeUid').entry().query();
entry.addParam("key", "value");