Session class

User session

Constructors

Session({required String id, required String userId, required DateTime createdAt, required DateTime expiresAt, Map<String, dynamic> data = const {}})
Session.create(String userId, Duration duration)
Create a new session
factory
Session.fromJson(Map<String, dynamic> json)
Create from JSON
factory

Properties

createdAt DateTime
final
data Map<String, dynamic>
final
duration Duration
Get session duration
no setter
expiresAt DateTime
final
hashCode int
The hash code for this object.
no setterinherited
id String
final
isExpired bool
Check if session is expired
no setter
remainingTime Duration
Get remaining time
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userId String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert to JSON
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited