MarkdownStyleSheet constructor

MarkdownStyleSheet({
  1. TextStyle? a,
  2. TextStyle? p,
  3. EdgeInsets? pPadding,
  4. TextStyle? code,
  5. TextStyle? h1,
  6. EdgeInsets? h1Padding,
  7. TextStyle? h2,
  8. EdgeInsets? h2Padding,
  9. TextStyle? h3,
  10. EdgeInsets? h3Padding,
  11. TextStyle? h4,
  12. EdgeInsets? h4Padding,
  13. TextStyle? h5,
  14. EdgeInsets? h5Padding,
  15. TextStyle? h6,
  16. EdgeInsets? h6Padding,
  17. TextStyle? em,
  18. TextStyle? strong,
  19. TextStyle? del,
  20. TextStyle? blockquote,
  21. TextStyle? img,
  22. TextStyle? checkbox,
  23. double? blockSpacing,
  24. double? listIndent,
  25. TextStyle? listBullet,
  26. EdgeInsets? listBulletPadding,
  27. TextStyle? tableHead,
  28. TextStyle? tableBody,
  29. TextAlign? tableHeadAlign,
  30. TableBorder? tableBorder,
  31. TableColumnWidth? tableColumnWidth,
  32. EdgeInsets? tableCellsPadding,
  33. Decoration? tableCellsDecoration,
  34. TableCellVerticalAlignment tableVerticalAlignment = TableCellVerticalAlignment.middle,
  35. EdgeInsets? blockquotePadding,
  36. Decoration? blockquoteDecoration,
  37. EdgeInsets? codeblockPadding,
  38. Decoration? codeblockDecoration,
  39. Decoration? horizontalRuleDecoration,
  40. WrapAlignment textAlign = WrapAlignment.start,
  41. WrapAlignment h1Align = WrapAlignment.start,
  42. WrapAlignment h2Align = WrapAlignment.start,
  43. WrapAlignment h3Align = WrapAlignment.start,
  44. WrapAlignment h4Align = WrapAlignment.start,
  45. WrapAlignment h5Align = WrapAlignment.start,
  46. WrapAlignment h6Align = WrapAlignment.start,
  47. WrapAlignment unorderedListAlign = WrapAlignment.start,
  48. WrapAlignment orderedListAlign = WrapAlignment.start,
  49. WrapAlignment blockquoteAlign = WrapAlignment.start,
  50. WrapAlignment codeblockAlign = WrapAlignment.start,
  51. String? superscriptFontFeatureTag,
  52. @Deprecated('Use textScaler instead.') double? textScaleFactor,
  53. TextScaler? textScaler,
})

Creates an explicit mapping of TextStyle objects to Markdown elements.

Implementation

MarkdownStyleSheet({
  this.a,
  this.p,
  this.pPadding,
  this.code,
  this.h1,
  this.h1Padding,
  this.h2,
  this.h2Padding,
  this.h3,
  this.h3Padding,
  this.h4,
  this.h4Padding,
  this.h5,
  this.h5Padding,
  this.h6,
  this.h6Padding,
  this.em,
  this.strong,
  this.del,
  this.blockquote,
  this.img,
  this.checkbox,
  this.blockSpacing,
  this.listIndent,
  this.listBullet,
  this.listBulletPadding,
  this.tableHead,
  this.tableBody,
  this.tableHeadAlign,
  this.tableBorder,
  this.tableColumnWidth,
  this.tableCellsPadding,
  this.tableCellsDecoration,
  this.tableVerticalAlignment = TableCellVerticalAlignment.middle,
  this.blockquotePadding,
  this.blockquoteDecoration,
  this.codeblockPadding,
  this.codeblockDecoration,
  this.horizontalRuleDecoration,
  this.textAlign = WrapAlignment.start,
  this.h1Align = WrapAlignment.start,
  this.h2Align = WrapAlignment.start,
  this.h3Align = WrapAlignment.start,
  this.h4Align = WrapAlignment.start,
  this.h5Align = WrapAlignment.start,
  this.h6Align = WrapAlignment.start,
  this.unorderedListAlign = WrapAlignment.start,
  this.orderedListAlign = WrapAlignment.start,
  this.blockquoteAlign = WrapAlignment.start,
  this.codeblockAlign = WrapAlignment.start,
  this.superscriptFontFeatureTag,
  @Deprecated('Use textScaler instead.') this.textScaleFactor,
  TextScaler? textScaler,
})  : assert(
        textScaler == null || textScaleFactor == null,
        'textScaleFactor is deprecated and cannot be specified when textScaler is specified.',
      ),
      textScaler = textScaler ??
          // Internally, only textScaler is used, so convert the scale factor
          // to a linear scaler.
          (textScaleFactor == null
              ? null
              : TextScaler.linear(textScaleFactor)),
      _styles = <String, TextStyle?>{
        'a': a,
        'p': p,
        'li': p,
        'code': code,
        'pre': p,
        'h1': h1,
        'h2': h2,
        'h3': h3,
        'h4': h4,
        'h5': h5,
        'h6': h6,
        'em': em,
        'strong': strong,
        'del': del,
        'blockquote': blockquote,
        'img': img,
        'table': p,
        'th': tableHead,
        'tr': tableBody,
        'td': tableBody,
      };