toJson method
Map<String, dynamic>
toJson(
- Platform platform
)
Implementation
Map<String, dynamic> toJson(Platform platform) {
final Map<String, dynamic> json = {
'notificationContentTitle': notificationContentTitle,
'notificationContentText': notificationContentText,
'icon': notificationIcon?.toJson(),
'buttons': notificationButtons?.map((e) => e.toJson()).toList(),
'initialRoute': notificationInitialRoute,
};
if (foregroundTaskOptions != null) {
json.addAll(foregroundTaskOptions!.toJson());
}
if (callback != null) {
json['callbackHandle'] =
PluginUtilities.getCallbackHandle(callback!)?.toRawHandle();
}
return json;
}