Skip to content

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.

License

Notifications You must be signed in to change notification settings

pnghai/flutter_link_previewer

 
 

Repository files navigation

Flutter Link Previewer

Pub build CodeFactor

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.


🇺🇦🇺🇦 We are Ukrainians. If you enjoy our work, please consider donating to help save our country. 🇺🇦🇺🇦


Getting Started

import 'package:flutter_link_previewer/flutter_link_previewer.dart';

LinkPreview(
  enableAnimation: true,
  onPreviewDataFetched: (data) {
    setState(() {
      // Save preview data to the state              
    });
  },
  previewData: _previewData, // Pass the preview data from the state
  text: 'https://flyer.chat',
  width: MediaQuery.of(context).size.width,
)

Customization

final style = TextStyle(
  color: Colors.red,
  fontSize: 16,
  fontWeight: FontWeight.w500,
  height: 1.375,
);


LinkPreview(
  linkStyle: style,
  metadataTextStyle: style.copyWith(
    fontSize: 14,
    fontWeight: FontWeight.w400,
  ),
  metadataTitleStyle: style.copyWith(
    fontWeight: FontWeight.w800,
  ),
  padding: EdgeInsets.symmetric(
    horizontal: 24,
    vertical: 16,
  ),
  onPreviewDataFetched: _onPreviewDataFetched,
  previewData: _previewData,
  text: 'https://flyer.chat',
  textStyle: style,
  width: width,
);

License

MIT

About

Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 35.0%
  • C++ 30.2%
  • CMake 24.5%
  • Ruby 3.7%
  • HTML 2.4%
  • Swift 2.1%
  • Other 2.1%