markdown_editor_plus 0.2.9 copy "markdown_editor_plus: ^0.2.9" to clipboard
markdown_editor_plus: ^0.2.9 copied to clipboard

outdated

A TextFormField Widget that allow you to convert easily what's in the FormField to Markdown with custom toolbar support.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  final TextEditingController _controller = TextEditingController();

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Home Screen"),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: [
          MarkdownFormField(
            controller: _controller,
            enableToolBar: true,
            emojiConvert: true,
            autoCloseAfterSelectEmoji: false,
            // maxLines: 10,
            // minLines: 1,
            // expands: true,
            onChanged: (s) {
              setState(() {});
            },
          ),
          SizedBox(
            height: 100,
            child: MarkdownParse(
              data: _controller.text,
              selectable: true,
              onTapHastag: (String name, String match) {
                // example : #hashtag
                // name => hashtag
                // match => #hashtag
              },
              onTapMention: (String name, String match) {
                // example : @mention
                // name => mention
                // match => #mention
              },
            ),
          ),
        ],
      ),
    );
  }
}
53
likes
0
pub points
87%
popularity

Publisher

unverified uploader

A TextFormField Widget that allow you to convert easily what's in the FormField to Markdown with custom toolbar support.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

expandable, flutter, flutter_markdown, font_awesome_flutter, markdown

More

Packages that depend on markdown_editor_plus