Skip to content
pubscout

any_link_preview

3.0.3, released 2 years ago by suresh-konakanchi.in

A Flutter widget that fetches and displays web link previews with customization and caching.

WASM-ready
$ flutter pub add any_link_preview
Source repository

What it does

The package parses a URL to extract metadata using HTML, Open Graph, JSON‑LD and Twitter Card parsers. It then renders a customizable preview card and caches the metadata for faster subsequent loads.

AI-written summary of version 3.0.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Displaying link previews in chat or messaging UIs
  • Needing a highly customizable preview widget with optional image/SVG support
  • Wanting built‑in caching of metadata

Skip it when

  • Server‑side rendering or non‑Flutter environments
  • Complex backend data aggregation beyond simple link metadata
  • When you need fine‑grained network control beyond the provided fetch logic

Strengths

  • Extensive customization of appearance and behavior
  • Supports SVG images and custom User‑Agent strings
  • Built‑in caching with configurable TTL
  • Robust error handling and placeholder widgets

Weaknesses

  • Limited to Flutter apps; not a pure networking library
  • Caching relies on shared_preferences which may not suit all storage needs
  • May require tweaking User‑Agent or proxy for some sites

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
7

Add the dependency, import the package, ensure internet permission on Android/iOS (default), optionally configure shared_preferences for caching

AnyLinkPreview(
  link: "https://example.com",
  displayDirection: UIDirection.uiDirectionHorizontal,
  showMultimedia: true,
);

Alternatives

Packages that do the same job and could replace any_link_preview.

Works with

Packages commonly used together with any_link_preview: ones it builds on, ones built on it, and its own family.