flutter_linkify 1.0.4 copy "flutter_linkify: ^1.0.4" to clipboard
flutter_linkify: ^1.0.4 copied to clipboard

outdated

Turns text URLs into clickable inline links in text for Flutter.

flutter_linkify pub package #

Turns text URLs into clickable inline links in text for Flutter.

Pub - API Docs - GitHub

Install #

Install by adding this package to your pubspec.yaml:

dependencies:
  flutter_linkify: 1.0.4

It is highly recommend that you also add a dependency on url_launcher to open links in the browser.

Usage #

Basic:

import 'package:flutter_linkify/flutter_linkify.dart';

Linkify(
  onOpen: (url) => print("Clicked $url!"),
  text: "Made by https://cretezy.com",
);

Add a style to non-links (yellow) or links (red), and open in browser using url_launcher:

import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:url_launcher/url_launcher.dart';

Linkify(
  onOpen: (url) async {
    if (await canLaunch(url)) {
        await launch(url);
      } else {
        throw 'Could not launch $url';
      }
  },
  text: "Made by https://cretezy.com",
  style: TextStyle(color: Colors.yellow),
  linkStyle: TextStyle(color: Colors.red),
);

Full example can be found at example/lib/main.dart.

Example Screenshot

744
likes
0
pub points
99%
popularity

Publisher

verified publishercretezy.com

Turns text URLs into clickable inline links in text for Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_linkify