toString method
Returns a string representation of (some of) the elements of this
.
Use either the prettyPrint
or the ImmutableCollection.prettyPrint parameters to get a
prettier print.
See also: ImmutableCollection
Implementation
@override
String toString([bool? prettyPrint]) {
if ((prettyPrint ?? ImmutableCollection.prettyPrint)) {
int length = _s.length;
if (length == 0) {
return "{}";
} else if (length == 1) {
return "{${_s.single}}";
} else {
return "{\n ${_s.join(",\n ")}\n}";
}
} else {
return "{${_s.join(", ")}}";
}
}