mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-09 11:37:51 +08:00
mod: article: show list
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'node.dart';
|
||||
import 'pic.dart';
|
||||
import 'text.dart';
|
||||
|
||||
@@ -9,6 +10,7 @@ class Paragraph {
|
||||
Line? line;
|
||||
LinkCard? linkCard;
|
||||
Code? code;
|
||||
L1st? list;
|
||||
|
||||
Paragraph({
|
||||
this.align,
|
||||
@@ -18,6 +20,7 @@ class Paragraph {
|
||||
this.line,
|
||||
this.linkCard,
|
||||
this.code,
|
||||
this.list,
|
||||
});
|
||||
|
||||
factory Paragraph.fromJson(Map<String, dynamic> json) => Paragraph(
|
||||
@@ -34,6 +37,7 @@ class Paragraph {
|
||||
? null
|
||||
: LinkCard.fromJson(json['link_card']),
|
||||
code: json['code'] == null ? null : Code.fromJson(json['code']),
|
||||
list: json['list'] == null ? null : L1st.fromJson(json['list']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
@@ -44,6 +48,28 @@ class Paragraph {
|
||||
};
|
||||
}
|
||||
|
||||
class L1st {
|
||||
List<Item>? items;
|
||||
int? style;
|
||||
|
||||
L1st.fromJson(Map<String, dynamic> json) {
|
||||
items = (json['items'] as List?)?.map((e) => Item.fromJson(e)).toList();
|
||||
style = json['style'];
|
||||
}
|
||||
}
|
||||
|
||||
class Item {
|
||||
int? level;
|
||||
int? order;
|
||||
List<Node>? nodes;
|
||||
|
||||
Item.fromJson(Map<String, dynamic> json) {
|
||||
level = json['level'];
|
||||
order = json['order'];
|
||||
nodes = (json['nodes'] as List?)?.map((e) => Node.fromJson(e)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
class Code {
|
||||
String? content;
|
||||
String? lang;
|
||||
|
||||
@@ -5,8 +5,15 @@ class Word {
|
||||
double? fontSize;
|
||||
Style? style;
|
||||
String? words;
|
||||
String? fontLevel;
|
||||
|
||||
Word({this.color, this.fontSize, this.style, this.words});
|
||||
Word({
|
||||
this.color,
|
||||
this.fontSize,
|
||||
this.style,
|
||||
this.words,
|
||||
this.fontLevel,
|
||||
});
|
||||
|
||||
factory Word.fromJson(Map<String, dynamic> json) => Word(
|
||||
color: json['color'] == null
|
||||
@@ -17,6 +24,7 @@ class Word {
|
||||
? null
|
||||
: Style.fromJson(json['style'] as Map<String, dynamic>),
|
||||
words: json['words'] as String?,
|
||||
fontLevel: json['font_level'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
@@ -24,5 +32,6 @@ class Word {
|
||||
'font_size': fontSize,
|
||||
'style': style?.toJson(),
|
||||
'words': words,
|
||||
'font_level': fontLevel,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user