vip_info.dart
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class VipInfo {
const VipInfo({
this.isVip,
this.isForeverVip,
this.isShare,
this.vipStartDate,
this.vipEndDate,
this.vipType,
});
final bool? isVip;
final bool? isForeverVip;
final bool? isShare;
final int? vipStartDate;
final int? vipEndDate;
final int? vipType;
factory VipInfo.fromJson(Map<String, dynamic> json) {
return VipInfo(
isVip: json['is_vip'] as bool?,
isForeverVip: json['vip_is_forever'] as bool?,
isShare: json['is_share'] as bool?,
vipStartDate: (json['vip_start_date'] as num?)?.toInt(),
vipEndDate: (json['vip_end_date'] as num?)?.toInt(),
vipType: (json['vip_type'] as num?)?.toInt(),
);
}
Map<String, dynamic> toJson() {
final val = <String, dynamic>{};
if (isVip != null) val['is_vip'] = isVip;
if (isForeverVip != null) val['vip_is_forever'] = isForeverVip;
if (isShare != null) val['is_share'] = isShare;
if (vipStartDate != null) val['vip_start_date'] = vipStartDate;
if (vipEndDate != null) val['vip_end_date'] = vipEndDate;
if (vipType != null) val['vip_type'] = vipType;
return val;
}
}