搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。