novel_editor 0.2.0
novel_editor: ^0.2.0 copied to clipboard
Novel for Flutter. A drop-in WYSIWYG editor with AI autocomplete, slash commands, floating toolbar, and markdown serialization. One widget. Full editor.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:novel_editor/novel_editor.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'lifeos_editor',
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(useMaterial3: true),
home: const Demo(),
);
}
}
class Demo extends StatelessWidget {
const Demo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: NovelEditor(
initialContent: '''# Welcome to lifeos_editor
A market-ready rich text editor for Flutter.
## Features
- **Bold**, *italic*, ~~strikethrough~~, and `inline code`
- Headings, bullet lists, numbered lists, to-do lists
- Code blocks, blockquotes, dividers
- Slash commands — type `/`
- Floating toolbar on text selection
- Markdown import/export
## Try it
1. Select text to see the floating toolbar
2. Type `/` for slash commands
3. Use **Cmd+B** for bold, **Cmd+I** for italic
> This is a blockquote.
---
- [x] WYSIWYG editing
- [x] Slash commands
- [ ] Your feature here
''',
onChanged: (md) => debugPrint('Content: ${md.length} chars'),
),
);
}
}