toJson method Null safety

String toJson()

Implementation

String toJson() {
  return "{"
      "\"sourceIp\":\"$sourceIp\","
      "\"userAgent\":\"$userAgent\","
      "\"geolocation\":\"$geolocation\","
      "\"referer\":\"$referer\"}";
}