Skip to content

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

License

Notifications You must be signed in to change notification settings

kbrmimbyl/flutter_link_previewer

 
 

Repository files navigation

Flutter Link Previewer

Pub build CodeFactor

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

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 45.0%
  • C++ 29.6%
  • CMake 13.9%
  • HTML 6.8%
  • Ruby 2.4%
  • C 1.3%
  • Other 1.0%