convertLocationNotificationToJson static method

String convertLocationNotificationToJson(
  1. EventMemberLocation eventMemberLocation
)

Implementation

static String convertLocationNotificationToJson(
    EventMemberLocation eventMemberLocation) {
  var notification = json.encode({
    'fromAtSign': eventMemberLocation.fromAtSign,
    'receiver': eventMemberLocation.receiver,
    'lat': eventMemberLocation.lat.toString(),
    'long': eventMemberLocation.long.toString(),
    'startSharingFrom': eventMemberLocation.startSharingFrom != null
        ? eventMemberLocation.startSharingFrom!.toUtc().toString()
        : null,
    'shareUntil': eventMemberLocation.shareUntil != null
        ? eventMemberLocation.shareUntil!.toUtc().toString()
        : null,
    'key': eventMemberLocation.key.toString(),
  });

  return notification;
}