Skip to content

Commit

Permalink
Readme added
Browse files Browse the repository at this point in the history
  • Loading branch information
Voidozzer committed Feb 12, 2021
1 parent e68c40c commit 05b4696
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.9

- Readme added

## 0.0.8

- Dependency update
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Oleksandr Demchenko
Copyright (c) 2021 Oleksandr Demchenko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,62 @@
# Flutter Link Preview

URL preview with basic customization and ability to render from cached data

![Demo](images/flutter_link_previewer.png)

## Getting Started

```dart
LinkPreview(
onPreviewDataFetched: _onPreviewDataFetched,
text: 'instagram.com',
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,
text: "Your text with link here",
textStyle: style,
width: width,
);
```

## Render from cached data

Store data you get in `onPreviewDataFetched` callback, then

```dart
LinkPreview(
previewData: _cachedData,
text: 'instagram.com',
width: MediaQuery.of(context).size.width,
)
```

## License

[MIT](LICENSE)
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class HomePage extends StatelessWidget {
text: 'instagram.com',
width: MediaQuery.of(context).size.width,
),
)
),
],
),
),
Expand Down
Binary file added lib/src/images/flutter_link_previewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_link_previewer
description: Flutter Link Previewer
version: 0.0.8
version: 0.0.9
homepage: https://github.com/flyerhq/flutter_link_previewer

environment:
Expand Down

0 comments on commit 05b4696

Please sign in to comment.