showMarkdownPage function

void showMarkdownPage(
  1. {required BuildContext context,
  2. Widget? title,
  3. ScaffoldBuilder? scaffoldBuilder,
  4. String? applicationName,
  5. Widget? applicationIcon,
  6. required String filename,
  7. String? contentMarkdown,
  8. bool? useMustache,
  9. Map<String, String>? mustacheValues,
  10. MarkdownTapHandler? tapHandler,
  11. MarkdownStyleSheet? styleSheet,
  12. String? imageDirectory,
  13. List<BlockSyntax>? blockSyntaxes,
  14. List<InlineSyntax>? inlineSyntaxes,
  15. ExtensionSet? extensionSet,
  16. MarkdownImageBuilder? imageBuilder,
  17. MarkdownCheckboxBuilder? checkboxBuilder,
  18. Map<String, MarkdownElementBuilder> builders = const {},
  19. bool fitContent = true,
  20. bool selectable = false,
  21. bool shrinkWrap = true,
  22. MarkdownStyleSheetBaseTheme? styleSheetTheme,
  23. SyntaxHighlighter? syntaxHighlighter}
)

Show a markdown document in a screen

Implementation

void showMarkdownPage({
  required BuildContext context,
  Widget? title,
  ScaffoldBuilder? scaffoldBuilder,
  String? applicationName,
  Widget? applicationIcon,
  required String filename,
  String? contentMarkdown,
  bool? useMustache,
  Map<String, String>? mustacheValues,
  MarkdownTapHandler? tapHandler,
  MarkdownStyleSheet? styleSheet,
  String? imageDirectory,
  List<md.BlockSyntax>? blockSyntaxes,
  List<md.InlineSyntax>? inlineSyntaxes,
  md.ExtensionSet? extensionSet,
  MarkdownImageBuilder? imageBuilder,
  MarkdownCheckboxBuilder? checkboxBuilder,
  Map<String, MarkdownElementBuilder> builders = const {},
  bool fitContent = true,
  bool selectable = false,
  bool shrinkWrap = true,
  MarkdownStyleSheetBaseTheme? styleSheetTheme,
  SyntaxHighlighter? syntaxHighlighter,
}) {
  final cupertino = isCupertino(context);

  styleSheetTheme ??= cupertino
      ? MarkdownStyleSheetBaseTheme.cupertino
      : MarkdownStyleSheetBaseTheme.material;

  final page = MarkdownPage(
    title: title,
    scaffoldBuilder: scaffoldBuilder,
    applicationName: applicationName,
    filename: filename,
    contentMarkdown: contentMarkdown,
    useMustache: useMustache,
    mustacheValues: mustacheValues,
    tapHandler: tapHandler,
    styleSheet: styleSheet,
    imageDirectory: imageDirectory,
    blockSyntaxes: blockSyntaxes,
    inlineSyntaxes: inlineSyntaxes,
    extensionSet: extensionSet,
    imageBuilder: imageBuilder,
    checkboxBuilder: checkboxBuilder,
    builders: builders,
    fitContent: fitContent,
    selectable: selectable,
    shrinkWrap: shrinkWrap,
    styleSheetTheme: styleSheetTheme,
    syntaxHighlighter: syntaxHighlighter,
  );

  if (cupertino) {
    Navigator.push(
      context,
      CupertinoPageRoute<void>(
        builder: (BuildContext context) => page,
      ),
    );
  } else {
    Navigator.push(
      context,
      MaterialPageRoute<void>(
        builder: (BuildContext context) => page,
      ),
    );
  }
}