import 'package:json_annotation/json_annotation.dart'; part 'chapter.g.dart'; @JsonSerializable(explicitToJson: true) class Chapter { String? id = ''; String? createTime = ''; String? createUser = ''; String? updateTime = ''; String? updateUser = ''; String? courseId = ''; String? name = ''; Content? content; int? sort = 0; int? isDelete = 0; Chapter(); factory Chapter.fromJson(Map json) => _$ChapterFromJson(json); Map toJson() => _$ChapterToJson(this); } @JsonSerializable(explicitToJson: true) class Content { String? coverImg = ''; String? remark = ''; String? fileUrl = ''; Content(); factory Content.fromJson(Map json) => _$ContentFromJson(json); Map toJson() => _$ContentToJson(this); }