rich_link_preview 0.1.4

rich_link_preview #

A Rich Link Preview widget written in Dart generating a rich presentation of the given link from social meta tags.

Getting Started #

Add the following line in your pubspec file #

rich_link_preview:

Get the package by running the command #

flutter packages get

Include the widget in your dart file #

import 'package:rich_link_preview/rich_link_preview.dart';

Example Usage: #

RichLinkPreview(
    link: 'https://ourland.hk/detail/72e1aeaf-360b-4f45-a528-ef1c5e4d803c',
    appendToLink: true,
)

image

RichLinkPreview(
    link: 'https://ourland.hk/detail/72e1aeaf-360b-4f45-a528-ef1c5e4d803c'
),

image

Parameters #

ParameterTypeDescriptionExampleRequired?Default
linkStringLink to be previewedhttps://ourland.hk/detail/72e1aeaf-360b-4f45-a528-ef1c5e4d803cN''
heightdoubleHeight of the Rich Link Preview container150.0N100.0
borderColorColorColor of the container borderColor(0xFF000000)NColor(0xFFE0E0E0)
backgroundColorColorColor of the container backgroundColor(0xFF000000)NColor(0xFFE0E0E0)
textColorColorColor of the textColor(0xFFE0E0E0)NColor(0xFF000000)
appendToLinkboolappend the preview to linkfalseNfalse
launchFromLinkboolLaunch from the link for container with appendToLink: truefalseNtrue

CHANGELOG #

0.1.4 #

  • Added launchFromLink option

0.1.3 #

  • Fixed memory leak & failure of displaying widget after setting state issue
  • Reset the link value for appendToLink is false only

0.1.2 #

  • Resolved wrong package deployed on Pub

0.1.1 #

  • Added textColor option
  • Revamped container structure

0.1.0 #

  • Initial version, created by wingkwong

example/README.md

Rich Link Preview Example #

RichLinkPreview(
    link: 'https://ourland.hk/detail/72e1aeaf-360b-4f45-a528-ef1c5e4d803c',
    appendToLink: true,
)

image

RichLinkPreview(
    link: 'https://ourland.hk/detail/72e1aeaf-360b-4f45-a528-ef1c5e4d803c',
    borderColor: Color(0xFFE0E0E0),
    backgroundColor: Color(0xFFE0E0E0)
),

image

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  rich_link_preview: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:rich_link_preview/rich_link_preview.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Aug 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
open_graph_parser ^0.0.4 0.0.6
url_launcher ^5.0.0 5.1.2
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11 1.14.12
csslib 0.15.0 0.16.1
html 0.13.4+2 0.14.0+2
http 0.12.0 0.12.0+2
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.4
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
vector_math 2.0.8