MessageNotification.parseNotification constructor

MessageNotification.parseNotification(
  1. dynamic notification
)

Implementation

MessageNotification.parseNotification(/*RemoteNotification?*/ notification) {
  title = TypeSafeConversion.nullSafeString(notification?.title);
  body = TypeSafeConversion.nullSafeString(notification?.body);
  payload = TypeSafeConversion.nullSafeString(notification?.titleLocKey);
  String img='';
  if(GetPlatform.isAndroid) {
    img = TypeSafeConversion.nullSafeString( notification?.android?.imageUrl );
  }
  if(GetPlatform.isIOS) {
    img = TypeSafeConversion.nullSafeString( notification?.apple?.imageUrl );
  }
  if( img.isNotEmpty ){
    image = img.startsWith('http')
        ? img
        : '${ApiConstantDev.urlWebServer}/storage/app/public/notification/$img';
  }
}