import 'package:job_app/models/user/role.dart'; import '../image.dart'; class UserModel { int id; String userName; String email; String name; String firstName; String lastName; String phonenumber; String jobtitle; String country; String city; ImageModel image; bool active; dynamic offerdate; dynamic theJobuseroffer; String roles; int timestmp; UserModel({ this.id, this.userName, this.email, this.name, this.firstName, this.lastName, this.phonenumber, this.jobtitle, this.country, this.city, this.image, this.active, this.offerdate, this.theJobuseroffer, this.roles, this.timestmp, }); Map toJson() => { "id": id, "userName": userName, "email": email, "name": name, "firstName": firstName, "lastName": lastName, "phonenumber": phonenumber, "jobtitle": jobtitle, "country": country, "city": city, "image": image, "active": active, "offerdate": offerdate, "theJobuseroffer": theJobuseroffer, "roles": roles, "timestmp": timestmp, }; factory UserModel.fromJson(Map json) => UserModel( id: json["id"], userName: json["userName"], email: json["email"], name: json["name"], firstName: json["firstname"], lastName: json["lastname"], phonenumber: json["phonenumber"], jobtitle: json["jobtitle"], country: json["country"], city: json["city"], image: json["image"] == null ? null : ImageModel.fromJson(json["image"]), active: json["active"], offerdate: json["offerdate"], theJobuseroffer: json["theJobuseroffer"], roles: json["roles"], timestmp: json["timestmp"], ); }