toJson method
Implementation
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['user_id'] = _id;
map['username'] = _userId;
map['name'] = _name;
map['userType'] = _userType?.convertStr;
map['gender'] = _gender;
map['createdAt'] = _createdAt;
map['updatedAt'] = _updatedAt;
map['mealStatus'] = _mealStatus;
map['role'] = _teacherRole;
map['class'] = _classNum;
map['grade'] = _gradeNum;
map['number'] = _studentNum;
map['serial'] = _studentId.toString();
if (_photos != null) {
map['photos'] = _photos?.toList();
}
if (_permissions != null) {
map['permissions'] = _permissions?.map((v) => v.convertStr).toList();
}
map['birthdate'] = _birthdate;
map['libraryId'] = _libraryId;
map['entered'] = _isExceptionEnter;
map['convenienceBlack'] = _isConvenienceBlack;
map['exceptionBlack'] = _isExceptionBlack;
return map;
}