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

套件詳情v0.2.0

simple_markdown_editor

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

近 30 天下載
55
喜歡數
33
Pub 分數
60

安裝套件

flutter pub add simple_markdown_editor

套件介紹

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

一個 Flutter 套件,提供了一個 TextField 小部件,旨在簡化 Markdown 內容的建立。它讓使用者可以直接在欄位中輸入文字,並立即將其轉換為格式化的 Markdown,非常適合輕量級筆記記錄或需要結構化文字的應用程式內容輸入。該套件與 Flutter 的 UI 系統無縫整合,著重於易用性,無需複雜的設定。

適用情境

  • 輕量級筆記應用
  • 簡單的部落格或日記條目表單
  • 移動應用中的基於Markdown的內容創建
  • 即時 Markdown 預覽整合
  • 表單中的使用者友善的文字格式化

主要特色

  • 易用的 Markdown 輸入文字方塊
  • 即時 Markdown 轉換
  • 最小化設定和組態
  • 簡潔、聚焦的 API,滿足基本 Markdown 需求
  • 與 Flutter 小部件的無縫整合

適合對象

  • 開發簡單文字編輯器的開發者
  • 需要快速 Markdown 支援的應用程式
  • 初學者 Flutter 開發者
  • 優先考慮簡單性而非進階功能的專案

使用建議

  • 僅限基本 Markdown 格式
  • 無內建預覽渲染
  • 不適合複雜的文件編輯
  • 不支援超出 Markdown 的豐富文字樣式
  • 缺少進階功能,例如語法強調或匯出選項

原始 README

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

simple_markdown_editor

Support Me Support Me GitHub stars undo GitHub

Simple markdown editor library For flutter. For demo video, you can see it at this url Demo

What's new (21/01/2022)

  • Auto preview if editor unfocused, request from issue #4

Features

  • [x] Convert to Bold, Italic, Strikethrough
  • [x] Convert to Code, Quote, Links
  • [x] Convert to Heading (H1, H2, H3).
  • [x] Convert to unorder list and checkbox list
  • [x] Support multiline convert
  • [x] Support auto convert emoji

Usage

Add dependencies to your pubspec.yaml

dependencies:
    simple_markdown_editor: ^latest

Run flutter pub get to install.

How it works

Import library

import 'package:simple_markdown_editor/simple_markdown_editor.dart';

Initialize controller and focus node. These controllers and focus nodes are optional because if you don't create them, the editor will create them themselves

TextEditingController _controller = TextEditingController();
FocusNode _focusNode = FocusNode();

Show widget for editor

// editable text with toolbar
MarkdownFormField(
    controller: _controller,
    enableToolBar: true,
    emojiConvert: true,
    autoCloseAfterSelectEmoji: false,
)

// editable text without toolbar
MarkdownField(
    controller: _controller,
    emojiConvert: true,
)

if you want to parse text into markdown you can use the following widget:

String data = '''
**bold**
*italic*

#hashtag
@mention
'''

MarkdownParse(
    data: data,
    onTapHastag: (String name, String match) {
        // name => hashtag
        // match => #hashtag
    },
    onTapMention: (String name, String match) {
        // name => mention
        // match => #mention
    },
)

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。