MessageNotificationModel.parseNotification constructor

MessageNotificationModel.parseNotification(
  1. dynamic notification
)

Implementation

MessageNotificationModel.parseNotification(dynamic notification) {
  title = TypeSafeConversion.nullSafeString(notification?.title);
  body = TypeSafeConversion.nullSafeString(notification?.body);
  String img = '';
  if (checkPlatform.isAndroid) {
    img = TypeSafeConversion.nullSafeString(notification?.android?.imageUrl);
  }
  if (checkPlatform.isIOS) {
    img = TypeSafeConversion.nullSafeString(notification?.apple?.imageUrl);
  }
  if (img.isNotEmpty) {
    imagePath = img.startsWith('http')
        ? img
        : '${ApiConstantDev.urlServerImageNotification}/$img';
  }
}