Link constructor

Link({
  1. String? relation,
  2. Uri? url,
})

Constructs a new Link with an optional relation type and URL.

Implementation

Link({
  String? relation,
  Uri? url,
}) : this.fromJson(
        JsonObject({
          if (relation != null) relationField.name: JsonString(relation),
          if (url != null) urlField.name: JsonString(url.toString()),
        }),
      );