PowerSyncCredentials.fromJson constructor

PowerSyncCredentials.fromJson(
  1. Map<String, dynamic> parsed
)

Implementation

factory PowerSyncCredentials.fromJson(Map<String, dynamic> parsed) {
  String token = parsed['token'];
  DateTime? expiresAt = getExpiryDate(token);

  return PowerSyncCredentials(
      endpoint: parsed['endpoint'],
      token: parsed['token'],
      userId: parsed['user_id'],
      expiresAt: expiresAt);
}