Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flyerhq/flutter_link_previewer
Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
https://github.com/flyerhq/flutter_link_previewer
dart flutter flutter-package flutter-widget link-preview url-preview
Last synced: 28 days ago
JSON representation
Customizable link and URL preview extracted from the provided text with the ability to render from the cache. Ideal for chat applications.
- Host: GitHub
- URL: https://github.com/flyerhq/flutter_link_previewer
- Owner: flyerhq
- License: mit
- Created: 2020-11-26T12:57:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-12T05:32:52.000Z (5 months ago)
- Last Synced: 2024-09-28T12:20:14.359Z (about 1 month ago)
- Topics: dart, flutter, flutter-package, flutter-widget, link-preview, url-preview
- Language: Dart
- Homepage:
- Size: 1010 KB
- Stars: 72
- Watchers: 4
- Forks: 76
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Link Previewer
[![Pub](https://img.shields.io/pub/v/flutter_link_previewer)](https://pub.dartlang.org/packages/flutter_link_previewer)
[![build](https://github.com/flyerhq/flutter_link_previewer/workflows/build/badge.svg)](https://github.com/flyerhq/flutter_link_previewer/actions?query=workflow%3Abuild)
[![CodeFactor](https://www.codefactor.io/repository/github/flyerhq/flutter_link_previewer/badge)](https://www.codefactor.io/repository/github/flyerhq/flutter_link_previewer)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
```dart
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
```dart
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](LICENSE)