toJson method

  1. @override
Map<String, dynamic> toJson()
override

Serializes the session into its standard JSON representation.

Includes the model UUID, email, token, and timestamp metadata.

Returns a map suitable for storage or transport.

Example:

final json = session.toJson();
print(json['email']);
print(json['token']);

Implementation

@override
Map<String, dynamic> toJson() {
  return {"uuid": uuid, "email": email, 'token': token, "created_at": createdAt?.toIso8601String(), "updated_at": updatedAt?.toIso8601String()};
}