MarkdownStyleSheet.largeFromTheme constructor Null safety

MarkdownStyleSheet.largeFromTheme(
  1. ThemeData theme
)

Creates a MarkdownStyle from the TextStyles in the provided ThemeData.

This constructor uses larger fonts for the headings than in MarkdownStyle.fromTheme.

Implementation

factory MarkdownStyleSheet.largeFromTheme(ThemeData theme) {
  return MarkdownStyleSheet(
    a: const TextStyle(color: Colors.blue),
    p: theme.textTheme.bodyText2,
    code: theme.textTheme.bodyText2!.copyWith(
      backgroundColor: theme.cardTheme.color ?? theme.cardColor,
      fontFamily: "monospace",
      fontSize: theme.textTheme.bodyText2!.fontSize! * 0.85,
    ),
    h1: theme.textTheme.headline2,
    h2: theme.textTheme.headline3,
    h3: theme.textTheme.headline4,
    h4: theme.textTheme.headline5,
    h5: theme.textTheme.headline6,
    h6: theme.textTheme.subtitle1,
    em: const TextStyle(fontStyle: FontStyle.italic),
    strong: const TextStyle(fontWeight: FontWeight.bold),
    del: const TextStyle(decoration: TextDecoration.lineThrough),
    blockquote: theme.textTheme.bodyText2,
    img: theme.textTheme.bodyText2,
    checkbox: theme.textTheme.bodyText2!.copyWith(
      color: theme.primaryColor,
    ),
    blockSpacing: 8.0,
    listIndent: 24.0,
    listBullet: theme.textTheme.bodyText2,
    listBulletPadding: const EdgeInsets.only(right: 4),
    tableHead: const TextStyle(fontWeight: FontWeight.w600),
    tableBody: theme.textTheme.bodyText2,
    tableHeadAlign: TextAlign.center,
    tableBorder: TableBorder.all(
      color: theme.dividerColor,
    ),
    tableColumnWidth: const FlexColumnWidth(),
    tableCellsPadding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
    tableCellsDecoration: const BoxDecoration(),
    blockquotePadding: const EdgeInsets.all(8.0),
    blockquoteDecoration: BoxDecoration(
      color: Colors.blue.shade100,
      borderRadius: BorderRadius.circular(2.0),
    ),
    codeblockPadding: const EdgeInsets.all(8.0),
    codeblockDecoration: BoxDecoration(
      color: theme.cardTheme.color ?? theme.cardColor,
      borderRadius: BorderRadius.circular(2.0),
    ),
    horizontalRuleDecoration: BoxDecoration(
      border: Border(
        top: BorderSide(
          width: 5.0,
          color: theme.dividerColor,
        ),
      ),
    ),
  );
}