toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final aPNSPushType = this.aPNSPushType;
  final action = this.action;
  final badge = this.badge;
  final body = this.body;
  final category = this.category;
  final collapseId = this.collapseId;
  final data = this.data;
  final mediaUrl = this.mediaUrl;
  final preferredAuthenticationMethod = this.preferredAuthenticationMethod;
  final priority = this.priority;
  final rawContent = this.rawContent;
  final silentPush = this.silentPush;
  final sound = this.sound;
  final substitutions = this.substitutions;
  final threadId = this.threadId;
  final timeToLive = this.timeToLive;
  final title = this.title;
  final url = this.url;
  return {
    if (aPNSPushType != null) 'APNSPushType': aPNSPushType,
    if (action != null) 'Action': action.toValue(),
    if (badge != null) 'Badge': badge,
    if (body != null) 'Body': body,
    if (category != null) 'Category': category,
    if (collapseId != null) 'CollapseId': collapseId,
    if (data != null) 'Data': data,
    if (mediaUrl != null) 'MediaUrl': mediaUrl,
    if (preferredAuthenticationMethod != null)
      'PreferredAuthenticationMethod': preferredAuthenticationMethod,
    if (priority != null) 'Priority': priority,
    if (rawContent != null) 'RawContent': rawContent,
    if (silentPush != null) 'SilentPush': silentPush,
    if (sound != null) 'Sound': sound,
    if (substitutions != null) 'Substitutions': substitutions,
    if (threadId != null) 'ThreadId': threadId,
    if (timeToLive != null) 'TimeToLive': timeToLive,
    if (title != null) 'Title': title,
    if (url != null) 'Url': url,
  };
}