toJson method

Map<String, dynamic> toJson()

Converts this link to a data object.

Implementation

Map<String, dynamic> toJson() => {
      // set required fields
      'href': href,

      // set optional fields if available
      if (rel != null) 'rel': rel,
      if (type != null) 'type': type,
      if (hreflang != null) 'hreflang': hreflang,
      if (title != null) 'title': title,
      if (length != null) 'length': rel,
    };