/// id : "1452470112895369216" /// createTime : "2021-10-25 11:00:35" /// createUser : "1" /// updateTime : "2021-10-25 11:00:35" /// updateUser : "1" /// categoryId : "1452453250065235968" /// subject : "11" /// tags : ["11"] /// coverImg : "https://pos.upload.gznl.top/0000/2021/10/61dda29b-19cf-4d47-b6c7-c07f895beeaa.jpg" /// author : {"name":"11","avatar":"11"} /// introduce : "11" /// viewers : 0 /// likes : 0 /// state : true /// isDelete : 0 class CourseList { CourseList({ String id, String createTime, String createUser, String updateTime, String updateUser, String categoryId, String subject, List tags, String coverImg, Author author, String introduce, int viewers, int likes, bool state, int isDelete,}){ _id = id; _createTime = createTime; _createUser = createUser; _updateTime = updateTime; _updateUser = updateUser; _categoryId = categoryId; _subject = subject; _tags = tags; _coverImg = coverImg; _author = author; _introduce = introduce; _viewers = viewers; _likes = likes; _state = state; _isDelete = isDelete; } CourseList.fromJson(dynamic json) { _id = json['id']; _createTime = json['createTime']; _createUser = json['createUser']; _updateTime = json['updateTime']; _updateUser = json['updateUser']; _categoryId = json['categoryId']; _subject = json['subject']; _tags = json['tags'] != null ? json['tags'].cast() : []; _coverImg = json['coverImg']; _author = json['author'] != null ? Author.fromJson(json['author']) : null; _introduce = json['introduce']; _viewers = json['viewers']; _likes = json['likes']; _state = json['state']; _isDelete = json['isDelete']; } String _id; String _createTime; String _createUser; String _updateTime; String _updateUser; String _categoryId; String _subject; List _tags; String _coverImg; Author _author; String _introduce; int _viewers; int _likes; bool _state; int _isDelete; String get id => _id; String get createTime => _createTime; String get createUser => _createUser; String get updateTime => _updateTime; String get updateUser => _updateUser; String get categoryId => _categoryId; String get subject => _subject; List get tags => _tags; String get coverImg => _coverImg; Author get author => _author; String get introduce => _introduce; int get viewers => _viewers; int get likes => _likes; bool get state => _state; int get isDelete => _isDelete; set id(String value) { _id = value; } Map toJson() { final map = {}; map['id'] = _id; map['createTime'] = _createTime; map['createUser'] = _createUser; map['updateTime'] = _updateTime; map['updateUser'] = _updateUser; map['categoryId'] = _categoryId; map['subject'] = _subject; map['tags'] = _tags; map['coverImg'] = _coverImg; if (_author != null) { map['author'] = _author.toJson(); } map['introduce'] = _introduce; map['viewers'] = _viewers; map['likes'] = _likes; map['state'] = _state; map['isDelete'] = _isDelete; return map; } set createTime(String value) { _createTime = value; } set createUser(String value) { _createUser = value; } set updateTime(String value) { _updateTime = value; } set updateUser(String value) { _updateUser = value; } set categoryId(String value) { _categoryId = value; } set subject(String value) { _subject = value; } set tags(List value) { _tags = value; } set coverImg(String value) { _coverImg = value; } set author(Author value) { _author = value; } set introduce(String value) { _introduce = value; } set viewers(int value) { _viewers = value; } set likes(int value) { _likes = value; } set state(bool value) { _state = value; } set isDelete(int value) { _isDelete = value; } } /// name : "11" /// avatar : "11" class Author { Author({ String name, String avatar,}){ _name = name; _avatar = avatar; } Author.fromJson(dynamic json) { _name = json['name']; _avatar = json['avatar']; } String _name; String _avatar; String get name => _name; String get avatar => _avatar; set name(String value) { _name = value; } Map toJson() { final map = {}; map['name'] = _name; map['avatar'] = _avatar; return map; } set avatar(String value) { _avatar = value; } }