WpUser.fromJson constructor

WpUser.fromJson(
  1. Map<String, dynamic> json
)

Creates a WpUser from a JSON object

Implementation

WpUser.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  token = json['token'];
  expiresAt = json['expires_at'] is num
      ? (json['expires_at'] as num).toInt()
      : int.tryParse(json['expires_at']?.toString() ?? '');
  email = json['email'];
  username = json['username'];
  firstName = json['first_name'];
  lastName = json['last_name'];
  avatar = json['avatar'];
  createdAt = json['created_at'];
}