mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-28 19:58:50 +05:00
better
This commit is contained in:
29
lib/data/models/torrent/torrent_item.dart
Normal file
29
lib/data/models/torrent/torrent_item.dart
Normal 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);
|
||||
}
|
||||
28
lib/data/models/torrent/torrent_item.g.dart
Normal file
28
lib/data/models/torrent/torrent_item.g.dart
Normal 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,
|
||||
};
|
||||
Reference in New Issue
Block a user