CampaignModel class
A single campaign fetched from the Digia backend.
Dart port of the Android CampaignModel. Campaigns are keyed by
campaignKey in CampaignStore and routed by campaignType when the CEP
plugin triggers them.
Constructors
-
CampaignModel({required String id, required String campaignKey, required String campaignType, required CampaignConfigModel config, FrequencyPolicy? frequency, List<
String> targetScreenNames = const <String>[]}) -
const
Properties
- campaignKey → String
-
final
- campaignType → String
-
final
- config → CampaignConfigModel
-
final
- frequency → FrequencyPolicy?
-
Server-configured frequency cap, or
nullwhen the campaign has none. Consulted by theFrequencyManagerto gate and silence the campaign.final - hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
targetScreenNames
→ List<
String> -
Screens this campaign may show on. Empty means every screen — that is
the wire's "unrestricted", not "nowhere".
final
Methods
-
allowsScreen(
String? currentScreen) → bool -
Whether this campaign may render while the host is on
currentScreen. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> json, {DesignTokenCatalog designTokens = DesignTokenCatalog.empty, ServerTimeClock? serverClock}) → CampaignModel? -
Parses one campaign object from the
getCampaignsresponse.