Skip to content

Commit e5cf932

Browse files
committed
feat(ads): add headline image style parameter for native and banner ads
- Add HeadlineImageStyle? parameter to loadNativeAd and loadBannerAd methods - Update documentation to reflect new parameter and its purpose - Maintain existing functionality while enhancing ad request capabilities
1 parent 612005a commit e5cf932

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/ads/ad_provider.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:core/core.dart';
22
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/ad_theme_style.dart';
3-
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/banner_ad.dart'; // Import the new BannerAd model
3+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/banner_ad.dart';
44
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/interstitial_ad.dart';
55
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/native_ad.dart';
66

@@ -30,10 +30,13 @@ abstract class AdProvider {
3030
/// The [adPlatformIdentifiers] provides the platform-specific ad unit IDs.
3131
/// The [adId] is the specific identifier for the ad slot (e.g., native ad unit ID).
3232
/// The [adThemeStyle] provides UI-agnostic theme properties for ad styling.
33+
/// The [headlineImageStyle] provides the user's preference for feed layout,
34+
/// which can be used to request an appropriately sized ad.
3335
Future<NativeAd?> loadNativeAd({
3436
required AdPlatformIdentifiers adPlatformIdentifiers,
3537
required String? adId,
3638
required AdThemeStyle adThemeStyle,
39+
HeadlineImageStyle? headlineImageStyle,
3740
});
3841

3942
/// Loads an inline banner ad.
@@ -45,10 +48,13 @@ abstract class AdProvider {
4548
/// The [adPlatformIdentifiers] provides the platform-specific ad unit IDs.
4649
/// The [adId] is the specific identifier for the ad slot (e.g., banner ad unit ID).
4750
/// The [adThemeStyle] provides UI-agnostic theme properties for ad styling.
51+
/// The [headlineImageStyle] provides the user's preference for feed layout,
52+
/// which can be used to request an appropriately sized ad.
4853
Future<BannerAd?> loadBannerAd({
4954
required AdPlatformIdentifiers adPlatformIdentifiers,
5055
required String? adId,
5156
required AdThemeStyle adThemeStyle,
57+
HeadlineImageStyle? headlineImageStyle,
5258
});
5359

5460
/// Loads a full-screen interstitial ad.

0 commit comments

Comments
 (0)