toString method

  1. @override
String toString()
override

Returns the text representation of the item.

This is used when the object is printed or displayed.

Implementation

@override
String toString() {
  return "Key:$key\n Display text: $text\n Value:$value\n";
}