SessionRow.fromJson constructor

SessionRow.fromJson(
  1. Map<String, dynamic> json, {
  2. ValueSerializer? serializer,
})

Implementation

factory SessionRow.fromJson(Map<String, dynamic> json,
    {ValueSerializer? serializer}) {
  serializer ??= driftRuntimeOptions.defaultSerializer;
  return SessionRow(
    id: serializer.fromJson<String>(json['id']),
    ip: serializer.fromJson<String>(json['ip']),
    userAgent: serializer.fromJson<String>(json['userAgent']),
    lastActivatedAt:
        serializer.fromJson<PreciseDateTime>(json['lastActivatedAt']),
  );
}