Flutter package to show url preview
This shows url preview of a URL. (Now migrated to null-safety).
Currently only supports Open Graph Protocol
Please use latest version of the package.
Add simple_url_preview to pubspec.yaml, and hit command 'flutter pub get'
dependencies:
...
simple_url_preview: ^3.0.1
SimpleUrlPreview(
url: 'https://pub.dev/',
),
SimpleUrlPreview(
url: 'https://pub.dev/',
previewHeight: 200,
previewContainerPadding: EdgeInsets.all(10),
),
Default bgColor = Theme.of(context).primaryColor
SimpleUrlPreview(
url: 'https://pub.dev/',
bgColor: Colors.red,
),
Default titleStyle = TextStyle( fontWeight: FontWeight.bold, fontSize: 16, color: Theme.of(context).accentColor )
Default descriptionStyle = TextStyle( fontSize: 14, color: Theme.of(context).accentColor )
Default siteNameStyle = TextStyle( fontSize: 14, color: Theme.of(context).accentColor )
SimpleUrlPreview(
url: 'https://pub.dev/',
titleStyle: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
descriptionStyle: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor,
),
siteNameStyle: TextStyle(
fontSize: 14,
color: Theme.of(context).primaryColor,
),
),
SimpleUrlPreview(
url: 'https://pub.dev/',
isClosable: true,
),
Default and maximum title lines = 2 and description lines = 3.
SimpleUrlPreview(
url: 'https://pub.dev/',
titleLines: 1,
descriptionLines: 2,
imageLoaderColor: Colors.white,
),
By Default, will open URL in default browser.
SimpleUrlPreview(
url: 'https://pub.dev/',
onTap: () => print('Hello Flutter URL Preview'),
),
Would ❤️ to see any contributions.
If you liked my work, show some ❤️ by ⭐ repo.
Also you can appreciate by