Skip to content

Commit f0e40d2

Browse files
committed
feat(ads): add native ad template type
- Introduce NativeAdTemplateType enum to define visual templates for native ads - Add templateType property to NativeAd class - Update NativeAd props to include templateType - Improve documentation for ad-related classes and enums
1 parent 09f7e82 commit f0e40d2

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/ads/models/native_ad.dart

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
import 'package:equatable/equatable.dart';
22
import 'package:flutter/foundation.dart';
33

4+
/// {@template native_ad_template_type}
5+
/// Defines the visual template type for a native ad.
6+
///
7+
/// This is used to determine the expected size and layout of the native ad
8+
/// when rendering it in the UI.
9+
/// {@endtemplate}
10+
enum NativeAdTemplateType {
11+
/// A small native ad template, typically used for compact layouts.
12+
small,
13+
14+
/// A medium native ad template, typically used for more prominent layouts.
15+
medium,
16+
}
17+
418
/// {@template ad_provider_type}
519
/// Defines the supported ad network providers.
620
///
@@ -11,7 +25,7 @@ enum AdProviderType {
1125
/// Google AdMob provider.
1226
admob,
1327

14-
/// A placeholder provider for platforms where native ads are not supported.
28+
/// A placeholder provider for platforms where native ad SDKs are not supported.
1529
///
1630
/// This is primarily used for the web demo environment to maintain UI
1731
/// consistency without relying on native SDKs.
@@ -33,6 +47,7 @@ class NativeAd extends Equatable {
3347
required this.id,
3448
required this.provider,
3549
required this.adObject,
50+
required this.templateType,
3651
});
3752

3853
/// A unique identifier for this specific native ad instance.
@@ -50,6 +65,9 @@ class NativeAd extends Equatable {
5065
/// only within the dedicated ad rendering widget for that provider.
5166
final Object adObject;
5267

68+
/// The template type of the native ad, indicating its expected size and layout.
69+
final NativeAdTemplateType templateType;
70+
5371
@override
54-
List<Object?> get props => [id, provider, adObject];
72+
List<Object?> get props => [id, provider, adObject, templateType];
5573
}

0 commit comments

Comments
 (0)