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('PaymentIntent(');
  $buf
    ..writeln()
    ..write('  amount: ')
    ..write(amount)
    ..write(',');
  $buf
    ..writeln()
    ..write('  amount_capturable: ')
    ..write(amountCapturable)
    ..write(',');
  if (amountDetails != null) {
    $buf
      ..writeln()
      ..write('  amount_details: ')
      ..write(amountDetails)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  amount_received: ')
    ..write(amountReceived)
    ..write(',');
  if (application != null) {
    $buf
      ..writeln()
      ..write('  application: ')
      ..write(application)
      ..write(',');
  }
  if (applicationFeeAmount != null) {
    $buf
      ..writeln()
      ..write('  application_fee_amount: ')
      ..write(applicationFeeAmount)
      ..write(',');
  }
  if (automaticPaymentMethods != null) {
    $buf
      ..writeln()
      ..write('  automatic_payment_methods: ')
      ..write(automaticPaymentMethods)
      ..write(',');
  }
  if (canceledAt != null) {
    $buf
      ..writeln()
      ..write('  canceled_at: ')
      ..write(canceledAt)
      ..write(',');
  }
  if (cancellationReason != null) {
    $buf
      ..writeln()
      ..write('  cancellation_reason: ')
      ..write(cancellationReason)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  capture_method: ')
    ..write(captureMethod)
    ..write(',');
  if (clientSecret != null) {
    $buf
      ..writeln()
      ..write('  client_secret: ')
      ..write(clientSecret)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  confirmation_method: ')
    ..write(confirmationMethod)
    ..write(',');
  $buf
    ..writeln()
    ..write('  created: ')
    ..write(created)
    ..write(',');
  $buf
    ..writeln()
    ..write('  currency: ')
    ..write(currency)
    ..write(',');
  if (customer != null) {
    $buf
      ..writeln()
      ..write('  customer: ')
      ..write(customer)
      ..write(',');
  }
  if (description != null) {
    $buf
      ..writeln()
      ..write('  description: ')
      ..write(description)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  id: ')
    ..write(id)
    ..write(',');
  if (invoice != null) {
    $buf
      ..writeln()
      ..write('  invoice: ')
      ..write(invoice)
      ..write(',');
  }
  if (lastPaymentError != null) {
    $buf
      ..writeln()
      ..write('  last_payment_error: ')
      ..write(lastPaymentError)
      ..write(',');
  }
  if (latestCharge != null) {
    $buf
      ..writeln()
      ..write('  latest_charge: ')
      ..write(latestCharge)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  livemode: ')
    ..write(livemode)
    ..write(',');
  $buf
    ..writeln()
    ..write('  metadata: ')
    ..write(metadata)
    ..write(',');
  if (nextAction != null) {
    $buf
      ..writeln()
      ..write('  next_action: ')
      ..write(nextAction)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  object: ')
    ..write(object)
    ..write(',');
  if (onBehalfOf != null) {
    $buf
      ..writeln()
      ..write('  on_behalf_of: ')
      ..write(onBehalfOf)
      ..write(',');
  }
  if (paymentMethod != null) {
    $buf
      ..writeln()
      ..write('  payment_method: ')
      ..write(paymentMethod)
      ..write(',');
  }
  if (paymentMethodConfigurationDetails != null) {
    $buf
      ..writeln()
      ..write('  payment_method_configuration_details: ')
      ..write(paymentMethodConfigurationDetails)
      ..write(',');
  }
  if (paymentMethodOptions != null) {
    $buf
      ..writeln()
      ..write('  payment_method_options: ')
      ..write(paymentMethodOptions)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  payment_method_types: ')
    ..write(paymentMethodTypes)
    ..write(',');
  if (processing != null) {
    $buf
      ..writeln()
      ..write('  processing: ')
      ..write(processing)
      ..write(',');
  }
  if (receiptEmail != null) {
    $buf
      ..writeln()
      ..write('  receipt_email: ')
      ..write(receiptEmail)
      ..write(',');
  }
  if (review != null) {
    $buf
      ..writeln()
      ..write('  review: ')
      ..write(review)
      ..write(',');
  }
  if (setupFutureUsage != null) {
    $buf
      ..writeln()
      ..write('  setup_future_usage: ')
      ..write(setupFutureUsage)
      ..write(',');
  }
  if (shipping != null) {
    $buf
      ..writeln()
      ..write('  shipping: ')
      ..write(shipping)
      ..write(',');
  }
  if (source != null) {
    $buf
      ..writeln()
      ..write('  source: ')
      ..write(source)
      ..write(',');
  }
  if (statementDescriptor != null) {
    $buf
      ..writeln()
      ..write('  statement_descriptor: ')
      ..write(statementDescriptor)
      ..write(',');
  }
  if (statementDescriptorSuffix != null) {
    $buf
      ..writeln()
      ..write('  statement_descriptor_suffix: ')
      ..write(statementDescriptorSuffix)
      ..write(',');
  }
  $buf
    ..writeln()
    ..write('  status: ')
    ..write(status)
    ..write(',');
  if (transferData != null) {
    $buf
      ..writeln()
      ..write('  transfer_data: ')
      ..write(transferData)
      ..write(',');
  }
  if (transferGroup != null) {
    $buf
      ..writeln()
      ..write('  transfer_group: ')
      ..write(transferGroup)
      ..write(',');
  }
  $buf.write(')');
  return $buf.toString();
}