simple_link_preview 2.1.0
simple_link_preview: ^2.1.0 copied to clipboard
Lightweight link previews for HTML metadata, direct images, and other web content types.
2.1.0 - 2026-09-14 #
- Fetch resources as streams and parse only the HTML head.
- Add normalized
contentTypeand pageiconmetadata. - Add
LinkPreview.toJson(). - Support direct images and other successful MIME types.
- Improve support for complex URLs and redirects.
- Return
nullfor invalid URLs and request failures. - Replace
metadata_fetch_plusanduniversal_htmlwithhtml. - Add deterministic unit tests for metadata, content types, redirects, and failure handling.
- Add an optional asynchronous
onErrorhandler toSimpleLinkPreview.getPreview(). - Add public immutable
LinkPreviewOptionswith timeout, HTML byte limit, and redirect limit configuration. - Add
LinkPreviewOptions.validateStatusto accept selected HTTP responses, including renderable error pages. - Accept Open Graph
nameattributes as a fallback forpropertyattributes. - Skip empty or invalid image and icon candidates before trying fallbacks.
- Resolve relative metadata URLs against a valid document
<base href>. - Sniff a bounded prefix for HTML when
Content-Typeis missing. - Apply one timeout deadline across sending, streaming, and parsing.
- Add structured
LinkPreviewExceptionerror codes and report verified failures, including HTTP statuses rejected byvalidateStatus, throughonError.
2.0.0 #
- Upgrade the minimum Dart SDK constraint to
>=3.0.0 <4.0.0.
1.0.2 #
- Format code.
1.0.1 #
- Update public API documentation.
1.0.0 #
- Initial version.