New Features:
- SVG Icon Support: AnyLinkPreview now seamlessly handles SVG images returned in metadata, enhancing support for various image formats.
- New Metadata Property -
siteName
: We've introduced asiteName
property to our metadata fetch method, allowing for richer data extraction and display.
Improvements:
- Enhanced
itemBuilder
Callback: TheitemBuilder
property has been expanded to return anSvgPicture
widget when metadata includes an SVG image. This ensures correct rendering of SVGs alongside standard image formats. - Comprehensive Error Handling: When both title and description are missing from the metadata, AnyLinkPreview will now resort to displaying the
errorWidget
(if provided) or a default error view. This update ensures a smoother user experience by providing informative feedback in cases of incomplete metadata. - Extended Redirect Support: To improve handling of server-driven redirects, AnyLinkPreview now supports up to 7 redirects, accommodating common status codes
301, 302, 303, 307, 308
. This enhancement ensures more reliable URL preview generation across a wider range of web links.
- Packages updated to support latest version.
- http links support added
- User Agent causing the redirection URLs, Server side rendered meta-tag URLs fail from getting results. Now, we are taking User Agent from server if available, As a fallback we are using client side static User Agent.
- If the link starts with
www.
we are removing the same before fetching the results. However, we suggest to check for link validity with the helper method provided before fetching results from the library.
- Packages upgraded to support latest version of flutter SDK.
- Now one can provide the height of the Preview Card as per their requirement.
- Builder function is added. Thanks to the contributor Maël
- Deprecated methods / functions are removed
- Renamed
uiDirection
toUIDirection
as per flutterlints
package suggestions. key
issue in Validation of link is resolved now. Know more about it here- Migration to Flutter Embedding & URL Launch customizations were added. Thanks to the conributor OmarYehiaDev
- Now one can also add custom headers to the preview requests
- For any sort of errors, it shows the
errorWidget
by default.
- Renamed
UIDirection
touiDirection
,UIDirectionHorizontal
touiDirectionHorizontal
andUIDirectionVertical
touiDirectionVertical
as per lint suggestions. - Refactored codebase according to the suggestions from official Dart linter package (package:lints)
- FIX: Twitter link preview. Twitter uses client-side-rendering (CSR) to generate HTML in the browser
- Viewing the source directly will not show any of the relevant tags or actual page HTML content, because it is all dynamically generated on the client's browser in React using JavaScript (i.e. CSR: Client-side rendering). In fact, the HTML source will have a stub containing "We've detected that JavaScript is disabled in your browser. Would you like to proceed to legacy Twitter?". This can be verified by opening up developer tools and peeking at the "Elements" tab during page load/render or downloading the page without JavaScript emulation
- However, to improve Search Engine Optimization (SEO) for various prominent web-crawlers, Twitter will instead return server-side-rendered (SSR) HTML content (which does contain the
<meta>
tags). This enables crawlers to not have to emulate JavaScript to view the page, and only crawl raw HTML content. Twitter recognizes crawlers based on the supplied User-Agent HTTP Header. Server-side-rendering is generally a more expensive operation than offloading the HTML rendering onto the client, which may be a reason why Twitter opts for client-side-rendering as the default behavior.
- Proxy URL added for CORS issue on the web. One can pass empty if they don't get any CORS issue while running on web platform.
- Now one can disable the
onTap
action on the card by passing empty functiononTap: (){}
- If you want to build your own UI & need just the meta data (with or without cache), then you can call the method
AnyLinkPreview.getMetadata(link: "https://google.com/")
which returns data of typeMetadata
- One can check if the URL is valid or not by calling
AnyLinkPreview.isValidLink("https://google.com/")
which returns a boolean.true
ifValid
,false
ifInvalid
.
- Multiline JSON support added
- Base64 image support is added
- 🎉 Web support added
- Now the plugin will work for most of the links (Even for dynamic links)
- Few minor bugs are closed from Github issues
- Minor improvements
- Migrated to null safety
borderRadius
giving it zero has some issue which is fixedremoveElevation
new param added
- Flutter V2 support upgradation
Border Radius
,Color
,Box shadow
, are now customizable.
- Twitter posts are private, so added default twitter image for the same
- Adjustment of UI
- Added the list of apps that are already using this package
- Images added to readme file
- Package is linked to the git repo & homepage url is updated
- Parse your web URL's & show preview with in your application