ryzizub / flutter_link_previewer

URL preview extracted from the provided text with basic customization and ability to render from cached data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter Link Previewer

Pub build CodeFactor

URL preview extracted from the provided text with basic customization and ability to render from cached data.


๐Ÿ‡บ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡ฆ 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

URL preview extracted from the provided text with basic customization and ability to render from cached data.

License:MIT License


Languages

Language:Dart 36.1%Language:C++ 29.3%Language:CMake 24.9%Language:Ruby 3.7%Language:HTML 2.5%Language:C 2.0%Language:Swift 1.4%Language:Kotlin 0.2%Language:Objective-C 0.1%