AppwinInAppContent.fromMap constructor

AppwinInAppContent.fromMap(
  1. Map map
)

Decodes what the native side sends over the method channel.

Implementation

factory AppwinInAppContent.fromMap(Map<dynamic, dynamic> map) {
  final rawButtons = map['buttons'] as List<dynamic>?;
  return AppwinInAppContent(
    title: map['title'] as String?,
    body: map['body'] as String?,
    imageUrl: map['imageUrl'] as String?,
    deeplink: map['deeplink'] as String?,
    buttons: rawButtons
        ?.whereType<Map<dynamic, dynamic>>()
        .map(AppwinInAppButton.fromMap)
        .toList(),
  );
}