import 'package:json_annotation/json_annotation.dart'; import 'request.dart'; part 'resource.g.dart'; @JsonSerializable(explicitToJson: true) class Resource { Request req; String name; int size; bool range; List files; Map? extra; Resource({ required this.req, required this.name, required this.size, required this.range, required this.files, this.extra, }); factory Resource.fromJson(Map json) => _$ResourceFromJson(json); Map toJson() => _$ResourceToJson(this); } @JsonSerializable() class FileInfo { String name; String path; int size; FileInfo({ required this.name, required this.path, required this.size, }); factory FileInfo.fromJson(Map json) => _$FileInfoFromJson(json); Map toJson() => _$FileInfoToJson(this); }