Skip to content

Commit 5aaa242

Browse files
committed
feat(ads): add native ad view abstraction
- Create an abstract NativeAdView widget to define the interface for rendering native ads - This abstraction allows for provider-agnostic UI components and supports multiple ad network SDKs - Concrete implementations will handle the actual rendering of native ad content
1 parent d24848f commit 5aaa242

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_news_app_mobile_client_full_source_code/ads/models/native_ad.dart'
3+
as app_native_ad;
4+
5+
/// {@template native_ad_view}
6+
/// An abstract widget that defines the interface for rendering a native ad.
7+
///
8+
/// Concrete implementations of this widget will be responsible for displaying
9+
/// the native ad content from a specific ad network SDK (e.g., AdMob).
10+
/// This abstraction ensures that the higher-level UI components remain
11+
/// provider-agnostic.
12+
/// {@endtemplate}
13+
abstract class NativeAdView extends StatelessWidget {
14+
/// {@macro native_ad_view}
15+
const NativeAdView({required this.nativeAd, super.key});
16+
17+
/// The generic native ad data to display.
18+
///
19+
/// This object contains the original, SDK-specific ad object, which concrete
20+
/// implementations will cast and render.
21+
final app_native_ad.NativeAd nativeAd;
22+
}

0 commit comments

Comments
 (0)