ProfileModel.fromMap constructor
ProfileModel.fromMap(
- Map<String, dynamic> json
)
Implementation
factory ProfileModel.fromMap(Map<String, dynamic> json) => ProfileModel(
id: json["id"],
firstName: json["first_name"],
lastName: json["last_name"],
middleName: json["middle_name"],
phone: json["phone"],
equipmentId: json["equipment_id"],
selfEmploymentStatusSet: json["self_employment_status_set"],
commissionerIsSet: json["commissioner_is_set"],
profilePhoto: json["profile_photo"],
balance: json["balance"],
unseenNotificationCount: json["unseen_notification_count"],
averageRating: json["average_rating"],
orderCount: json["order_count"],
medalLevel: json["medal_level"],
activity: json["activity"],
passedTest: json["passed_test"],
isWorking: json["is_working"],
isBlocked: json["is_blocked"],
myId: json["registered_through_my_id"],
drivingLicenseUploaded: json["driving_license_uploaded"],
drivingLicenseApproved: json["driving_license_approved"],
visitedOffice: json["visited_office"],
email: json["email"],
lockerSyncValue: json["locker_sync_value"],
seenHints: json["seen_hints"] == null
? []
: List<int>.from(json["seen_hints"]!.map((x) => x)),
stats: json["stats"] == null
? null
: StatisticModel.fromMap(json["stats"]),
blockedTill: json["blocked_till"] == null
? null
: DateTime.parse(json["blocked_till"]).toLocal(),
);