mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
29
lib/models/dynamics/opus_detail/item.dart
Normal file
29
lib/models/dynamics/opus_detail/item.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'basic.dart';
|
||||
import 'module.dart';
|
||||
|
||||
class Item {
|
||||
Basic? basic;
|
||||
String? idStr;
|
||||
List<OpusModule>? modules;
|
||||
int? type;
|
||||
|
||||
Item({this.basic, this.idStr, this.modules, this.type});
|
||||
|
||||
factory Item.fromJson(Map<String, dynamic> json) => Item(
|
||||
basic: json['basic'] == null
|
||||
? null
|
||||
: Basic.fromJson(json['basic'] as Map<String, dynamic>),
|
||||
idStr: json['id_str'] as String?,
|
||||
modules: (json['modules'] as List<dynamic>?)
|
||||
?.map((e) => OpusModule.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
type: json['type'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'basic': basic?.toJson(),
|
||||
'id_str': idStr,
|
||||
'modules': modules?.map((e) => e.toJson()).toList(),
|
||||
'type': type,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user