Skip to main content
Version: 0.7.1

Infographics

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

Parameters

ParameterTypeDescription
domainStringThe domain (region) code for retrieving infographics.
langDataLanguageThe language for infographic data (default: DataLanguage.id).
pageintThe page number (default: 1).
keywordString?A keyword for searching infographics (optional).

Example

Example usage and sample output:

Preview

// Fetch infographic data from BPS API
final infographicResult = await StadataFlutter.instance.list.infographics(
domain: 'example_domain_code', // Replace with the desired domain code
lang: DataLanguage.id,
page: 1,
keyword: 'example_keyword', // Replace with desired keyword or null
);

final infographicList = infographicResult.data;
final pagination = infographicResult.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 infographic data
for (final infographic in infographicList) {
print('Infographic ID: ${infographic.id}');
print('Title: ${infographic.title}');
print('Image URL: ${infographic.image}');
print('Description: ${infographic.description}');
print('Category: ${infographic.category}');
print('Download URL: ${infographic.downloadUrl}');
print('------------------------');
}

Properties (Infographic)

PropertyTypeDescription
idStringThe unique identifier of the infographic.
titleStringThe title or name of the infographic.
imageStringThe URL of the image associated with the infographic.
descriptionString?A brief description of the infographic's content.
categoryStringThe category or topic to which the infographic belongs.
downloadUrlStringThe URL from which the infographic can be downloaded.