toString method

  1. @override
String toString()
override

A string representation of this object.

Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.

Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.

Implementation

@override
String toString() {
  final $buf = StringBuffer()..writeln('Invoice(');
  if (accountCountry != null) {
    $buf
      ..writeln()
      ..write('  account_country: ')
      ..write(accountCountry)
      ..write(',');
  }
  if (accountName != null) {
    $buf
      ..writeln()
      ..write('  account_name: ')
      ..write(accountName)
      ..write(',');
  }
  if (accountTaxIds != null) {
    $buf
      ..writeln()
      ..write('  account_tax_ids: ')
      ..write(accountTaxIds)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  amount_due: ')
    ..write(amountDue)
    ..write(',');
  $buf
    ..writeln()
    ..write('  amount_paid: ')
    ..write(amountPaid)
    ..write(',');
  $buf
    ..writeln()
    ..write('  amount_remaining: ')
    ..write(amountRemaining)
    ..write(',');
  $buf
    ..writeln()
    ..write('  amount_shipping: ')
    ..write(amountShipping)
    ..write(',');
  if (application != null) {
    $buf
      ..writeln()
      ..write('  application: ')
      ..write(application)
      ..write(',');
  }
  if (applicationFeeAmount != null) {
    $buf
      ..writeln()
      ..write('  application_fee_amount: ')
      ..write(applicationFeeAmount)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  attempt_count: ')
    ..write(attemptCount)
    ..write(',');
  $buf
    ..writeln()
    ..write('  attempted: ')
    ..write(attempted)
    ..write(',');
  if (autoAdvance != null) {
    $buf
      ..writeln()
      ..write('  auto_advance: ')
      ..write(autoAdvance)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  automatic_tax: ')
    ..write(automaticTax)
    ..write(',');
  if (billingReason != null) {
    $buf
      ..writeln()
      ..write('  billing_reason: ')
      ..write(billingReason)
      ..write(',');
  }
  if (charge != null) {
    $buf
      ..writeln()
      ..write('  charge: ')
      ..write(charge)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  collection_method: ')
    ..write(collectionMethod)
    ..write(',');
  $buf
    ..writeln()
    ..write('  created: ')
    ..write(created)
    ..write(',');
  $buf
    ..writeln()
    ..write('  currency: ')
    ..write(currency)
    ..write(',');
  if (customFields != null) {
    $buf
      ..writeln()
      ..write('  custom_fields: ')
      ..write(customFields)
      ..write(',');
  }
  if (customer != null) {
    $buf
      ..writeln()
      ..write('  customer: ')
      ..write(customer)
      ..write(',');
  }
  if (customerAddress != null) {
    $buf
      ..writeln()
      ..write('  customer_address: ')
      ..write(customerAddress)
      ..write(',');
  }
  if (customerEmail != null) {
    $buf
      ..writeln()
      ..write('  customer_email: ')
      ..write(customerEmail)
      ..write(',');
  }
  if (customerName != null) {
    $buf
      ..writeln()
      ..write('  customer_name: ')
      ..write(customerName)
      ..write(',');
  }
  if (customerPhone != null) {
    $buf
      ..writeln()
      ..write('  customer_phone: ')
      ..write(customerPhone)
      ..write(',');
  }
  if (customerShipping != null) {
    $buf
      ..writeln()
      ..write('  customer_shipping: ')
      ..write(customerShipping)
      ..write(',');
  }
  if (customerTaxExempt != null) {
    $buf
      ..writeln()
      ..write('  customer_tax_exempt: ')
      ..write(customerTaxExempt)
      ..write(',');
  }
  if (customerTaxIds != null) {
    $buf
      ..writeln()
      ..write('  customer_tax_ids: ')
      ..write(customerTaxIds)
      ..write(',');
  }
  if (defaultPaymentMethod != null) {
    $buf
      ..writeln()
      ..write('  default_payment_method: ')
      ..write(defaultPaymentMethod)
      ..write(',');
  }
  if (defaultSource != null) {
    $buf
      ..writeln()
      ..write('  default_source: ')
      ..write(defaultSource)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  default_tax_rates: ')
    ..write(defaultTaxRates)
    ..write(',');
  if (description != null) {
    $buf
      ..writeln()
      ..write('  description: ')
      ..write(description)
      ..write(',');
  }
  if (discount != null) {
    $buf
      ..writeln()
      ..write('  discount: ')
      ..write(discount)
      ..write(',');
  }
  if (discounts != null) {
    $buf
      ..writeln()
      ..write('  discounts: ')
      ..write(discounts)
      ..write(',');
  }
  if (dueDate != null) {
    $buf
      ..writeln()
      ..write('  due_date: ')
      ..write(dueDate)
      ..write(',');
  }
  if (effectiveAt != null) {
    $buf
      ..writeln()
      ..write('  effective_at: ')
      ..write(effectiveAt)
      ..write(',');
  }
  if (endingBalance != null) {
    $buf
      ..writeln()
      ..write('  ending_balance: ')
      ..write(endingBalance)
      ..write(',');
  }
  if (footer != null) {
    $buf
      ..writeln()
      ..write('  footer: ')
      ..write(footer)
      ..write(',');
  }
  if (fromInvoice != null) {
    $buf
      ..writeln()
      ..write('  from_invoice: ')
      ..write(fromInvoice)
      ..write(',');
  }
  if (hostedInvoiceUrl != null) {
    $buf
      ..writeln()
      ..write('  hosted_invoice_url: ')
      ..write(hostedInvoiceUrl)
      ..write(',');
  }
  if (id != null) {
    $buf
      ..writeln()
      ..write('  id: ')
      ..write(id)
      ..write(',');
  }
  if (invoicePdf != null) {
    $buf
      ..writeln()
      ..write('  invoice_pdf: ')
      ..write(invoicePdf)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  issuer: ')
    ..write(issuer)
    ..write(',');
  if (lastFinalizationError != null) {
    $buf
      ..writeln()
      ..write('  last_finalization_error: ')
      ..write(lastFinalizationError)
      ..write(',');
  }
  if (latestRevision != null) {
    $buf
      ..writeln()
      ..write('  latest_revision: ')
      ..write(latestRevision)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  lines: ')
    ..write(lines)
    ..write(',');
  $buf
    ..writeln()
    ..write('  livemode: ')
    ..write(livemode)
    ..write(',');
  if (metadata != null) {
    $buf
      ..writeln()
      ..write('  metadata: ')
      ..write(metadata)
      ..write(',');
  }
  if (nextPaymentAttempt != null) {
    $buf
      ..writeln()
      ..write('  next_payment_attempt: ')
      ..write(nextPaymentAttempt)
      ..write(',');
  }
  if (number != null) {
    $buf
      ..writeln()
      ..write('  number: ')
      ..write(number)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  object: ')
    ..write(object)
    ..write(',');
  if (onBehalfOf != null) {
    $buf
      ..writeln()
      ..write('  on_behalf_of: ')
      ..write(onBehalfOf)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  paid: ')
    ..write(paid)
    ..write(',');
  $buf
    ..writeln()
    ..write('  paid_out_of_band: ')
    ..write(paidOutOfBand)
    ..write(',');
  if (paymentIntent != null) {
    $buf
      ..writeln()
      ..write('  payment_intent: ')
      ..write(paymentIntent)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  payment_settings: ')
    ..write(paymentSettings)
    ..write(',');
  $buf
    ..writeln()
    ..write('  period_end: ')
    ..write(periodEnd)
    ..write(',');
  $buf
    ..writeln()
    ..write('  period_start: ')
    ..write(periodStart)
    ..write(',');
  $buf
    ..writeln()
    ..write('  post_payment_credit_notes_amount: ')
    ..write(postPaymentCreditNotesAmount)
    ..write(',');
  $buf
    ..writeln()
    ..write('  pre_payment_credit_notes_amount: ')
    ..write(prePaymentCreditNotesAmount)
    ..write(',');
  if (quote != null) {
    $buf
      ..writeln()
      ..write('  quote: ')
      ..write(quote)
      ..write(',');
  }
  if (receiptNumber != null) {
    $buf
      ..writeln()
      ..write('  receipt_number: ')
      ..write(receiptNumber)
      ..write(',');
  }
  if (rendering != null) {
    $buf
      ..writeln()
      ..write('  rendering: ')
      ..write(rendering)
      ..write(',');
  }
  if (renderingOptions != null) {
    $buf
      ..writeln()
      ..write('  rendering_options: ')
      ..write(renderingOptions)
      ..write(',');
  }
  if (shippingCost != null) {
    $buf
      ..writeln()
      ..write('  shipping_cost: ')
      ..write(shippingCost)
      ..write(',');
  }
  if (shippingDetails != null) {
    $buf
      ..writeln()
      ..write('  shipping_details: ')
      ..write(shippingDetails)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  starting_balance: ')
    ..write(startingBalance)
    ..write(',');
  if (statementDescriptor != null) {
    $buf
      ..writeln()
      ..write('  statement_descriptor: ')
      ..write(statementDescriptor)
      ..write(',');
  }
  if (status != null) {
    $buf
      ..writeln()
      ..write('  status: ')
      ..write(status)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  status_transitions: ')
    ..write(statusTransitions)
    ..write(',');
  if (subscription != null) {
    $buf
      ..writeln()
      ..write('  subscription: ')
      ..write(subscription)
      ..write(',');
  }
  if (subscriptionDetails != null) {
    $buf
      ..writeln()
      ..write('  subscription_details: ')
      ..write(subscriptionDetails)
      ..write(',');
  }
  if (subscriptionProrationDate != null) {
    $buf
      ..writeln()
      ..write('  subscription_proration_date: ')
      ..write(subscriptionProrationDate)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  subtotal: ')
    ..write(subtotal)
    ..write(',');
  if (subtotalExcludingTax != null) {
    $buf
      ..writeln()
      ..write('  subtotal_excluding_tax: ')
      ..write(subtotalExcludingTax)
      ..write(',');
  }
  if (tax != null) {
    $buf
      ..writeln()
      ..write('  tax: ')
      ..write(tax)
      ..write(',');
  }
  if (testClock != null) {
    $buf
      ..writeln()
      ..write('  test_clock: ')
      ..write(testClock)
      ..write(',');
  }
  if (thresholdReason != null) {
    $buf
      ..writeln()
      ..write('  threshold_reason: ')
      ..write(thresholdReason)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  total: ')
    ..write(total)
    ..write(',');
  if (totalDiscountAmounts != null) {
    $buf
      ..writeln()
      ..write('  total_discount_amounts: ')
      ..write(totalDiscountAmounts)
      ..write(',');
  }
  if (totalExcludingTax != null) {
    $buf
      ..writeln()
      ..write('  total_excluding_tax: ')
      ..write(totalExcludingTax)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  total_tax_amounts: ')
    ..write(totalTaxAmounts)
    ..write(',');
  if (transferData != null) {
    $buf
      ..writeln()
      ..write('  transfer_data: ')
      ..write(transferData)
      ..write(',');
  }
  if (webhooksDeliveredAt != null) {
    $buf
      ..writeln()
      ..write('  webhooks_delivered_at: ')
      ..write(webhooksDeliveredAt)
      ..write(',');
  }
  $buf.write(')');
  return $buf.toString();
}