md_editor 0.1.3
md_editor: ^0.1.3 copied to clipboard
md_editor is a Flutter widget that provides an integrated Markdown editing experience. It features a built-in toolbar for formatting markdown content seamlessly.
Markdown Editor #
A simple and customizable Markdown text editor for Flutter.
Features #
- Live preview of Markdown
- Customizable toolbar
- Easy integration
Installation #
Add the package to your pubspec.yaml
:
dependencies:
md_editor: ^latest_version
Run flutter pub get
to install.
Usage #
Import the package:
import 'package:md_editor/md_editor.dart';
Use the editor widget in your app:
Important
if editable
is set true, you must provide onTextChanged
function.
MdEditor(
content: '# Hello Markdown!',
editable: true,
onTextChanged: (text) {
// Handle text changes
},
)
Example #
import 'package:flutter/material.dart';
import 'package:md_editor/md_editor.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Markdown Editor')),
body: MdEditor(
content: '# Markdown Editor'
),
),
);
}
}
Documentation #
See the API reference for more details.
License #
This project is licensed under the MIT License.