パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリzahniar88/simple_markdown_editor

simple_markdown_editor

Flutter用のMarkdownエディタ

simple_markdown_editor のプロジェクト画像
スター
19
フォーク
64
最終プッシュ(UTC)
2024/07/15
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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
    },
)

Zahniar Adirahman GitHub avatar
GitHub 作者

Zahniar Adirahman ↗

Baturaja, Sumatera Selatan, Indonesia
言語DartHTMLRubySwiftKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 7 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗