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,11 +34,15 @@ class OverviewData {
|
||||||
this.categories,
|
this.categories,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory OverviewData.fromJson(Map<String, dynamic> json) => OverviewData(
|
factory OverviewData.fromJson(Map<String, dynamic> json) {
|
||||||
|
final document = parse(json['description']);
|
||||||
|
final String parsedString =
|
||||||
|
parse(document.body!.text).documentElement!.text;
|
||||||
|
return OverviewData(
|
||||||
id: json['id'],
|
id: json['id'],
|
||||||
title: json['title'],
|
title: json['title'],
|
||||||
image: json['image'],
|
image: json['image'],
|
||||||
description: json['description'],
|
description: parsedString,
|
||||||
timeToRead: json['timeToRead'],
|
timeToRead: json['timeToRead'],
|
||||||
reference: json['reference'],
|
reference: json['reference'],
|
||||||
forManagers: json['forManagers'] ?? false,
|
forManagers: json['forManagers'] ?? false,
|
||||||
|
|
@ -55,6 +60,7 @@ class OverviewData {
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() => {
|
Map<String, dynamic> toJson() => {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue