toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final displayName = this.displayName;
  final lastSeenIp = this.lastSeenIp;
  final lastSeenTs = this.lastSeenTs;
  return {
    'device_id': deviceId,
    if (displayName != null) 'display_name': displayName,
    if (lastSeenIp != null) 'last_seen_ip': lastSeenIp,
    if (lastSeenTs != null) 'last_seen_ts': lastSeenTs,
  };
}