AffiliateInfo.fromJson constructor

AffiliateInfo.fromJson(
  1. Map<String, dynamic> json
)

Creates an AffiliateInfo object from JSON.

Implementation

factory AffiliateInfo.fromJson(Map<String, dynamic> json) {
  return AffiliateInfo(
    affiliateUser: json['affiliate_user'] != null
        ? User.fromJson(json['affiliate_user'])
        : null,
    affiliateChat: json['affiliate_chat'] != null
        ? Chat.fromJson(json['affiliate_chat'])
        : null,
    commissionPerMille: json['commission_per_mille'],
    amount: json['amount'],
    nanostarAmount: json['nanostar_amount'],
  );
}