toMap method

  1. @override
Map<String, dynamic> toMap()

Converts the current instance of NotificationLocalization to a Map instance.

This method returns a Map instance that contains the converted data. If a field has a null value, it will not be added to the map. Finally, it returns the created map.

Implementation

@override
Map<String, dynamic> toMap() => {
      if (title?.isNotEmpty ?? false) NOTIFICATION_TITLE: title,
      if (body?.isNotEmpty ?? false) NOTIFICATION_BODY: body,
      if (summary?.isNotEmpty ?? false) NOTIFICATION_SUMMARY: summary,
      if (bigPicture?.isNotEmpty ?? false)
        NOTIFICATION_BIG_PICTURE: bigPicture,
      if (largeIcon?.isNotEmpty ?? false) NOTIFICATION_LARGE_ICON: largeIcon,
      if (buttonLabels?.isNotEmpty ?? false)
        NOTIFICATION_BUTTON_LABELS: buttonLabels,
    };