feat: create task with advanced options (#157)

This commit is contained in:
Levi authored and GitHub committed 2023-07-19 22:52:51 +08:00
1 parent eb79dd5ac5
commit 7376e85895
22 files changed
+357 -136

No files matched your search

+15 -2
View File
@@ -5,10 +5,11 @@ part 'request.g.dart';
@JsonSerializable(explicitToJson: true)
class Request {
String url;
Map<String, dynamic>? extra;
Object? extra;
Request({
required this.url,
this.extra,
});
factory Request.fromJson(Map<String, dynamic> json) =>
@@ -20,7 +21,7 @@ class Request {
@JsonSerializable()
class ReqExtraHttp {
String method = 'GET';
Map<String, String> headers = {};
Map<String, String> header = {};
String body = '';
ReqExtraHttp();
@@ -30,3 +31,15 @@ class ReqExtraHttp {
Map<String, dynamic> toJson() => _$ReqExtraHttpToJson(this);
}
@JsonSerializable()
class ReqExtraBt {
List<String> trackers = [];
ReqExtraBt();
factory ReqExtraBt.fromJson(Map<String, dynamic> json) =>
_$ReqExtraBtFromJson(json);
Map<String, dynamic> toJson() => _$ReqExtraBtToJson(this);
}