import '../commun/Image.dart'; import '../commun/Role.dart'; class CurrentUser { CurrentUser({ this.active, this.birthDate, this.city, this.email, this.gender, this.id, this.image, this.name, this.phonenumber, this.role, this.secondNumber, this.timestmp, this.username, this.messageCount, }); CurrentUser.fromJson(dynamic json) { active = json['active']; birthDate = json['birthDate']; city = json['city']; email = json['email']; gender = json['gender']; id = json['id']; image = json['image'] != null ? Image.fromJson(json['image']) : null; name = json['name']; phonenumber = json['phonenumber']; role = json['role'] != null ? Role.fromJson(json['role']) : null; secondNumber = json['secondNumber']; timestmp = json['timestmp']; username = json['username']; messageCount = json['unreadMessages']; } bool? active; int? birthDate; String? city; String? email; String? gender; int? id; Image? image; String? name; String? phonenumber; Role? role; String? secondNumber; int? timestmp; String? username; int? messageCount; Map toJson() { final map = {}; map['active'] = active; map['birthDate'] = birthDate; map['city'] = city; map['email'] = email; map['gender'] = gender; map['id'] = id; if (image != null) { map['image'] = image?.toJson(); } map['name'] = name; map['phonenumber'] = phonenumber; if (role != null) { map['role'] = role?.toJson(); } map['secondNumber'] = secondNumber; map['timestmp'] = timestmp; map['username'] = username; map['unreadMessages'] = messageCount; return map; } }