fromJson static method

Link fromJson(
  1. dynamic value
)

Returns a new Link instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static Link fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return Link(
      href: mapValueOfType<String>(json, r'href'),
      type: mapValueOfType<String>(json, r'type'),
    );
  }
  throw ArgumentError('Value is not a map');
}