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 json) => ModuleStat( coin: json['coin'] == null ? null : Coin.fromJson(json['coin'] as Map), comment: json['comment'] == null ? null : Comment.fromJson(json['comment'] as Map), favorite: json['favorite'] == null ? null : Favorite.fromJson(json['favorite'] as Map), forward: json['forward'] == null ? null : Forward.fromJson(json['forward'] as Map), like: json['like'] == null ? null : Like.fromJson(json['like'] as Map), ); Map toJson() => { 'coin': coin?.toJson(), 'comment': comment?.toJson(), 'favorite': favorite?.toJson(), 'forward': forward?.toJson(), 'like': like?.toJson(), }; }