flutter_link_preview 1.2.9

  • Readme
  • Changelog
  • Example
  • Installing
  • 88

flutter_link_preview #

This is a URL preview plugin that previews the content of a URL

Language: English | 中文简体

Demo

Gif

Special feature #

  • Result caching and expiration mechanism for faster return of results
  • Better fault tolerance, multiple ways to find icons
  • Better support for Chinese, no garbled code
  • Support GIF and other image previews

Getting Started #

FlutterLinkPreview(
    url: "https://github.com",
    titleStyle: TextStyle(
        color: Colors.blue,
        fontWeight: FontWeight.bold,
    ),
)

Result:

Result Image

You can also use builder to display custom styles

Click here for a detailed example.

[1.2.9] - 2020-6-28. #

  • Addition of open source agreements

[1.2.8] - 2020-6-18. #

  • Fix some warnings

[1.2.6] - 2020-6-10. #

  • Adding Adaptation to Video
  • Improved analytical performance

[1.2.4] - 2020-5-30. #

  • Images are displayed using CachedNetworkImage
  • Fix possible errors when destroyed

[1.2.2] - 2020-5-27. #

  • New image display that can be used to display gifs
  • Enhancing title and description access

[1.1.2] - 2020-5-17. #

  • Enhanced compatibility and error alerts

[1.1.1] - 2020-5-16. #

  • Update notes

[1.1.0] - 2020-5-16. #

  • Optimization code
  • Add notes

[1.0.0] - 2020-5-15. #

  • Caching mechanism to return results faster
  • Better fault tolerance
  • Support Chinese no mess code

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key key}) : super(key: key);

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  TextEditingController _controller;
  @override
  void initState() {
    _controller = TextEditingController(text: "https://www.baidu.com");
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.all(15),
          child: Column(
            children: <Widget>[
              Row(
                children: <Widget>[
                  Expanded(
                    child: TextField(
                      controller: _controller,
                    ),
                  ),
                  RaisedButton(
                    onPressed: () {
                      setState(() {});
                    },
                    child: const Text("get"),
                  ),
                ],
              ),
              const SizedBox(height: 15),
              ConstrainedBox(
                constraints: const BoxConstraints(maxHeight: 500),
                child: FlutterLinkPreview(
                  url: _controller.value.text,
                  key: ValueKey(_controller.value.text),
                  titleStyle: TextStyle(
                    color: Colors.blue,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_link_preview: ^1.2.9

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:flutter_link_preview/flutter_link_preview.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
75
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]
88
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Android

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_io.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/cache_manager.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: Linux

Package does not support Flutter platform Linux

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_io.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/web/web_helper.dart that imports:
  • package:flutter_cache_manager/src/cache_store.dart that imports:
  • package:sqflite/sqflite.dart that declares support for platforms: Android, iOS, macOS

Package does not support Flutter platform Web

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_web.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/web/web_helper.dart that imports:
  • package:flutter_cache_manager/src/cache_store.dart that imports:
  • package:sqflite/sqflite.dart that declares support for platforms: Android, iOS, macOS

Package does not support Flutter platform Windows

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_io.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/web/web_helper.dart that imports:
  • package:flutter_cache_manager/src/cache_store.dart that imports:
  • package:sqflite/sqflite.dart that declares support for platforms: Android, iOS, macOS

Package does not support Flutter platform iOS

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_io.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/cache_manager.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: Linux

Package does not support Flutter platform macOS

Because:

  • package:flutter_link_preview/flutter_link_preview.dart that imports:
  • package:cached_network_image/cached_network_image.dart that imports:
  • package:cached_network_image/src/image_provider/cached_network_image_provider.dart that imports:
  • package:cached_network_image/src/image_provider/_image_provider_io.dart that imports:
  • package:flutter_cache_manager/flutter_cache_manager.dart that imports:
  • package:flutter_cache_manager/src/cache_manager.dart that imports:
  • package:path_provider/path_provider.dart that imports:
  • package:path_provider_linux/path_provider_linux.dart that declares support for platforms: Linux

Package not compatible with SDK dart

Because:

  • flutter_link_preview that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
cached_network_image ^2.2.0+1 2.2.0+1 2.3.0-rc
flutter 0.0.0
html ^0.14.0+3 0.14.0+3
http ^0.12.1 0.12.1
Transitive dependencies
charcode 1.1.3
clock 1.0.1
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
file 5.2.1
flutter_cache_manager 1.4.1
http_parser 3.1.4
intl 0.16.1
meta 1.1.8 1.2.2
path 1.7.0
path_provider 1.6.11
path_provider_linux 0.0.1+2
path_provider_macos 0.0.4+3
path_provider_platform_interface 1.0.2
pedantic 1.9.0 1.9.2
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
rxdart 0.24.1
sky_engine 0.0.99
source_span 1.7.0
sqflite 1.3.1
sqflite_common 1.0.2+1
string_scanner 1.0.5
synchronized 2.2.0+1
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
uuid 2.2.0
vector_math 2.0.8 2.1.0-nullsafety
xdg_directories 0.1.0