Skip to main content
Version: 0.7.0

Static Tables

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

Parameters

ParameterTypeDescription
domainStringThe domain (region) code for retrieving static tables.
langDataLanguageThe language for static table data (default: DataLanguage.id).
pageintThe page number (default: 1).
keywordString?A keyword for searching static tables (optional).
monthint?The month for filtering static tables (optional - 1..12).
yearint?The year for filtering static tables (optional).

Example

Example usage and sample output:

Preview

// Fetch static table data from BPS API
final staticTableResult = await StadataFlutter.instance.list.staticTable(
domain: 'example_domain_code', // Replace with the desired domain code
lang: DataLanguage.id,
page: 1,
keyword: 'example_keyword', // Replace with desired keyword or null
month: null, // Replace with desired month or null
year: null, // Replace with desired year or null
);

final staticTableList = staticTableResult.data;
final pagination = staticTableResult.pagination;

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

// Print the retrieved static table data
for (final staticTable in staticTableList) {
print('Table ID: ${staticTable.id}');
print('Table Title: ${staticTable.title}');
print('Subject ID: ${staticTable.subjectId}');
print('Subject: ${staticTable.subject}');
print('Size: ${staticTable.size}');
print('Table: ${staticTable.table}');
print('Updated At: ${staticTable.updatedAt}');
print('Created At: ${staticTable.createdAt}');
print('Excel Link: ${staticTable.excel}');
}

Properties (StaticTable)

PropertyTypeDescription
idintThe unique identifier of the table.
titleStringThe title or name of the table.
subjectIdintThe optional subject identifier associated with the table.
subjectString?The optional subject name or description.
sizeStringThe file size.
tableString?The HTML representation of the table.
updatedAtDateTimeThe date and time when the table was last updated.
createdAtDateTime?The optional date and time when the table was created.
excelStringA link or reference to the associated Excel file for the table.