mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: show ops article
refactor: HtmlRenderPage
This commit is contained in:
72
lib/models/dynamics/article_content_model.dart
Normal file
72
lib/models/dynamics/article_content_model.dart
Normal file
@@ -0,0 +1,72 @@
|
||||
class ArticleContentModel {
|
||||
ArticleContentModel({
|
||||
this.attributes,
|
||||
this.insert,
|
||||
});
|
||||
Attributes? attributes;
|
||||
dynamic insert;
|
||||
|
||||
ArticleContentModel.fromJson(Map<String, dynamic> json) {
|
||||
attributes = json['attributes'] == null
|
||||
? null
|
||||
: Attributes.fromJson(json['attributes']);
|
||||
insert = json['insert'] == null
|
||||
? null
|
||||
: json['attributes']?['class'] == 'normal-img'
|
||||
? Insert.fromJson(json['insert'])
|
||||
: json['insert'];
|
||||
}
|
||||
}
|
||||
|
||||
class Insert {
|
||||
Insert({
|
||||
this.nativeImage,
|
||||
});
|
||||
NativeImage? nativeImage;
|
||||
|
||||
Insert.fromJson(Map<String, dynamic> json) {
|
||||
nativeImage = json['native-image'] == null
|
||||
? null
|
||||
: NativeImage.fromJson(json['native-image']);
|
||||
}
|
||||
}
|
||||
|
||||
class NativeImage {
|
||||
NativeImage({
|
||||
this.alt,
|
||||
this.url,
|
||||
this.width,
|
||||
this.height,
|
||||
this.size,
|
||||
this.status,
|
||||
});
|
||||
|
||||
dynamic alt;
|
||||
dynamic url;
|
||||
dynamic width;
|
||||
dynamic height;
|
||||
dynamic size;
|
||||
dynamic status;
|
||||
|
||||
NativeImage.fromJson(Map<String, dynamic> json) {
|
||||
alt = json['alt'];
|
||||
url = json['url'];
|
||||
width = json['width'];
|
||||
height = json['height'];
|
||||
size = json['size'];
|
||||
status = json['status'];
|
||||
}
|
||||
}
|
||||
|
||||
class Attributes {
|
||||
Attributes({
|
||||
this.clazz,
|
||||
});
|
||||
String? clazz;
|
||||
bool? bold;
|
||||
|
||||
Attributes.fromJson(Map<String, dynamic> json) {
|
||||
clazz = json['class'];
|
||||
bold = json['bold'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user