fromJson static method

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

Implementation

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

  return PaymentForm(
    id: (json['id'] is int
            ? json['id'] as int
            : int.tryParse(json['id']?.toString() ?? '')) ??
        0,
    type: PaymentFormType.fromJson(json['type'] as Map<String, dynamic>?)!,
    sellerBotUserId: (json['seller_bot_user_id'] as int?) ?? 0,
    productInfo:
        ProductInfo.fromJson(json['product_info'] as Map<String, dynamic>?)!,
  );
}