AppwinInAppMessage.fromMap constructor

AppwinInAppMessage.fromMap(
  1. Map map
)

Decodes what the native side sends over the method channel.

Implementation

factory AppwinInAppMessage.fromMap(Map<dynamic, dynamic> map) {
  final content = map['content'] as Map<dynamic, dynamic>? ?? {};
  return AppwinInAppMessage(
    id: map['id'] as String,
    campaignId: map['campaignId'] as String,
    deliveryId: map['deliveryId'] as String,
    channel: map['channel'] as String? ?? 'in_app',
    format: map['format'] as String? ?? 'modal',
    content: AppwinInAppContent.fromMap(content),
  );
}