-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.9 | ||
|
||
- Readme added | ||
|
||
## 0.0.8 | ||
|
||
- Dependency update | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
 | ||
|
||
## 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters