simple_link_preview
2.1.0, released 2 months ago by an unverified publisher
Fetch lightweight link preview metadata from HTTP and HTTPS URLs.
What it does
SimpleLinkPreview fetches and parses HTML metadata from the document head, direct images, and other web content types without downloading entire bodies. It handles redirects, custom timeouts, status validation, and relative URL resolution.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display link previews or Open Graph cards in your app.
- You want to extract titles, descriptions, icons, and images from web pages efficiently.
Skip it when
- You need to scrape full HTML documents and inspect body elements.
- You need a full embedded web browser view.
Strengths
- Lightweight and stops reading HTML as soon as the closing head tag or 1MB limit is reached.
- Supports direct images and various successful MIME types.
- Provides structured error handling and options like timeout and redirect limits.
Weaknesses
- Subject to target server's CORS policy on web platforms.
- Does not inspect <img> elements in the document body or make separate favicon requests.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
not documented
Future<void> main() async {
final preview = await SimpleLinkPreview.getPreview(
'https://pub.dev/',
);
print(preview?.toJson());
}Alternatives
Packages that do the same job and could replace simple_link_preview.
- google_vision
Integrates Google Vision REST API features for image analysis and OCR.
65Compare - direct_link
Extracts direct media links from supported URLs for streaming or downloading
52Compare
Works with
Packages commonly used together with simple_link_preview: ones it builds on, ones built on it, and its own family.