Flutter Markdown #
A markdown renderer for Flutter. It supports the original format, but no inline html.
Getting Started #
Using the Markdown widget is simple, just pass in the source markdown as a string:
If you do not want the padding or scrolling behavior, use the MarkdownBody instead:
By default, Markdown uses the formatting from the current material design theme, but it's possible to create your own custom styling. Use the MarkdownStyle class to pass in your own style. If you don't want to use Markdown outside of material design, use the MarkdownRaw class.
Image support #
Img tag only supports the following image locations:
From the network: Use a URL prefixed by either
From local files on the device: Use an absolute path to the file, for example by concatenating the file name with the path returned by a known storage location, such as those provided by the
From image locations referring to bundled assets: Use an asset name prefixed by
- Supporting GitHub flavoured Markdown
- Supporting strikethrough
- Convert TextSpan to use new InlineSpan API
- Updated environment sdk constraints to make the package Dart 2 compatible. As a result, usage of this version and higher requires a Dart 2 SDK.
mockitoas a dev dependency. Eliminate use of
package:http, which is no longer part of Flutter.
listyle to bullets
httpas declared dependencies in
- Add support for horizontal rules.
- Fix the
onTapcallback on images nested in hyperlinks
- Add support for local file paths in image links. Make sure to set the
imageDirectoryproperty to specify the base directory containing the image files.
- Roll the dependency on
- Add a test and example for image links
- Fix the
onTapcallback on hyperlinks
- First published version
Demonstrates how to use the flutter_markdown package.
Getting Started #
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: flutter_markdown: ^0.3.0
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.0
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.6
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
The package description is too short. (-20 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
|Dart SDK||>=2.5.0 <3.0.0|