markdown_editor_plus
एक TextField विजेट जो आपको आसानी से TextField में क्या है, उसे मार्कडाउन में बदलने की अनुमति देता है और कस्टम टूलबार समर्थन के साथ।
फ्लटर के लिए मार्कडाउन संपादक और पूर्वावलोकन
{"sdk":"flutter"}^5.0.1^7.2.2^0.7.2+1^10.7.0{"sdk":"flutter"}^4.0.0यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This is a fork of simple_markdown_editor by zahnia88 with contributions from fossfreaks
Simple markdown editor library For flutter. For demo video, you can see it at this url Demo
Add dependencies to your pubspec.yaml
dependencies:
markdown_editor_plus: ^latest
Run flutter pub get to install.
Import library
import 'package:markdown_editor_plus/markdown_editor_plus.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();
Show widget for editor
// editable text with toolbar by default
MarkdownAutoPreview(
controller: _controller,
emojiConvert: true,
)
// editable text without toolbar
MarkdownField(
controller: _controller,
emojiConvert: true,
enableToolBar: false,
)
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
},
)
In order to set the colors
MarkdownAutoPreview(
controller: _controller,
enableToolBar: true,
emojiConvert: true,
autoCloseAfterSelectEmoji: false,
// toolbar's background color, text color will be based on theme
toolbarBackground: Colors.blue,
// toolbar's expandable widget colors like headings, ordering
expandableBackground: Colors.blue[200],
)