383462ef
吴启风
feat: 新增视频专区列表与播放功能
|
1
2
3
4
5
6
7
|
class VideoZoneItem {
const VideoZoneItem({
required this.id,
required this.name,
required this.coverUrl,
required this.videoUrl,
required this.accessible,
|
383462ef
吴启风
feat: 新增视频专区列表与播放功能
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
});
factory VideoZoneItem.fromJson(Map<String, dynamic> json) {
int toInt(dynamic value) =>
value is num ? value.toInt() : int.tryParse('$value') ?? 0;
bool toBool(dynamic value) =>
value == true || value == 1 || value?.toString() == 'true';
return VideoZoneItem(
id: toInt(json['id']),
name: json['name']?.toString() ?? '',
coverUrl: json['coverUrl']?.toString() ?? '',
videoUrl: json['videoUrl']?.toString() ?? '',
accessible: toBool(json['accessible']),
|