Skip to main content
Version: 0.6.3

News

This method is used to retrieve detailed information about a specific news.

Parameters

ParameterTypeDescription
idintThe unique identifier of the news.
domainStringThe domain (region) code for retrieving news detail.
langDataLanguageThe language for news data (default: DataLanguage.id).

Example

Example usage and sample output:

Preview

// Fetch news detail from BPS API
final news = await StadataFlutter.instance.view.news(id: 12:, domain: '7200');

// Print the retrieved news category data
print('News ID: ${news.id}');
print('Category: ${news.category}');
print('Title: ${news.title}');
print('Content: ${news.content}');
print('Release Date: ${news.releaseDate}');
print('Picture: ${news.picture}');
print('------------------------');

Properties (News)

PropertyTypeDescription
idintThe unique identifier for the news.
categoryIdStringThe category identifier for the news (optional).
categoryString?The name of the news category (optional).
titleStringThe title of the news.
contentStringThe content of the news.
releaseDateDateTimeThe date when the news was released.
pictureStringThe picture associated with the news.