getAdByCountryAndLanguage method

Future<FastResponseAd?> getAdByCountryAndLanguage(
  1. String country,
  2. String language, {
  3. String? providerId,
  4. String? appId,
  5. int? limit,
})

Retrieves an advertisement by country and language from the API.

Returns a FastResponseAd object if an ad with the specified country, language, appId, and providerId exists, otherwise returns null.

Implementation

Future<FastResponseAd?> getAdByCountryAndLanguage(
  String country,
  String language, {
  String? providerId,
  String? appId,
  int? limit,
}) async {
  final ads = await getAdsByCountryAndLanguage(
    country,
    language,
    providerId: providerId,
    appId: appId,
    limit: limit,
  );

  return getRandomItem<FastResponseAd>(ads);
}