Docsy Toolbar

A customizable toolbar for the Docsy editor. It provides buttons for common editing actions and pairs with RichTextEditor.

Try it Live

Features

  • Bold, italic, and underline toggles
  • Insert and remove links
  • Insert headings, dividers, and code blocks
  • Undo and redo
  • Markdown and HTML export buttons

Installation

Add both docsy and docsy_toolbar to your pubspec.yaml:

dependencies:
  docsy: ^0.1.3
  docsy_toolbar: ^0.1.3

Then run:

flutter pub get

Usage

import 'package:docsy/docsy.dart';
import 'package:docsy_toolbar/docsy_toolbar.dart';
import 'package:flutter/material.dart';

class MyEditorPage extends StatefulWidget {
  const MyEditorPage({super.key});

  @override
  State<MyEditorPage> createState() => _MyEditorPageState();
}

class _MyEditorPageState extends State<MyEditorPage> {
  final controller = EditorController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Docsy Editor with Toolbar')),
      body: Column(
        children: [
          DocsyToolbar(controller: controller),
          const Divider(height: 1),
          Expanded(
            child: RichTextEditor(controller: controller),
          ),
        ],
      ),
    );
  }
}

Notes

  • The export buttons open copyable dialogs for Markdown and HTML.
  • The toolbar expects to share the same EditorController as the editor.

License

This package is distributed under the MIT License. See LICENSE for details.

Libraries

docsy_toolbar