This commit is contained in:
factory-droid[bot]
2025-10-02 18:28:52 +00:00
parent 90113d80b0
commit ca409fabdd
7 changed files with 107 additions and 44 deletions

View File

@@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'player_response.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PlayerResponse _$PlayerResponseFromJson(Map<String, dynamic> json) =>
PlayerResponse(
embedUrl: json['embedUrl'] as String?,
playerType: json['playerType'] as String?,
error: json['error'] as String?,
);
Map<String, dynamic> _$PlayerResponseToJson(PlayerResponse instance) =>
<String, dynamic>{
'embedUrl': instance.embedUrl,
'playerType': instance.playerType,
'error': instance.error,
};

View File

@@ -27,12 +27,8 @@ mixin _$Torrent {
int? get seeders => throw _privateConstructorUsedError;
int? get size => throw _privateConstructorUsedError;
/// Serializes this Torrent to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of Torrent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
$TorrentCopyWith<Torrent> get copyWith => throw _privateConstructorUsedError;
}
@@ -60,8 +56,6 @@ class _$TorrentCopyWithImpl<$Res, $Val extends Torrent>
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Torrent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -125,8 +119,6 @@ class __$$TorrentImplCopyWithImpl<$Res>
_$TorrentImpl _value, $Res Function(_$TorrentImpl) _then)
: super(_value, _then);
/// Create a copy of Torrent
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
@@ -211,14 +203,12 @@ class _$TorrentImpl implements _Torrent {
(identical(other.size, size) || other.size == size));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, magnet, title, name, quality, seeders, size);
/// Create a copy of Torrent
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$TorrentImplCopyWith<_$TorrentImpl> get copyWith =>
@@ -255,11 +245,8 @@ abstract class _Torrent implements Torrent {
int? get seeders;
@override
int? get size;
/// Create a copy of Torrent
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@JsonKey(ignore: true)
_$$TorrentImplCopyWith<_$TorrentImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -0,0 +1,29 @@
import 'package:json_annotation/json_annotation.dart';
part 'torrent_item.g.dart';
@JsonSerializable()
class TorrentItem {
final String? title;
final String? magnetUrl;
final String? quality;
final int? seeders;
final int? leechers;
final String? size;
final String? source;
TorrentItem({
this.title,
this.magnetUrl,
this.quality,
this.seeders,
this.leechers,
this.size,
this.source,
});
factory TorrentItem.fromJson(Map<String, dynamic> json) =>
_$TorrentItemFromJson(json);
Map<String, dynamic> toJson() => _$TorrentItemToJson(this);
}

View File

@@ -0,0 +1,28 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'torrent_item.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TorrentItem _$TorrentItemFromJson(Map<String, dynamic> json) => TorrentItem(
title: json['title'] as String?,
magnetUrl: json['magnetUrl'] as String?,
quality: json['quality'] as String?,
seeders: (json['seeders'] as num?)?.toInt(),
leechers: (json['leechers'] as num?)?.toInt(),
size: json['size'] as String?,
source: json['source'] as String?,
);
Map<String, dynamic> _$TorrentItemToJson(TorrentItem instance) =>
<String, dynamic>{
'title': instance.title,
'magnetUrl': instance.magnetUrl,
'quality': instance.quality,
'seeders': instance.seeders,
'leechers': instance.leechers,
'size': instance.size,
'source': instance.source,
};