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

quick_text 封面
套件詳情v1.0.3

quick_text

一個用於簡化文字格式化的 Flutter 套件,支援類似 Markdown 的語法。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
120
喜歡數
6
Pub 分數
160

安裝套件

flutter pub add quick_text

套件介紹

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

QuickText 是一個 Flutter 套件,透過類似 Markdown 的語法簡化文字格式化,讓開發者能以最少的程式碼來設定文字樣式。它支援常見的格式選項,如粗體、斜體、底線和顏色,並使用直覺的語法。非常適合在應用程式中顯示豐富文字,而不需完整 Markdown 解析器的複雜性,可無縫整合至 Android、iOS、Web、macOS、Windows 及 Linux。此套件提升使用者介面中樣式文字的可讀性與可維護性。

適用情境

  • 在應用 UI 中顯示格式化內容
  • 建立豐富文字訊息
  • 簡化聊天應用中的文字樣式
  • 渲染文件片段
  • 建構動態文字小工具

主要特色

  • Markdown-like syntax
  • 跨平台支援
  • 輕鬆整合
  • Lightweight
  • 支援顏色與樣式
  • 最小化樣板程式碼

適合對象

  • 尋求簡單文字格式化的開發者
  • 具有豐富文本需求的應用程式
  • 需要樣式化文本的UI組件
  • 快速原型化使用者介面變更
  • 避免使用大型 Markdown 庫的項目

使用建議

  • 僅限基本格式
  • 不適合複雜的 Markdown
  • 需要仔細處理語法
  • 不支援進階HTML標籤
  • 可能需要自定擴展以滿足特殊用途

原始 README

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

QuickText

QuickText is a Flutter package that simplifies text formatting with markdown-like syntax. It allow you to easily apply styles like bold, italic, underline, strikethrough color and links directly within a string, without the need to manually construct complex TextSpan trees. Similiar usage like Text widget.

Key Features

  • Simplified Syntax: Style your text with symbols like **bold**, *italic*, _underline_, ~strikethrough~, [colored](red), [colored](#FF0000) and [link](https://example.com).
  • Enhanced Readability: Clean and easy-to-read code, reducing the verbosity of RichText and TextSpan.
  • Customizable Styles: Includes options for text alignment, overflow, max lines, and more, providing the same flexibility as traditional Flutter text widgets.
  • Built-in Color Support: Apply named colors (like red, blue, etc.) or hex colors (e.g., #FF0000 for red) directly within your text string.
  • Link Support: Easily add links that open in the browser when tapped.

Why Use QuickText?

  • Time-Saving: Quickly format text without the hassle of constructing text spans.
  • User-Friendly: Ideal for developers who want rich text features without the complexity.
  • Rich Functionality: Despite its simplicity, QuickText supports a wide range of text styling options.

Sample Code

Here's how you can use QuickText in your Flutter app:


// Bold

QuickText(
  'This is **bold** text.',
),

// Italic

QuickText(
  'This is *italic* text.',
),

// Underline

QuickText(
  'This is _underline_ text.',
),

// Strikethrough

QuickText(
  'This is ~strikethrough~ text.',
),

// Using named colors

QuickText(
  'This is [colored](red) text.',
),

// Using hex colors

QuickText(
  'This is [colored](#FF0000) text.',
),

// links

QuickText(
  'This is [link](https://example.com).',
),

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  quick_text: ^latest_version

Then run:

flutter pub get

Finally, import the package in your Dart code:

import 'package:quick_text/quick_text.dart';

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。