/// id : "1455102859841372160" /// createTime : "2021-11-01 17:22:11" /// createUser : "1" /// updateTime : "2021-11-01 17:22:11" /// updateUser : "1" /// categoryId : "1452472226421932032" /// subject : "εδΌζ ζ" /// tags : ["11"] /// coverImg : "https://pos.upload.gznl.top/0000/2021/11/d8305d15-1a39-4b08-a172-eba7f18b9968.jpg" /// author : {"name":"1","avatar":"1"} /// introduce : "1" /// viewers : 0 /// likes : 0 /// state : true /// isDelete : 0 class CourseDetails { CourseDetails({ String id, String createTime, String createUser, String updateTime, String updateUser, String categoryId, String subject, List<String> tags, String coverImg, Author author, String introduce, int viewers, int likes, bool selfLiked, 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; _selfLiked = selfLiked; _state = state; _isDelete = isDelete; } CourseDetails.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<String>() : []; _coverImg = json['coverImg']; _author = json['author'] != null ? Author.fromJson(json['author']) : null; _introduce = json['introduce']; _viewers = json['viewers']; _likes = json['likes']; _selfLiked = json['selfLiked']; _state = json['state']; _isDelete = json['isDelete']; } String _id; String _createTime; String _createUser; String _updateTime; String _updateUser; String _categoryId; String _subject; List<String> _tags; String _coverImg; Author _author; String _introduce; int _viewers; int _likes; bool _selfLiked; 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<String> 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 selfLiked => _selfLiked; bool get state => _state; int get isDelete => _isDelete; set id(String value) { _id = value; } Map<String, dynamic> toJson() { final map = <String, dynamic>{}; 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['selfLiked'] = _selfLiked; 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<String> 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 selfLiked(bool value) { _selfLiked = value; } set state(bool value) { _state = value; } set isDelete(int value) { _isDelete = value; } } /// name : "1" /// avatar : "1" 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; Map<String, dynamic> toJson() { final map = <String, dynamic>{}; map['name'] = _name; map['avatar'] = _avatar; return map; } }