jsonBody static method

String jsonBody({
  1. required String message,
  2. required Map<String, String> attributes,
})

Implementation

static String jsonBody({
  /// message content.
  required String message,

  /// message attributes
  required Map<String, String> attributes,
}) {
  if (attributes.isEmpty) {
    return message;
  }

  /// {'msg':'xxx', 'attrs':''}
  return jsonEncode({
    messageKey: message,
    attributesKey: attributes,
  });
}