markdown_viewer 0.2.0+1 copy "markdown_viewer: ^0.2.0+1" to clipboard
markdown_viewer: ^0.2.0+1 copied to clipboard

outdated

A Markdown renderer for Flutter. Render Markdown String to rich text output.

example/lib/main.dart

// ignore_for_file: avoid_print

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

import 'extension.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(
      title: 'MarkdownViewer Demo',
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    const markdown = r'''
Hello **Markdown**!

---
#example
''';

    return Scaffold(
      appBar: AppBar(title: const Text('MarkdownViewer Demo')),
      body: Padding(
        padding: const EdgeInsets.all(20),
        child: MarkdownViewer(
          markdown,
          enableTaskList: true,
          enableSuperscript: false,
          enableSubscript: false,
          enableFootnote: false,
          enableImageSize: false,
          enableKbd: false,
          syntaxExtensions: [ExampleSyntax()],
          onTapLink: (href, title) {
            print({href, title});
          },
          elementBuilders: [
            ExampleBuilder(),
          ],
        ),
      ),
    );
  }
}
20
likes
0
pub points
79%
popularity

Publisher

verified publishertagnote.app

A Markdown renderer for Flutter. Render Markdown String to rich text output.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dart_markdown, flutter

More

Packages that depend on markdown_viewer