Markdown Example

Markdown allows you to easily include formatted text, images, and even formatted Dart code in your app.

Titles

Setext-style

This is an H1
=============

This is an H2
-------------

Atx-style

# This is an H1

## This is an H2

###### This is an H6

Select the valid headers:

  • [x] # hello
  • [ ] #hello

Links

Google's Homepage

[inline-style](https://www.google.com)

[reference-style][Google]

Images

Flutter logo

Tables

SyntaxResult
*italic 1*italic 1
_italic 2_italic 2
**bold 1**bold 1
__bold 2__bold 2
This is a ~~strikethrough~~This is a strikethrough
***italic bold 1***italic bold 1
___italic bold 2___italic bold 2
***~~italic bold strikethrough 1~~***italic bold strikethrough 1
~~***italic bold strikethrough 2***~~italic bold strikethrough 2

Styling

Style text as italic, bold, strikethrough, or inline code.

  • Use bulleted lists
  • To better clarify
  • Your points

Code blocks

Formatted Dart code looks really pretty too:

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Markdown(data: markdownData),
    ),
  ));
}

Center Title

※ ※ ※

* How to implement it see main.dart#L129 in example.

Custom Syntax

NaOH + Al_2O_3 = NaAlO_2 + H_2O

C_4H_10 = C_2H_6 + C_2H_4

Markdown widget

This is an example of how to create your own Markdown widget:

Markdown(data: 'Hello _world_!');

Enjoy!

Line Breaks

This is an example of how to create line breaks (tab or two whitespaces):

line 1

line 2

line 3