搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.3

custom_rich_text

一個自訂的富文字包,允許對文字進行強調和連結參考。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
135
喜歡數
36
Pub 分數
140

安裝套件

flutter pub add custom_rich_text

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可於文字中實現豐富的文字呈現,並支援自訂強調與可點擊的連結參考。它透過允許開發者在文字流程中嵌入互動元素(如強調關鍵字和超連結),擴展標準文字元件功能。非常適合顯示格式化內容,例如文章、聊天訊息或具有動態樣式與導航的文件。此套件支援多個平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。

適用情境

  • 顯示格式化文章
  • 建立互動式聊天訊息
  • 使用連結渲染文件
  • 在文字中強調關鍵字
  • 建構豐富的筆記應用

主要特色

  • 自定義文字強調
  • 可點擊的連結引用
  • 跨平台支援
  • 可擴充的文字樣式
  • 與現有組件的輕鬆整合

適合對象

  • 開發豐富文字 UI 的開發者
  • 需要互動式文字內容的應用程式
  • 內容密集型應用
  • 教育或文件平台
  • 聊天或訊息介面

使用建議

  • 需要仔細處理點按手勢
  • 複雜版面可能需要額外的樣式
  • 僅限基本超連結功能
  • 不適合用於功能完整的 WYSIWYG 編輯器
  • 大段文字帶來的效能影響

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Custom RichText

CustomRichText is a package that allows highlighting and link reference to the text.

Image Plugin

Key Features

  • Highlights email, phone number, web link, custom RegExp, certain sub-strings
  • Provides a call back on each highlighted string
  • Option for read more, read less and a call back for both
  • Allow text styling as per requirement

Note

  • If you want to highlight any specific type of text then need to add the following on tap method.
  • If any link or email consists the provided sub-string then it will ignore that and will be highlighted as web link or email.

Getting Started

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

dependencies:
  ...
  custom_rich_text: any

Now in your Dart code, you can use:

 import 'package:custom_rich_text/custom_rich_text.dart';

Usage

Example
CustomRichText(
  text: 'MindInventory is first-rate choice of the '
      'clients worldwide. With sheer customer satisfaction in mind, we are profoundly '
      'dedicated to developing highly intriguing apps that strictly meet the business '
      'requirements and catering a wide spectrum of projects. Kickstart Your Digital '
      'Journey Today and get all your queries and concerns answered by our business '
      'development team. Our email address is sales@mindinventory.com, our website '
      'https://www.mindinventory.com and our Contact number is +91-951-229-3490',
  caseSensitive: false,
  readMoreLessModel: ReadMoreLessModel(
    trimLines: 3,
    readMoreText: ' read more',
    readLessText: ' read less',
    readMoreLessStyle: kReadMoreLessStyle,
  ),
  textStyle: kTextStyle,
  linkStyle: kLinkStyle,
  highlightTermsStyle: kLinkStyle,
  onWebLinkTap: (web) async {
    await launch(web);
  },
  onPhoneTap: (phone) async {
    await launch('tel:$phone');
  },
  onEmailTap: (email) async {
    await launch('mailto:$email');
  },
  highlightTerms: [kMindinventory],
  onTermTap: (text) async {
    await launch('https://www.mindinventory.com/');
  },
),

Guideline for contributors

Contribution towards our repository is always welcome, we request contributors to create a pull request to the develop branch only.

Guideline to report an issue/feature request

It would be great for us if the reporter can share the below things to understand the root cause of the issue.

  • Library version
  • Code snippet
  • Logs if applicable
  • Device specification like (Manufacturer, OS version, etc)
  • Screenshot/video with steps to reproduce the issue

LICENSE!

Custom RichText is MIT-licensed.

Let us know!

We’d be really happy if you send us links to your projects where you use our component. Just send an email to sales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。