Skip to main content
Version: 0.7.1

Vertical Variables

This method is used to retrieve a list of vertical variables based on the selected domain (region).

Parameters

ParameterTypeDescription
domainStringDomain code (region) to retrieve vertical variables.
langDataLanguageLanguage for vertical variables data (default: DataLanguage.id).
pageintPage number (default: 1).
variableIDint?Variable ID of the vertical variables (optional).

Examples

Example usage and output:

// Fetch vertical variables data from BPS
final result = await StadataFlutter.instance.list.verticalVariables(
domain: 'example_domain_code', // Replace with the desired domain code
lang: DataLanguage.id,
page: 1,
variableID: 'example_variable_id', // Replace with the desired variable ID or null
);

final variables = result.data;
final pagination = result.pagination;

// Print page information
print('Current page: ${pagination.page}');
print('Total Pages: ${pagination.pages}');
print('Total Data in This Page: ${pagination.count}');
print('PerPage: ${pagination.perPage}');
print('Total: ${pagination.total}');
print('------------------------');

// Print retrieved variables data
for (final variable in variables) {
print('Vertical Variable ID: ${unit.id}');
print('Title: ${unit.title}');
print('Item ID: ${unit.itemID}');
print('Group ID: ${unit.groupID}');
print('Group Name: ${unit.groupName}');
}

Properties (VerticalVariable)

PropertyTypeDescription
idintThe unique identifier for the Vertical Variable.
titleStringThe official title or label of the vertical variable.
itemIDintIt specifies a particular item or element within the vertical variable.
groupIDint?This identifies the group to which the variable belongs.
groupNameString?It indicates the name of the group associated with the variable.