mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 10:36:24 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
47
lib/models/dynamics/opus_detail/module_stat.dart
Normal file
47
lib/models/dynamics/opus_detail/module_stat.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
import 'coin.dart';
|
||||
import 'comment.dart';
|
||||
import 'favorite.dart';
|
||||
import 'forward.dart';
|
||||
import 'like.dart';
|
||||
|
||||
class ModuleStat {
|
||||
Coin? coin;
|
||||
Comment? comment;
|
||||
Favorite? favorite;
|
||||
Forward? forward;
|
||||
Like? like;
|
||||
|
||||
ModuleStat({
|
||||
this.coin,
|
||||
this.comment,
|
||||
this.favorite,
|
||||
this.forward,
|
||||
this.like,
|
||||
});
|
||||
|
||||
factory ModuleStat.fromJson(Map<String, dynamic> json) => ModuleStat(
|
||||
coin: json['coin'] == null
|
||||
? null
|
||||
: Coin.fromJson(json['coin'] as Map<String, dynamic>),
|
||||
comment: json['comment'] == null
|
||||
? null
|
||||
: Comment.fromJson(json['comment'] as Map<String, dynamic>),
|
||||
favorite: json['favorite'] == null
|
||||
? null
|
||||
: Favorite.fromJson(json['favorite'] as Map<String, dynamic>),
|
||||
forward: json['forward'] == null
|
||||
? null
|
||||
: Forward.fromJson(json['forward'] as Map<String, dynamic>),
|
||||
like: json['like'] == null
|
||||
? null
|
||||
: Like.fromJson(json['like'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'coin': coin?.toJson(),
|
||||
'comment': comment?.toJson(),
|
||||
'favorite': favorite?.toJson(),
|
||||
'forward': forward?.toJson(),
|
||||
'like': like?.toJson(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user