toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = Map<String, dynamic>();
  data['id'] = this.id;
  data['first_name'] = this.firstName;
  data['last_name'] = this.lastName;
  data['username'] = this.username;
  data['user_nicename'] = this.userNicename;
  data['display_name'] = this.displayName;
  data['user_status'] = this.userStatus;
  data['email'] = this.email;
  data['roles'] = (this.roles ?? []).map((e) => e).toList();
  data['avatar'] = this.avatar;
  if (this.metaData != null) {
    data['meta_data'] = this.metaData!.map((e) => e.toJson()).toList();
  }
  data['created_at'] = this.createdAt;
  return data;
}