toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'id'] = this.id;
  if (this.ipAddress != null) {
    json[r'ipAddress'] = this.ipAddress;
  } else {
    json[r'ipAddress'] = null;
  }
  if (this.userAgent != null) {
    json[r'userAgent'] = this.userAgent;
  } else {
    json[r'userAgent'] = null;
  }
  if (this.deviceType != null) {
    json[r'deviceType'] = this.deviceType;
  } else {
    json[r'deviceType'] = null;
  }
  if (this.browser != null) {
    json[r'browser'] = this.browser;
  } else {
    json[r'browser'] = null;
  }
  if (this.os != null) {
    json[r'os'] = this.os;
  } else {
    json[r'os'] = null;
  }
  if (this.country != null) {
    json[r'country'] = this.country;
  } else {
    json[r'country'] = null;
  }
  if (this.city != null) {
    json[r'city'] = this.city;
  } else {
    json[r'city'] = null;
  }
  if (this.createdAt != null) {
    json[r'createdAt'] = this.createdAt!.toUtc().toIso8601String();
  } else {
    json[r'createdAt'] = null;
  }
  if (this.lastActiveAt != null) {
    json[r'lastActiveAt'] = this.lastActiveAt!.toUtc().toIso8601String();
  } else {
    json[r'lastActiveAt'] = null;
  }
  if (this.isCurrent != null) {
    json[r'isCurrent'] = this.isCurrent;
  } else {
    json[r'isCurrent'] = null;
  }
  return json;
}