toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts an InputInvoiceMessageContent object to a JSON map

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'title': title,
    'description': description,
    'payload': payload,
    'provider_token': providerToken,
    'currency': currency,
    'prices': prices.map((e) => e.toJson()).toList(),
    'max_tip_amount': maxTipAmount,
    'suggested_tip_amounts': suggestedTipAmounts,
    'provider_data': providerData,
    'photo_url': photoUrl,
    'photo_size': photoSize,
    'photo_width': photoWidth,
    'photo_height': photoHeight,
    'need_name': needName,
    'need_phone_number': needPhoneNumber,
    'need_email': needEmail,
    'need_shipping_address': needShippingAddress,
    'send_phone_number_to_provider': sendPhoneNumberToProvider,
    'send_email_to_provider': sendEmailToProvider,
    'is_flexible': isFlexible,
  }..removeWhere(_nullFilter);
}