quill_markdown 0.1.0 copy "quill_markdown: ^0.1.0" to clipboard
quill_markdown: ^0.1.0 copied to clipboard

A quill to markdown converter and vice versa

example/main.dart

import 'package:flutter/material.dart';
import 'package:quill_markdown/quill_markdown.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
      child: FlatButton(
          onPressed: () {
            String content =
                '[{"insert":"Heading"},{"insert":"\\n","attributes":{"header":1}},{"insert":"bold","attributes":{"bold":true}},{"insert":"\\n"},{"insert":"bold and italic","attributes":{"bold":true,"italic":true}},{"insert":"\\nsome code"},{"insert":"\\n","attributes":{"code-block":true}},{"insert":"A quote"},{"insert":"\\n","attributes":{"blockquote":true}},{"insert":"ordered list"},{"insert":"\\n","attributes":{"list":"ordered"}},{"insert":"unordered list"},{"insert":"\\n","attributes":{"list":"bullet"}},{"insert":"link","attributes":{"link":"pub.dev/packages/quill_markdown"}},{"insert":"\\n"}]';
            content = quillToMarkdown(content)!;
            print(content);
            content = markdownToQuill(content)!;
            print(content);
          },
          child: Text('Convert')),
    ));
  }
}