linkify_text 0.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 72

LinkifyText #

LinkifyText Widget allows to highlight links in Text. It further allow navigation, link opening on browser, on tapping highlighted link.

Code Example #

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(

        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child:
        LinkifyText(

          //String literal that may contain link
          "Please visit google.com",

          //color for all non link text
          textColor: Colors.black,

          //color to highlight link
          linkColor: Colors.blue,

          //font size
          fontSize: 20,

          //font weight of the text
          fontWeight: FontWeight.w500,

          //font family of the text
          fontFamily: "Roboto",

          //To enable navigation on tapping on highlighted link
          isLinkNavigationEnable: true,
        ),
      ),
    );
  }
}

Image #

Screenshot_1582176175

[0.0.1] - 20-Feb-2020. #

  • TODO: Describe initial release.

[0.0.2] - 20-Feb-2020. #

[0.0.3] - 20-Feb-2020. #

[0.0.4] - 20-Feb-2020. #

[0.0.5] - 20-Feb-2020. #

[0.0.6] - 25-Feb-2020. #

[0.0.7] - 30-March-2020. #

  • TODO: Updated the version of Url Launcher

example/example.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: LinkifyText(
          "please visit google.com",
          fontSize: 15.0,
          linkColor: Colors.blue,
          textColor: Colors.black,
          fontWeight: FontWeight.w500,
          isLinkNavigationEnable:
              true, //By Default it is true. If it is false, user would not navigate to the link on tapping
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  linkify_text: ^0.0.7

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:linkify_text/linkify_text.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
72
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:linkify_text/linkify_text.dart, package:url_launcher/url_launcher.dart] that declares support for platforms: android, ios, macos, web

Package does not support Flutter platform windows

Because of import path [package:linkify_text/linkify_text.dart, package:url_launcher/url_launcher.dart] that declares support for platforms: android, ios, macos, web

Package not compatible with SDK dart

because of import path [linkify_text] that is in a package requiring null.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
url_launcher ^5.4.2 5.4.11
Transitive dependencies
collection 1.14.12 1.14.13
flutter_web_plugins 0.0.0
meta 1.1.8
platform_detect 1.4.0
plugin_platform_interface 1.0.2
pub_semver 1.4.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
url_launcher_macos 0.0.1+7
url_launcher_platform_interface 1.0.7
url_launcher_web 0.1.2
vector_math 2.0.8
Dev dependencies
flutter_test