this is auto generated from API :)
Go to file
iamstanlee 3a120d9eb1 docs: fix gif display on pub.dev 2021-06-04 10:05:02 -07:00
example docs: fix gif display on pub.dev 2021-06-04 10:05:02 -07:00
lib refactor: example app, docs: added gif 2021-06-04 06:24:35 -07:00
test test: use isTrue/isFalse matcher 2021-06-04 04:47:34 -07:00
.gitignore initial commit 2021-06-03 13:00:21 -07:00
.metadata initial commit 2021-06-03 13:00:21 -07:00
CHANGELOG.md docs: fix gif display on pub.dev 2021-06-04 10:05:02 -07:00
LICENSE initial commit 2021-06-03 13:00:21 -07:00
README.md docs: fix gif display on pub.dev 2021-06-04 10:05:02 -07:00
ezgif.com-gif-maker.gif refactor: example app, docs: added gif 2021-06-04 06:24:35 -07:00
pubspec.lock initial commit 2021-06-03 13:00:21 -07:00
pubspec.yaml docs: fix gif display on pub.dev 2021-06-04 10:05:02 -07:00

README.md

linkfy_text

A lightweight flutter package to linkify texts containing urls, emails and hashtags.

pub package

gif

Usage

To use this package, add linkfy_text as a dependency in your pubspec.yaml file.

Example:

// first import the package
import 'package:linkfy_text/linkify_text.dart';

Container(
    child: LinkifyText(
    "This text contains a url: https://flutter.dev",
    linkStyle: TextStyle(color: Colors.blue, fontSize: 16),
    onTap: (link) {
        /// do stuff with `link`
        },
    );
)

Be default, The above snippet would linkify all urls in the string, you can choose what type of link to linkify by passing the linkTypes parameter

Container(
    child: LinkifyText(
    "This text contains a url: https://flutter.dev and #flutter",
    linkStyle: TextStyle(color: Colors.blue, fontSize: 16),
    linkTypes: [LinkType.url, LinkType.hashtag]
    onTap: (link) {
        /// do stuff with `link` like
        /// if(link.type == Linktype.url) launchUrl(link.value);
        },
    );
)
Parameters Default Description
textStyle null Style applied to the text
linkStyle null Style applied to the linkified text, defaults to the textStyle
linkTypes LinkType.url A list of LinkTypes used to override the links to be linkified in the text either a hashtag, email or url.
onTap null Callback function with a Link paramater called when a link is pressed

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an [issue][issue].
If you fixed a bug or implemented a feature, please send a [pull request][pr].