カテゴリー・パッケージ・リポジトリを検索

GitHub リポジトリIamstanlee/linkfy_text

linkfy_text

URL、メールアドレス、ハッシュタグを含むテキストをリンク化するための軽量なFlutterパッケージ

linkfy_text のプロジェクト画像
スター
33
フォーク
36
最終プッシュ(UTC)
2024/05/29
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

linkfy_text

Lightweight flutter package that detects linkable patterns(urls, emails, hashtags, etc) in a text and makes them clickable. It also allows you to customize the style of the linkified text and the link itself. It also allows you to choose what type of link to linkify in a text.¬

pub package CI coverage Status

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),
    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),
    LinkTypes: [LinkType.url, LinkType.hashtag]
    onTap: (link) {
        /// do stuff with `link` like
        /// if(link.type == Link.url) launchUrl(link.value);
        },
    );
)

API Reference

LinkfyText
Parameter Type Description
textStyle TextStyle style applied to the text
linkStyle TextStyle style applied to the linkified text. defaults to textStyle
LinkTypes List<LinkType> a list of LinkType used to override the links to be linkified in a text either a url, hashtag or email. defaults to [LinkTypes.url]
onTap Function(Link) function called when a link is pressed
LinkType
Parameter Type Description
type Link the link type either url, email or hashtag, @mention
value String value the link holds

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.
If you fixed a bug or implemented a feature, please send a pull request.

TODO

  • LinkifyTextField widget
Stanley Akpama GitHub avatar
GitHub 作者

Stanley Akpama ↗

Software Engineer

言語DartC++CMakeRubySwiftHTMLCKotlinObjective-C

カテゴリー

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 5 件

  • platform^3.1.0
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}
  • test開発用^1.16.5
  • lint開発用^1.5.3

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

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

GitHub Docs — About repositories ↗