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>[], bool audienceGated = false, CampaignRule? rule}) -
const
Properties
- audienceGated → bool
-
Whether this campaign may only be shown to certain people.
final
- 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
- rule → CampaignRule?
-
The compiled
dmc_rule@1, when Digia owns the decision to show it.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. -
allowsUser(
List< String> eligibleCampaigns) → bool - Whether this campaign may be shown to the current user.
-
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.