LinkPreview constructor

const LinkPreview({
  1. String? url,
  2. String? title,
  3. String? description,
  4. String? image,
  5. String? error,
  6. @JsonKey.new(name: 'likely_type') String? likelyType,
})

Implementation

const factory LinkPreview({
  /// The preview url if the link.
  String? url,

  /// The preview title of the link.
  String? title,

  /// The preview description of the link.
  String? description,

  /// The preview image of the link.
  String? image,

  /// The error message returned by cardyb, if any.
  ///
  /// cardyb's `/v1/extract` endpoint responds with HTTP 200 even when
  /// extraction fails, carrying a non-empty `error` field. Inspect this
  /// to distinguish a genuine failure from an empty preview.
  String? error,

  /// The likely type of the resource cardyb attempted to extract
  /// (e.g. `html`), mapped from the `likely_type` field.
  @JsonKey(name: 'likely_type') String? likelyType,
}) = _LinkPreview;