搜索插件、代码仓与 APP 分类

GitHub 代码仓AnupKumarPanwar/Linkable

可链接

一个 Flutter 小部件,可动态向您的文本添加链接。

可链接 项目封面
星标
17
复刻
20
最近推送(UTC)
2025年11月20日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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:

  • Web URL (https://www.github.com/anupkumarpanwar)
  • Emails (mailto:1anuppanwar@gmail.com)
  • Phone numbers (tel:+918968894728)

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: ^4.0.0
  url_launcher: ^6.1.14
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>
iOS

Add the LSApplicationQueriesSchemes entries in your Info.plist file.

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>tel</string>
</array>

Usage

Basic
import 'package:linkable/linkable.dart';

Linkable(
	text:
	"Hi!\nI'm Anup.\n\nYou can email me at 1anuppanwar@gmail.com.\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

Anup Kumar Panwar GitHub avatar
GitHub 作者

Anup Kumar Panwar ↗

Founder of The Algorithms | Software Engineer @ Zepto | ex-Product Engineer @ Gojek | Google Summer of Code 2018

@TheAlgorithms @Gojek @ZeptonowBanaglore | Chandigarh (India)官方网站 ↗
语言C++CMakeDartRubySwiftCHTMLKotlinObjective-C

分类

此仓库发布的插件

使用的依赖

依赖清单 4 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗