mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-26 05:16:01 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
30
lib/models/dynamics/opus_detail/node.dart
Normal file
30
lib/models/dynamics/opus_detail/node.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'rich.dart';
|
||||
import 'word.dart';
|
||||
|
||||
class Node {
|
||||
String? type;
|
||||
Word? word;
|
||||
Rich? rich;
|
||||
|
||||
Node({
|
||||
this.type,
|
||||
this.word,
|
||||
this.rich,
|
||||
});
|
||||
|
||||
factory Node.fromJson(Map<String, dynamic> json) => Node(
|
||||
type: json['type'] as String?,
|
||||
word: json['word'] == null
|
||||
? null
|
||||
: Word.fromJson(json['word'] as Map<String, dynamic>),
|
||||
rich: json['rich'] == null
|
||||
? null
|
||||
: Rich.fromJson(json['rich'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'type': type,
|
||||
'word': word?.toJson(),
|
||||
'rich': rich?.toJson(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user