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 props = <String>[];
  if (size != null) props.add('size: $size');
  if (userID != null) props.add('uid: $userID');
  if (groupID != null) props.add('gid: $groupID');
  if (mode != null) props.add('mode: otc($mode)');
  if (accessTime != null) props.add('atime: $accessTime');
  if (modifyTime != null) props.add('mtime: $modifyTime');
  if (extended != null) props.add('extended: $extended');
  return 'SftpFileAttrs(${props.join(', ')})';
}