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