fromJson static method

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

Implementation

static StarTransaction? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return StarTransaction(
    id: (json['id'] as String?) ?? '',
    starAmount: StarAmount.fromJson(tdMapFromJson(json['star_amount'])),
    isRefund: (json['is_refund'] as bool?) ?? false,
    date: (json['date'] as int?) ?? 0,
    type: StarTransactionType.fromJson(tdMapFromJson(json['type'])),
  );
}