school_bean.dart 758 B

123456789101112131415161718192021222324252627282930313233
  1. /// school_id : 22
  2. /// school_name : "Temasek Polytechnic"
  3. class SchoolBean {
  4. SchoolBean({
  5. int? schoolId,
  6. String? schoolName,}){
  7. _schoolId = schoolId;
  8. _schoolName = schoolName;
  9. }
  10. SchoolBean.fromJson(dynamic json) {
  11. _schoolId = json['school_id'];
  12. _schoolName = json['school_name'];
  13. }
  14. int? _schoolId;
  15. String? _schoolName;
  16. SchoolBean copyWith({ int? schoolId,
  17. String? schoolName,
  18. }) => SchoolBean( schoolId: schoolId ?? _schoolId,
  19. schoolName: schoolName ?? _schoolName,
  20. );
  21. int? get schoolId => _schoolId;
  22. String? get schoolName => _schoolName;
  23. Map<String, dynamic> toJson() {
  24. final map = <String, dynamic>{};
  25. map['school_id'] = _schoolId;
  26. map['school_name'] = _schoolName;
  27. return map;
  28. }
  29. }