parse method

NudgeConfig? parse(
  1. Map<String, dynamic> templateConfig
)

Returns null when the content tree is missing — such a campaign has nothing to show, so it is dropped rather than presented empty.

Implementation

NudgeConfig? parse(Map<String, dynamic> templateConfig) {
  final layout = optMap(templateConfig, 'layout');
  if (layout == null || layout.isEmpty) return null;

  return NudgeConfig(
    surface: _surface(optMap(templateConfig, 'container')),
    content: _column(layout),
  );
}