toString method

  1. @override
String toString ()
override

Returns a string representation of this object.

Implementation

@override
String toString() {
  String selfType = runtimeType.toString();
  // const GlobalObjectKey().runtimeType.toString() returns 'GlobalObjectKey<State<StatefulWidget>>'
  // because GlobalObjectKey is instantiated to its bounds. To avoid cluttering the output
  // we remove the suffix.
  const String suffix = '<State<StatefulWidget>>';
  if (selfType.endsWith(suffix)) {
    selfType = selfType.substring(0, selfType.length - suffix.length);
  }
  return '[$selfType ${describeIdentity(value)}]';
}