A Flutter widget to dynamically add links to your text.

Overview

linkable pub package

A Flutter widget to add links to your text. By default, the Text or RichText widgets render the URLs in them as simple text which are not clickable. So, Linkable widget is a wrapper over RichText which allows you to render links that can be clicked to redirect to the URL. That means that a Linkable widget supports all the attributes of a RichText Widget.

Currently linkable supports the following types:

Note: You don't need to specify the URL scheme (mailto, tel etc). The widget will parse it automatically.

Install

To install the package, add the following dependency to your pubspec.yaml

dependencies:
  linkable: ^3.0.1
  url_launcher: ^6.0.9

Android

Starting from API30 (Android 11), your Android app has to list all apps it interacts with.

The following is required in AndroidManifest.xml or links will fail to launch.

<manifest>

    <!-- Nest within the manifest element, not the application element-->
    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.DIAL" />
            <data android:scheme="tel" />
        </intent>
        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="*/*" />
        </intent>
    </queries>

    <application>
        ....
    </application>
</manifest>

Usage

Basic

import 'package:linkable/linkable.dart';

Linkable(
	text:
	"Hi!\nI'm Anup.\n\nYou can email me at [email protected].\nOr just whatsapp me @ +91-8968894728.\n\nFor more info visit: \ngithub.com/anupkumarpanwar \nor\nhttps://www.linkedin.com/in/anupkumarpanwar/",
);

Attributes

Key Description
text The text to be displayed in the widget.
textColor Color of the non-link text. (default: black)
linkColor Color of the links. (default: blue)
style TextStyle to be applied on the widget.
textAlign TextAlign value. (default: TextAlign.start)
textDirection Determines the order to lay children out horizontally.
maxLines Maximum number of lines to be displayed.
textScaleFactor The number of font pixels for each logical pixel.

Screenshot

Screenshot

Comments
  • Phone number not parsed correctly

    Phone number not parsed correctly

    Just been trying to use this library but our phone number couldn't be parsed correctly. Pattern for parsing needs to be updated.

    Example: +49 123 456 7890

    creates the link: +49 123 456

    expected link: +49 123 456 7890

    opened by ZiPPSolutions 0
  • File extensions gets left out of links

    File extensions gets left out of links

    The regular expression for URL parsing doesn't seem to deal well with file extensions

    Example:

    https://api.flutter.dev/flutter/widgets/Focus-class.html

    creates the link

    https://api.flutter.dev/flutter/widgets/Focus-class

    opened by coupestartup 0
  • One length subdomain doesn't recognized.

    One length subdomain doesn't recognized.

    Hi! I am using your package and it is really good. I've faced a problem now, I have a subdomain with one length. I can't add to Linkable.

    for example: https://a.mywebsite.com/directory parsed as https://a. mywebsite.com/directory Only the second part is tappable.

    Could you fix the problem?

    Thank you :)

    opened by cyb3rsalih 0
  • Colon in URL is getting removed.

    Colon in URL is getting removed.

    I'm seeing that if I create a block of text that has http://or https:// or https://www. the : is getting removed so the URL will not load.

    If I just use www. it works fine.

    opened by lukeirvin 0
  • Non-Link Text Tappable

    Non-Link Text Tappable

    I'm using this text within a custom container/card and I'd like for the non-link text to be tappable as well.

    The idea is that a user can tap on the card to go into a detail page but if they tap on the link within that card, just direct them to the link source.

    Is this currently possible?

    opened by lukeirvin 0
  • Error when clicking on any link

    Error when clicking on any link

    Parsing seems to be working but I cant click on any link: thanks for your help

    [VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher_ios)

    opened by chrisvidal 1
  • Custom tap and regex support

    Custom tap and regex support

    Added support for:

    • telephone custom onTap;
    • link custom onTap;
    • email custom onTap;
    • telephone custom RegExp; Updated: -Updated variable and function typing in Linkable
    opened by eugenekan-dev 1
Releases(v1.0.4)
Owner
Anup Kumar Panwar
Founder of The Algorithms | ex-Product Engineer @ Gojek | Google Summer of Code 2018
Anup Kumar Panwar
Easy to use text widget for Flutter apps, which converts inlined urls into working, clickable links

LinkText Easy to use text widget for Flutter apps, which converts inlined URLs into clickable links. Allows custom styling. Usage LinkText widget does

Aleksander Woźniak 20 Nov 4, 2022
A Flutter plugin than allow expand and collapse text dynamically

readmore A Flutter plugin than allow expand and collapse text. usage: add to your pubspec readmore: ^1.0.2 and import: import 'package:readmore/readm

Jonny Borges 173 Dec 28, 2022
Dynamically translate text

auto_localization A new Flutter plugin. Flutter package to dynamically translate your app. This plugin will AUTOMATICALLY detect the app Localization

Matteo Sipione 5 Jan 27, 2022
Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

flutter_image_add_drag_sort Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort, support video fi

null 5 Jun 23, 2020
Masked text field - A flutter package for masked text field for formet your text and good UI

Masked Text Field Masked Text Field Features A package for masked text field for

Alok Dubey 7 Sep 4, 2022
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022
A Flutter package used to update widget tree dynamically

简体中文|English Fair is a lightweight package for Flutter, which can be used to update widget tree and state dynamically. This package is still at an ear

Wuba 1.8k Dec 30, 2022
Flutter dynamically load translation in your app.

Flutter dynamically load translation in your app.

null 1 Apr 4, 2022
An Instagram like text editor Flutter widget that helps you to change your text style.

TextEditor An instagram like text editor widget for flutter Show some ❤️ and star the repo to support the project Features Edit TextStyle object font

Mehdi Zarepour 68 Dec 16, 2022
A cross-platform flutter package to convert your links into rich beautiful previews.

Link Preview Generator A cross-platform flutter package to convert your links into rich beautiful previews. This package is inspired from Any Link Pre

Pranav Bedre 12 Oct 21, 2022
Simple Dart package for creating mailto links in your Flutter apps or web pages

mailto Simple Dart package for creating mailto links in your Flutter and Dart apps The mailto package helps you build mailto links and provides you wi

SMAHO Engineering OSS 21 Jul 8, 2022
Access links between your devices in real time!

Lineker Description Lineker allows you to manage links between your desktop and smartphone in real time, saving and deleting at any time. Create filte

Blackoutseeker 2 Aug 5, 2022
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Abdullah Chauhan 22 Dec 29, 2022
Dynamically themed Music Player built with flutter

?? Flutter Music Player Contact me email: [email protected] Gitter: https://gitter.im/Moda20TuneIn/community Thank you in advance ?? Getting Started

null 135 Dec 31, 2022
Grad text package - A Flutter Widget to draw gradients into text

grad_text A Flutter Widget to draw gradients into text.(Null safe) Demo Install

Karthik Sunil K 3 Jan 31, 2022
Polymaker is an application that can create polygon locations dynamically in mobile apps and save the data into SQFlite to be permanent.

Polymaker Polymaker is an application that can create polygon locations dynamically in mobile apps and save the data into SQFlite to be permanent. Ins

Yusril Rapsanjani 15 Apr 17, 2022
Tool made in Dart that allows you to dynamically generate JSON files from data models written in Dart.

Dart JSON Generator Versión v1.1.1 Dart JSON Generator es una herramienta que permite generar archivos JSON a partir de mapas como modelos de datos en

Joinner Medina 7 Nov 23, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
A flutter plugin to get facebook deep links and log app events using the latest Facebook SDK to include support for iOS 14

Facebook Sdk For Flutter LinkedIn GitHub facebook_sdk_flutter allows you to fetch deep links, deferred deep links and log facebook app events. This wa

Saad Farhan 23 Dec 17, 2022