import 'package:json_annotation/json_annotation.dart'; part 'request.g.dart'; @JsonSerializable(explicitToJson: true) class Request { String url; Object? extra; Request({ required this.url, this.extra, }); factory Request.fromJson(Map json) => _$RequestFromJson(json); Map toJson() => _$RequestToJson(this); } @JsonSerializable() class ReqExtraHttp { String method = 'GET'; Map header = {}; String body = ''; ReqExtraHttp(); factory ReqExtraHttp.fromJson(Map json) => _$ReqExtraHttpFromJson(json); Map toJson() => _$ReqExtraHttpToJson(this); } @JsonSerializable() class ReqExtraBt { List trackers = []; ReqExtraBt(); factory ReqExtraBt.fromJson(Map json) => _$ReqExtraBtFromJson(json); Map toJson() => _$ReqExtraBtToJson(this); }