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

markdown_editable_textinput 封面
套件詳情v2.2.0

markdown_editable_textinput

一個 TextField 小部件,可讓您輕鬆將 TextField 中的內容轉換為 Markdown。

近 30 天下載
454
喜歡數
191
Pub 分數
60

安裝套件

flutter pub add markdown_editable_textinput

套件介紹

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

一個 Flutter TextField 小部件,旨在無縫將文字輸入轉換為 Markdown 格式。它允許使用者直接鍵入內容,同時自動套用 Markdown 語法,非常適合輕量級筆記或具備豐富文字格式的內容創作。該套件可順暢整合至表單與編輯器中,提供即時 Markdown 顯示,無需複雜設定。以簡潔與易用性為設計核心,透過直覺的鍵盤捷徑或手動標籤支援常見的 Markdown 功能,例如粗體、斜體、標題與清單。非常適合尋求簡潔卻強大 Markdown 輸入解決方案的開發者。

適用情境

  • 簡單的筆記應用
  • 基於 Markdown 的內容創作
  • 帶富文本格式的表單輸入
  • 輕量級部落格編輯器
  • 即時 Markdown 預覽

主要特色

  • 即時 Markdown 轉換
  • 直觀的鍵盤捷徑
  • 支援常見的 Markdown 語法
  • 最小化設定和整合
  • 簡潔、聚焦的使用者介面設計

適合對象

  • 開發輕量級編輯器的開發者
  • 需要基本 Markdown 輸入的應用程式
  • 帶有文字格式化的教育工具
  • 使用 Markdown 的內容創作者
  • 優先考慮簡單性而非複雜性的專案

使用建議

  • 僅限基本 Markdown 功能
  • 無內建預覽渲染
  • 不適用於進階 Markdown 解析
  • 需要手動處理複雜的格式
  • 如果需要預覽,則依賴外部 Markdown 渲染

原始 README

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

Build Status pub package codecov

markdown_editable_textinput

MarkdownEditableTextInput is a TextField Widget that allow you to convert easily what's in the TextField to Markdown.

Features

  • [x] Convert to Bold, Italic, Strikethrough
  • [x] Convert to Code, Quote, Links
  • [x] Convert to Heading (H1, H2, H3, H4, H5, H6) and Links
  • [x] Support text direction
  • [x] Dialog mode to enter link and picture
  • [x] Possibility to add custom buttons to the action bar

Demo

Link by Dialog demo

Usage

The color of the MarkdownTextInput is defined by the color set in your Theme :

  • primaryColor: Cursor's color
  • colorScheme.secondary: MarkdownTextInput's borders
  • cardColor: Background color of MarkdownTextInput
Attributes
Attributes Example Value Description
Function onTextChanged Callback used to retrieve the text in parent's Widget
String initialValue "Lorem Ipsum" Display an initial value in MarkdownTextInput's field
Function validators Add validators to the MarkdownTextInput
String label "Description" Display a label in MarkdownTextInput
TextDirection textDirection TextDirection.rtl Change text direction
int maxLines 3 The maximum of lines that can be display in the input
List actions [MarkdownType.bold, MarkdownType.italic] Actions the editor will handle
TextEditingController controller TextEditingController() Pass your own controller. Can be used to clear the input for example
TextStyle textStyle Theme.of(context).textTheme.bodyText2 Overrides input text style
bool insertLinksByDialog; true Choose to use dialog or not to insert link
bool insertImageByDialog; true Choose to use dialog or not to insert an image
bool insertImageByDialog; true Choose to use dialog or not to insert an image
bool customCancelDialogText; String? Text used by dialog for close dialog action
bool customSubmitDialogText; String? Text used by dialog for validate dialog action
Example

You can see an example of how to use this package here

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案