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 v = 'verified: true';
  final p1 = 'projectId:\'$projectId\'';
  final p2 = 'sdkVersion:\'${sdkVersion.replaceAll("'", "\\'")}\'';
  final m1 = 'name:\'${metadata.name.replaceAll("'", "\\'")}\'';
  final m2 = 'description:\'${metadata.description.replaceAll("'", "\\'")}\'';
  final m3 = 'url:\'${metadata.url}\'';
  final m4 = 'icons:["${metadata.icons.first}"]';
  final r1 = 'native:"${metadata.redirect?.native}"';
  final r2 = 'universal:"${metadata.redirect?.universal}"';
  final r3 = 'linkMode:"${metadata.redirect?.linkMode}"';
  final m5 = 'redirect:{$r1,$r2,$r3}';
  final p3 = 'metadata:{$m1,$m2,$m3,$m4,$m5}';
  final p = 'payload:{$v,$p1,$p2,$p3}';
  return '{type:"${super.type}",$p}';
}