PersonalSession.fromJson constructor
PersonalSession.fromJson(
- Map<String, dynamic> json
)
Implementation
factory PersonalSession.fromJson(Map<String, dynamic> json) => PersonalSession(
id: json['id'] as String,
clientType: json['client_type'] as String,
clientName: json['client_name'] as String?,
operatingSystem: json['operating_system'] as String?,
deviceClass: json['device_class'] as String?,
friendlyName: json['friendly_name'] as String?,
city: json['city'] as String?,
region: json['region'] as String?,
countryCode: json['country_code'] as String?,
createdAt: DateTime.parse(json['created_at'] as String),
lastAuthenticatedAt: DateTime.parse(json['last_authenticated_at'] as String),
lastSeenAt: DateTime.parse(json['last_seen_at'] as String),
expiresAt: DateTime.parse(json['expires_at'] as String),
revokedAt: json['revoked_at'] == null ? null : DateTime.parse(json['revoked_at'] as String),
oauthTokenCount: json['oauth_token_count'] as int,
iapSessionCount: json['iap_session_count'] as int,
current: json['current'] as bool? ?? false,
);