toJSON method

String toJSON()

Returns a string containing the whole URL. It returns the same string as the href property.

MDN reference

Implementation

String toJSON() => json.encode(href);