fromDynamic static method

NotificationData? fromDynamic(
  1. dynamic data
)

Implementation

static NotificationData? fromDynamic(dynamic data) {
  try {
    List<NotificationButtonData>? notificationButtons;
    try {
      notificationButtons = NotificationButtonData.fromList(data['buttons']);
    } catch (e) {
      notificationButtons = null;
    }
    NotificationButtonData? clickedButton;
    try {
      clickedButton = NotificationButtonData.fromMap(data['clickedButton']);
    } catch (e) {
      clickedButton = null;
    }
    return NotificationData.create(
        data['title'],
        data['content'],
        data['bigTitle'],
        data['bigContent'],
        data['summary'],
        data['imageUrl'],
        data['iconUrl'],
        data['json'],
        notificationButtons,
        clickedButton);
  } catch (e) {
    return null;
  }
}