toJson method

Map<String, dynamic> toJson(
  1. Platform platform
)

Implementation

Map<String, dynamic> toJson(Platform platform) {
  final Map<String, dynamic> json = {
    'notificationContentTitle': notificationContentTitle,
    'notificationContentText': notificationContentText,
    'iconData': notificationIcon?.toJson(),
    'buttons': notificationButtons?.map((e) => e.toJson()).toList(),
  };

  if (foregroundTaskOptions != null) {
    json.addAll(foregroundTaskOptions!.toJson());
  }

  if (callback != null) {
    json['callbackHandle'] =
        PluginUtilities.getCallbackHandle(callback!)?.toRawHandle();
  }

  return json;
}