GamificationConfig class final
The parsed gamification campaign payload: templateConfig plus the
backend-resolved bundleUrl and sensors, read from templateConfig
first and then from the campaign object itself.
A payload missing templateConfig, skinId, skinVersion or bundleUrl
is dropped with a log (fromJson returns null). Everything else degrades:
an unknown format or entry parses to unknown, unknown sensors are
dropped. Never throws. Port of Android's GamificationConfig.
Constructors
-
GamificationConfig({required GamificationFormat format, required String skinId, required int skinVersion, required int? bridgeVersion, required Map<
String, dynamic> values, required List<GamificationSlot> slots, required GamificationEntryKind entry, required String? slotKey, required bool showMute, required bool showClose, required bool dismissAfterPlayed, required String bundleUrl, required List<SkinSensor> sensors, String? minSdkVersion, String? themeFontFamily, List<GameThemeFont> themeFonts = const []}) -
const
Properties
- bridgeSupported → bool
-
Whether this SDK speaks the skin's bridge: absent means a skin of this
SDK's era.
no setter
- bridgeVersion → int?
-
The skin's declared bridge version; null when the backend sends none.
final
- bundleUrl → String
-
final
- dismissAfterPlayed → bool
-
Whether a played floating entry comes down after its game closes. True
(absent) keeps the long-standing floating behaviour; false keeps the
floater so a tap reopens the skin showing the reward already won.
Inline entries never read it. Port of Android/iOS
dismissAfterPlayed(floating-only).final - entry → GamificationEntryKind
-
final
- format → GamificationFormat
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- minSdkVersion → String?
-
The skin's floor for Flutter (
minSdkVersion.flutter), e.g."2.4.0". Null when the backend sends none: no floor is enforced.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sensors
→ List<
SkinSensor> -
The manifest sensors this build supports; unknown names are dropped.
final
- showClose → bool
-
Whether the native X shows once the skin is ready; hiding it is opt-in.
final
- showMute → bool
-
final
- skinId → String
-
final
- skinVersion → int
-
final
- slotKey → String?
-
The inline slot an
inlineTeaserentry renders in.final -
slots
→ List<
GamificationSlot> -
config.slots: empty for formats that map nothing.final -
The canvas that stands in for a non-direct entry; its tap opens the game.
final
- themeFontFamily → String?
-
final
-
themeFonts
→ List<
GameThemeFont> -
final
-
values
→ Map<
String, dynamic> -
config.values: the marketer's field values, verbatim forinit.final
Methods
-
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> campaignJson, String campaignKey) → GamificationConfig? -
isNewer(
String candidate, String base) → bool? -
Whether
candidateis a newer dotted-numeric version thanbase. Null when either is unreadable: an unreadable requirement never skips a campaign. Port of iOSGamificationConfig.isNewer(_:than:).