Skip to content

Commit 746aad9

Browse files
committed
refactor(ads): simplify NativeAd model
- Remove common native ad fields from the model - Keep only the essential adObject field - Update class documentation to reflect changes
1 parent d85137d commit 746aad9

File tree

1 file changed

+2
-48
lines changed

1 file changed

+2
-48
lines changed

lib/ads/models/native_ad.dart

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,20 @@ import 'package:flutter/foundation.dart';
55
/// A generic, provider-agnostic model representing a native advertisement.
66
///
77
/// This model decouples the application's core logic from specific ad network
8-
/// SDKs (e.g., Google Mobile Ads). It contains common fields found in native
9-
/// ads and holds a reference to the original, SDK-specific ad object for
10-
/// rendering purposes.
8+
/// SDKs (e.g., Google Mobile Ads). It holds a reference to the original,
9+
/// SDK-specific ad object for rendering purposes.
1110
/// {@endtemplate}
1211
@immutable
1312
class NativeAd extends Equatable {
1413
/// {@macro native_ad}
1514
const NativeAd({
1615
required this.id,
17-
required this.headline,
18-
required this.body,
19-
required this.callToAction,
20-
this.iconUrl,
21-
this.imageUrl,
22-
this.advertiser,
23-
this.starRating,
24-
this.store,
25-
this.price,
2616
required this.adObject,
2717
});
2818

2919
/// A unique identifier for this specific native ad instance.
3020
final String id;
3121

32-
/// The main headline or title of the advertisement.
33-
final String headline;
34-
35-
/// The main body text or description of the advertisement.
36-
final String body;
37-
38-
/// The text for the call-to-action button (e.g., "Install", "Learn More").
39-
final String callToAction;
40-
41-
/// The URL of the ad's icon image (e.g., app icon).
42-
final String? iconUrl;
43-
44-
/// The URL of the main image asset for the ad.
45-
final String? imageUrl;
46-
47-
/// The name of the advertiser or sponsor.
48-
final String? advertiser;
49-
50-
/// The star rating for the advertised app (typically 1.0 to 5.0).
51-
final double? starRating;
52-
53-
/// The name of the app store (e.g., "Google Play", "App Store").
54-
final String? store;
55-
56-
/// The price of the advertised app or product.
57-
final String? price;
58-
5922
/// The original, SDK-specific ad object.
6023
///
6124
/// This object is passed directly to the ad network's UI widget for rendering.
@@ -66,15 +29,6 @@ class NativeAd extends Equatable {
6629
@override
6730
List<Object?> get props => [
6831
id,
69-
headline,
70-
body,
71-
callToAction,
72-
iconUrl,
73-
imageUrl,
74-
advertiser,
75-
starRating,
76-
store,
77-
price,
7832
adObject,
7933
];
8034
}

0 commit comments

Comments
 (0)