InlineCanvasConfig class

A free-form inline campaign: an authored Canvas rendered inside a slot.

The canvas block is byte-identical to the one a canvas nudge carries, so it is parsed by the shared CampaignCanvasParser with no inline-specific branch. What is inline-specific is everything around it: which slot it lands in, and the card chrome the host draws.

Constructors

InlineCanvasConfig({required String slotKey, required double designWidth, required double cornerRadius, required InlineCanvasMargin margin, required CampaignCanvas canvas})
const

Properties

canvas CampaignCanvas
final
cornerRadius double
final
designWidth double
The logical width the canvas was authored against. Runtime scale is (slotWidth - margin.horizontal) / designWidth, so this is the only number relating authored coordinates to real ones.
final
hashCode int
The hash code for this object.
no setterinherited
margin InlineCanvasMargin
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slotKey String
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> json, {CampaignCanvasParser parser = const CampaignCanvasParser()}) InlineCanvasConfig?
Returns null when the payload is not a usable inline canvas, so the campaign factory can fall through rather than render a broken card.