NudgeParser class

Decodes a nudge templateConfig ({ container, layout }) into the pure NudgeConfig model.

This is the single place that knows the wire format. The model (nudge_content.dart) and the renderer (nudge_view.dart) stay decoupled from JSON, so the wire shape can evolve here without rippling outward (SRP).

Node decoding is dispatched through a registry (_nodeParsers) keyed by the native widget type. Supporting a new nudge widget is an open/closed change: add one entry to the map; nothing else in the parser is touched.

Constructors

NudgeParser()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(Map<String, dynamic> templateConfig) NudgeConfig?
Returns null when the content tree is missing — such a campaign has nothing to show, so it is dropped rather than presented empty.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited