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('CreditNote(');
  $buf
    ..writeln()
    ..write('  amount: ')
    ..write(amount)
    ..write(',');
  $buf
    ..writeln()
    ..write('  amount_shipping: ')
    ..write(amountShipping)
    ..write(',');
  $buf
    ..writeln()
    ..write('  created: ')
    ..write(created)
    ..write(',');
  $buf
    ..writeln()
    ..write('  currency: ')
    ..write(currency)
    ..write(',');
  $buf
    ..writeln()
    ..write('  customer: ')
    ..write(customer)
    ..write(',');
  if (customerBalanceTransaction != null) {
    $buf
      ..writeln()
      ..write('  customer_balance_transaction: ')
      ..write(customerBalanceTransaction)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  discount_amount: ')
    ..write(discountAmount)
    ..write(',');
  $buf
    ..writeln()
    ..write('  discount_amounts: ')
    ..write(discountAmounts)
    ..write(',');
  if (effectiveAt != null) {
    $buf
      ..writeln()
      ..write('  effective_at: ')
      ..write(effectiveAt)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  id: ')
    ..write(id)
    ..write(',');
  $buf
    ..writeln()
    ..write('  invoice: ')
    ..write(invoice)
    ..write(',');
  $buf
    ..writeln()
    ..write('  lines: ')
    ..write(lines)
    ..write(',');
  $buf
    ..writeln()
    ..write('  livemode: ')
    ..write(livemode)
    ..write(',');
  if (memo != null) {
    $buf
      ..writeln()
      ..write('  memo: ')
      ..write(memo)
      ..write(',');
  }
  if (metadata != null) {
    $buf
      ..writeln()
      ..write('  metadata: ')
      ..write(metadata)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  number: ')
    ..write(number)
    ..write(',');
  $buf
    ..writeln()
    ..write('  object: ')
    ..write(object)
    ..write(',');
  if (outOfBandAmount != null) {
    $buf
      ..writeln()
      ..write('  out_of_band_amount: ')
      ..write(outOfBandAmount)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  pdf: ')
    ..write(pdf)
    ..write(',');
  if (reason != null) {
    $buf
      ..writeln()
      ..write('  reason: ')
      ..write(reason)
      ..write(',');
  }
  if (refund != null) {
    $buf
      ..writeln()
      ..write('  refund: ')
      ..write(refund)
      ..write(',');
  }
  if (shippingCost != null) {
    $buf
      ..writeln()
      ..write('  shipping_cost: ')
      ..write(shippingCost)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  status: ')
    ..write(status)
    ..write(',');
  $buf
    ..writeln()
    ..write('  subtotal: ')
    ..write(subtotal)
    ..write(',');
  if (subtotalExcludingTax != null) {
    $buf
      ..writeln()
      ..write('  subtotal_excluding_tax: ')
      ..write(subtotalExcludingTax)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  tax_amounts: ')
    ..write(taxAmounts)
    ..write(',');
  $buf
    ..writeln()
    ..write('  total: ')
    ..write(total)
    ..write(',');
  if (totalExcludingTax != null) {
    $buf
      ..writeln()
      ..write('  total_excluding_tax: ')
      ..write(totalExcludingTax)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  type: ')
    ..write(type)
    ..write(',');
  if (voidedAt != null) {
    $buf
      ..writeln()
      ..write('  voided_at: ')
      ..write(voidedAt)
      ..write(',');
  }
  $buf.write(')');
  return $buf.toString();
}