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() {
  return '---BEGIN TYPE 2 MESSAGE---\n'
      'Signature:        ${ascii.decode(signature.toList(), allowInvalid: true)}\n'
      '  Raw:            ${signature.toList()}\n'
      'Type:             $type\n'
      'Target Name:      ${ascii.decode(targetName.toList(), allowInvalid: true)}\n'
      '  Length:         $targetNameLength\n'
      '  Max Length:     $targetNameMaxLength\n'
      '  Offset:         $targetNameOffset\n'
      '  Raw:            ${targetName.toList()}\n'
      'Negotiate Flags:  $negotiateFlags\n'
      'Server Challenge: ${serverChallenge.toList()}\n'
      'Reserved:         ${reserved.toList()}\n'
      'Target Info:      ${targetInfo == null ? null : ascii.decode(targetInfo!.toList(), allowInvalid: true)}\n'
      '  Length:         $targetInfoLength\n'
      '  Max Length:     $targetInfoMaxLength\n'
      '  Offset:         $targetInfoOffset\n'
      '  Raw:            ${targetInfo?.toList()}\n'
      '---END TYPE 2 MESSAGE---';
}