podcast overview
This commit is contained in:
parent
7f0d0689f8
commit
3a0622939e
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:didvan/models/category.dart';
|
import 'package:didvan/models/category.dart';
|
||||||
|
import 'package:html/parser.dart';
|
||||||
|
|
||||||
class OverviewData {
|
class OverviewData {
|
||||||
final int id;
|
final int id;
|
||||||
|
|
@ -33,28 +34,33 @@ class OverviewData {
|
||||||
this.categories,
|
this.categories,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory OverviewData.fromJson(Map<String, dynamic> json) => OverviewData(
|
factory OverviewData.fromJson(Map<String, dynamic> json) {
|
||||||
id: json['id'],
|
final document = parse(json['description']);
|
||||||
title: json['title'],
|
final String parsedString =
|
||||||
image: json['image'],
|
parse(document.body!.text).documentElement!.text;
|
||||||
description: json['description'],
|
return OverviewData(
|
||||||
timeToRead: json['timeToRead'],
|
id: json['id'],
|
||||||
reference: json['reference'],
|
title: json['title'],
|
||||||
forManagers: json['forManagers'] ?? false,
|
image: json['image'],
|
||||||
comments: json['comments'] ?? 0,
|
description: parsedString,
|
||||||
createdAt: json['createdAt'],
|
timeToRead: json['timeToRead'],
|
||||||
duration: json['duration'],
|
reference: json['reference'],
|
||||||
type: json['type'] ?? '',
|
forManagers: json['forManagers'] ?? false,
|
||||||
marked: json['marked'] ?? true,
|
comments: json['comments'] ?? 0,
|
||||||
media: json['media'],
|
createdAt: json['createdAt'],
|
||||||
categories: json['categories'] != null
|
duration: json['duration'],
|
||||||
? List<CategoryData>.from(
|
type: json['type'] ?? '',
|
||||||
json['categories'].map(
|
marked: json['marked'] ?? true,
|
||||||
(e) => CategoryData.fromJson(e),
|
media: json['media'],
|
||||||
),
|
categories: json['categories'] != null
|
||||||
)
|
? List<CategoryData>.from(
|
||||||
: null,
|
json['categories'].map(
|
||||||
);
|
(e) => CategoryData.fromJson(e),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue