link_previewer 1.1.0

link_previewer #

A new Flutter package. Build container with image, title, description from web-site (link) will be provided.

Getting Started #

alt text

Installing #

Use this package as a library

  1. Depend on it

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

dependencies:
  link_previewer: ^1.0.4
  1. 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.

  1. Import it

Now in your Dart code, you can use:

import 'package:link_previewer/link_previewer.dart';

Usage #

Widget build() {
  return Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.horizontal,
      ),
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.vertical,
      ),
    ],
  );
}

Properties (Constructor props) #

PropNameValueDefinition
linkString value (Ex: "http://...")Link to website will be shown as LinkPreviewer
titleFontSizedouble (default: 15, but it's auto resizable depends on layout(parent) width or hight)Title font size
bodyFontSizedouble (default: 14, but it's auto resizable depends on layout(parent) width or hight)Body font size
backgroundColorColor (default: Colors.white)Background color in case there will be not much text and will be whitespace
borderColorColor (default: Colors.deepOrangeAccent)Border color of the previewer
borderRadiusdouble (default: 3.0)Border radius
directionContentDirection from the package (default: ContentDirection.horizontal) Options: 1. ContentDirection.horizontal 2. ContentDirection.verticalContent direction (image -> title -> body)

From version 1.1.0 #

PropNameValueDefinition
placeholderWidgetCustom placeholder while data is loading
defaultPlaceholderColorColor (default: light-grey)If placeholder is not set, will be used the default one and its color can be set using this prop (empty container with background)
showTitlebool (default: true)Title can be hiden using this prop, if it set to false
showBodybool (default: true)Body can be hiden using this prop, if it set to false

[1.0.5]

Width and Height now depends on parent size #

Font sizes pretty much auto resizable #

Image is auto resizable #

[1.1.0]

Added default placeholder - if data is not loaded there is a placeholder (grey container). #

There is option to add a custom placeholder: Ex: LinkPreviewer(placeholder: Container()) #

Resolved bug with images where http..(host) was always added to image uri #

Added new properties: #

1. showTitle - false or true (default) - allows to hide title #

2. showBody - false or true (default) - allows to hide body #

example/example.dart

import 'package:flutter/material.dart';
import 'package:link_previewer/link_previewer.dart';

Widget build() {
  return Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.horizontal,
      ),
      LinkPreviewer(
        link: "https://www.linkedin.com/feed/",
        direction: ContentDirection.vertical,
      ),
    ],
  );
}

Use this package as a library

1. Depend on it

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


dependencies:
  link_previewer: ^1.1.0

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:link_previewer/link_previewer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
39
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]
69
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.1.0 <3.0.0
async ^2.0.8 2.3.0
flutter 0.0.0
html ^0.14.0+2 0.14.0+2
http ^0.12.0+2 0.12.0+2
url_launcher ^5.1.1 5.1.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
csslib 0.16.1
http_parser 3.1.3
meta 1.1.6 1.1.7
path 1.6.4
pedantic 1.8.0+1
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
vector_math 2.0.8
Dev dependencies
flutter_test