toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'title': title,
'body': body,
'icon': icon,
'color': color,
'sound': sound,
'tag': tag,
'click_action': clickAction,
'body_loc_key': bodyLocKey,
'body_loc_args': bodyLocArgs,
'title_loc_key': titleLocKey,
'title_loc_args': titleLocArgs,
'channel_id': channelId,
'ticker': ticker,
'sticky': sticky,
'event_time': eventTime?.toIso8601String(),
'local_only': localOnly,
'default_sound': defaultSound,
'default_vibrate_timings': defaultVibrateTimings,
'default_light_settings': defaultLightSettings,
'vibrate_timings': vibrateTimings,
'visibility': visibility,
'notification_priority': notificationPriority,
// 'timeout_after': timeoutAfter,
'image': image,
'light_settings': lightSettings?.toJson(),
}..removeWhere((k, v) => v == null);
}