flutter_link_preview_update 2.1.0
flutter_link_preview_update: ^2.1.0 copied to clipboard
A URL preview widget that fetches a page and extracts title, description, icon and image (OpenGraph-aware), with caching, charset/GBK support and Flutter Web support.
2.1.0 - 2026-08-15 #
Added #
-
oEmbed, which is what makes the big platforms previewable at all. YouTube answers a server — and a browser on another origin — with a consent page carrying no OpenGraph tags whatsoever, so no parser could ever have found a title in it. The same video's title, author and thumbnail are published at an oEmbed endpoint, deliberately, for exactly this purpose.
Two ways in. A page that advertises its own endpoint with
<link rel="alternate" type="application/json+oembed">is honoured, which covers every site implementing the spec — including ones nobody has heard of, and without a list to keep up to date. For the pages that cannot be read at all, and so carry no<link>to find, a short registry maps the host: YouTube, SoundCloud, Vimeo, X/Twitter, Spotify, TikTok, Dailymotion, Flickr, Mixcloud and Reddit. Host matching walks whole labels, sonotyoutube.comis never mistaken for YouTube.oEmbed is asked only when the page declared nothing — specifically, when it put no title in
og:titleor<title>. That distinction matters: since 2.0.1 a page with no description falls back to its first prose paragraph, and a consent wall's prose ("please accept cookies") would otherwise read as a page that had answered.thumbnail_urlbecomes the image, resolved against the page. oEmbed defines no description, so where a site sends one anyway it is used, and otherwiseauthor_name— for a video that is the channel, which is most of what anyone wants to know before opening it.
2.0.1 - 2026-08-14 #
Fixed #
- A page with no description meta tag no longer previews as its own
navigation. The fallback used to strip every tag from the document and
return the first 300 characters, so Wikipedia read "Jump to content Main
menu move to sidebar hide Navigation Main pageContents…" and Hacker News
read its own header and login links. It now takes the first paragraph that
reads like a sentence, ignoring
nav,header,footer,aside,form,script,styleandnoscript, and returns null when the page has no prose — a title alone beats a title followed by a menu.
Added #
twitter:descriptionis read when OpenGraph andmeta name="description"are both absent.
2.0.0 - 2026-08-12 #
Breaking modernization release: null safety, Dart 3, Flutter Web.
Breaking #
- Requires Dart >= 3.4 / Flutter >= 3.22.
- Null safety:
builderis nowWidget Function(InfoBase? info)?;WebInfo.title/description/icon/imageareString?;WebInfo.redirectUrlis non-null. InfoBaseis nowsealed(exhaustiveswitchsupported; no user subclassing).WebAnalyzer.getInforeturnsFuture<InfoBase?>; disable caching withDuration.zeroinstead ofnull.- Removed site-specific hacks: hard-coded weibo.com cookie, m.tb.cn body re-request, m.toutiaoimg.cn mobile user agent.
- Removed the insecure accept-all bad-certificate callback (invalid TLS certificates now fail, as they should).
Added #
- Flutter Web support (
useMultithreaddegrades to inline execution on web; CORS limits apply, see README). - Charset handling: honors the Content-Type header and
<meta charset>; GBK viapackage:charset(pure Dart, web-safe) replacing the discontinuedgbk2utf8; lenient UTF-8 as last resort. WebAnalyzer.userAgent(configurable), a requesttimeoutparameter, and an optionalWebAnalyzer.loggerhook (the package no longer prints to the console).- Handles 307/308 redirects in addition to 301/302/303.
- Unit and widget tests;
flutter_lints.
Fixed #
- Expired cache entries were still returned once after expiry; they are now evicted and refetched.
og:videometa tags were stripped before parsing, soWebVideoInfowas never produced from OpenGraph data.useMultithreadnow usesIsolate.runinstead of manual port/serialization machinery.- The widget refetches when its
urlchanges (didUpdateWidget), and stale in-flight results no longer overwrite newer ones.
1.5.6 2020-9-9. #
- Solve the problem that individual website can't be fetched
1.5.5 2020-8-31. #
- WebInfo adds redirectUrl property to record redirect addresses for short connections
1.5.4 2020-8-28. #
- Filtering special characters
1.5.3 2020-8-26. #
-
Add multi-thread switch, default is close multi-thread
-
Add support for parsing Tiktok
1.5.1 2020-8-20. #
- Use multi-processing to parse web pages, avoid blocking the main process
1.4.2 2020-8-15. #
-
Optimizing performance in a new way
-
Have better compatibility
-
Upgrade some APIs
-
Support for invalid certificates
1.3.4 2020-8-12. #
- New image tag parsing
1.3.3 2020-8-11. #
- Support for Taobao short connection analysis
1.3.2 2020-8-7. #
- Optimize performance
1.3.1 2020-8-6. #
-
Optimize cookie-dependent URL crawling
-
New gbk encoding support
-
Optimize the acquisition of icons, titiles and descriptions
1.2.11 2020-7-27. #
-
Optimization of some of the websites that do not match successfully, such as youtu
-
Optimizing code performance
1.2.10 2020-7-20. #
- Change the parameters from WebInfo to InfoBase
1.2.9 2020-6-28. #
- Addition of open source agreements
1.2.8 2020-6-18. #
- Fix some warnings
1.2.6 2020-6-10. #
- Adding Adaptation to Video
- Improved analytical performance
1.2.4 2020-5-30. #
- Images are displayed using CachedNetworkImage
- Fix possible errors when destroyed
1.2.2 2020-5-27. #
- New image display that can be used to display gifs
- Enhancing title and description access
1.1.2 2020-5-17. #
- Enhanced compatibility and error alerts
1.1.1 2020-5-16. #
- Update notes
1.1.0 2020-5-16. #
- Optimization code
- Add notes
1.0.0 2020-5-15. #
- Caching mechanism to return results faster
- Better fault tolerance
- Support Chinese no mess code