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 strbuf = StringBuffer();
  if (filename != null) strbuf.write('filename: $filename, ');
  if (path != null) strbuf.write('path: $path, ');
  if (fullPathName != null) strbuf.write('fullPathName: $fullPathName, ');
  if (extension != null) strbuf.write('extension: $extension, ');
  if (size != null) strbuf.write('size: $size, ');
  if (dateCreated != null) strbuf.write('dateCreated: $dateCreated, ');
  if (dateModified != null) strbuf.write('dateModified: $dateModified, ');
  if (dateAccessed != null) strbuf.write('dateAccessed: $dateAccessed, ');
  if (attributes != null) strbuf.write('attributes: $attributes, ');
  if (fileListFileName != null)
    strbuf.write('fileListFileName: $fileListFileName, ');
  if (runCount != null) strbuf.write('runCount: $runCount, ');
  if (dateRun != null) strbuf.write('dateRun: $dateRun, ');
  if (dateRecentlyChanged != null)
    strbuf.write('dateRecentlyChanged: $dateRecentlyChanged, ');
  if (highlightedFileName != null)
    strbuf.write('highlightedFileName: $highlightedFileName, ');
  if (highlightedPath != null)
    strbuf.write('highlightedPath: $highlightedPath, ');
  if (highlightedFullPathAndFileName != null) {
    strbuf.write(
        'highlightedFullPathAndFileName: $highlightedFullPathAndFileName, ');
  }

  return strbuf.toString();
}