Skip to content

Commit 48a6639

Browse files
committed
Created the userInterface Model.
1 parent 0fce92c commit 48a6639

File tree

1 file changed

+141
-0
lines changed

1 file changed

+141
-0
lines changed
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import 'package:equatable/equatable.dart';
2+
3+
class UserInterfaceModel extends Equatable {
4+
final bool showDateAdded;
5+
final bool showDateCreated;
6+
final bool showRatio;
7+
final bool showLocation;
8+
final bool showTags;
9+
final bool showTrackers;
10+
final bool showTrackersMessage;
11+
final bool showDownloadSpeed;
12+
final bool showUploadSpeed;
13+
final bool showPeers;
14+
final bool showSeeds;
15+
final bool showSize;
16+
final bool showType;
17+
final bool showHash;
18+
final bool showDelete;
19+
final bool showSetTags;
20+
final bool showCheckHash;
21+
final bool showReannounce;
22+
final bool showSetTrackers;
23+
final bool showGenerateMagnetLink;
24+
final bool showPriority;
25+
final bool showInitialSeeding;
26+
final bool showSequentialDownload;
27+
final bool showDownloadTorrent;
28+
29+
const UserInterfaceModel({
30+
required this.showDateAdded,
31+
required this.showDateCreated,
32+
required this.showRatio,
33+
required this.showLocation,
34+
required this.showTags,
35+
required this.showTrackers,
36+
required this.showTrackersMessage,
37+
required this.showDownloadSpeed,
38+
required this.showUploadSpeed,
39+
required this.showPeers,
40+
required this.showSeeds,
41+
required this.showSize,
42+
required this.showType,
43+
required this.showHash,
44+
required this.showDelete,
45+
required this.showSetTags,
46+
required this.showCheckHash,
47+
required this.showReannounce,
48+
required this.showSetTrackers,
49+
required this.showGenerateMagnetLink,
50+
required this.showPriority,
51+
required this.showInitialSeeding,
52+
required this.showSequentialDownload,
53+
required this.showDownloadTorrent,
54+
});
55+
56+
factory UserInterfaceModel.fromJson(Map<String, dynamic> json) {
57+
return UserInterfaceModel(
58+
showDateAdded: json['showDateAdded'] as bool,
59+
showDateCreated: json['showDateCreated'] as bool,
60+
showRatio: json['showRatio'] as bool,
61+
showLocation: json['showLocation'] as bool,
62+
showTags: json['showTags'] as bool,
63+
showTrackers: json['showTrackers'] as bool,
64+
showTrackersMessage: json['showTrackersMessage'] as bool,
65+
showDownloadSpeed: json['showDownloadSpeed'] as bool,
66+
showUploadSpeed: json['showUploadSpeed'] as bool,
67+
showPeers: json['showPeers'] as bool,
68+
showSeeds: json['showSeeds'] as bool,
69+
showSize: json['showSize'] as bool,
70+
showType: json['showType'] as bool,
71+
showHash: json['showHash'] as bool,
72+
showDelete: json['showDelete'] as bool,
73+
showCheckHash: json['showCheckHash'] as bool,
74+
showReannounce: json['showReannounce'] as bool,
75+
showSetTags: json['showSetTags'] as bool,
76+
showSetTrackers: json['showSetTrackers'] as bool,
77+
showGenerateMagnetLink: json['showGenerateMagnetLink'] as bool,
78+
showPriority: json['showPriority'] as bool,
79+
showInitialSeeding: json['showInitialSeeding'] as bool,
80+
showSequentialDownload: json['showSequentialDownload'] as bool,
81+
showDownloadTorrent: json['showDownloadTorrent'] as bool,
82+
);
83+
}
84+
85+
Map<String, dynamic> toJson() {
86+
return {
87+
'showDateAdded': showDateAdded,
88+
'showDateCreated': showDateCreated,
89+
'showRatio': showRatio,
90+
'showLocation': showLocation,
91+
'showTags': showTags,
92+
'showTrackers': showTrackers,
93+
'showTrackersMessage': showTrackersMessage,
94+
'showDownloadSpeed': showDownloadSpeed,
95+
'showUploadSpeed': showUploadSpeed,
96+
'showPeers': showPeers,
97+
'showSeeds': showSeeds,
98+
'showSize': showSize,
99+
'showType': showType,
100+
'showHash': showHash,
101+
'showDelete': showDelete,
102+
'showCheckHash': showCheckHash,
103+
'showReannounce': showReannounce,
104+
'showSetTags': showSetTags,
105+
'showSetTrackers': showSetTrackers,
106+
'showGenerateMagnetLink': showGenerateMagnetLink,
107+
'showPriority': showPriority,
108+
'showInitialSeeding': showInitialSeeding,
109+
'showSequentialDownload': showSequentialDownload,
110+
'showDownloadTorrent': showDownloadTorrent,
111+
};
112+
}
113+
114+
@override
115+
List<Object?> get props => [
116+
showDateAdded,
117+
showDateCreated,
118+
showRatio,
119+
showLocation,
120+
showTags,
121+
showTrackers,
122+
showTrackersMessage,
123+
showDownloadSpeed,
124+
showUploadSpeed,
125+
showPeers,
126+
showSeeds,
127+
showSize,
128+
showType,
129+
showHash,
130+
showDelete,
131+
showSetTags,
132+
showCheckHash,
133+
showReannounce,
134+
showSetTrackers,
135+
showGenerateMagnetLink,
136+
showPriority,
137+
showInitialSeeding,
138+
showSequentialDownload,
139+
showDownloadTorrent
140+
];
141+
}

0 commit comments

Comments
 (0)