Skip to content
pubscout

link_preview_generator

1.2.0, released 5 years ago by an unverified publisher

A Flutter widget to convert web links into rich visual previews.

$ flutter pub add link_preview_generator
Source repository

What it does

Scrapes metadata from URLs to render customizable preview cards with titles, descriptions, and images. It also provides a function to extract page metadata manually for custom UI implementations.

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

Use it when

  • You want to display rich previews of URLs inside chat or feed apps.
  • You need customizable cards with image, title, and description generated from a link.

Skip it when

  • You need deep scraping of complex JavaScript-heavy web applications.
  • You are running on web and encounter CORS restrictions without using a proxy URL.

Strengths

  • Provides both a ready-to-use widget and a scraping function for custom UIs.
  • Supports customizable styling, caching duration, and fallback error states.
  • Cross-platform support across mobile and desktop.

Weaknesses

  • May require a proxy URL to resolve CORS issues when used on the web.
  • Relies on standard web meta tags, which may fail on sites without proper Open Graph tags.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
5
LinkPreviewGenerator(
    bodyMaxLines: 3,
    link: 'https://github.com/ghpranav/link_preview_generator',
    linkPreviewStyle: LinkPreviewStyle.large,
    showGraphic: true,
)

Alternatives

Packages that do the same job and could replace link_preview_generator.

Works with

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