MarkdownToolbar constructor Null safety

const MarkdownToolbar(
  1. {Key? key,
  2. required bool useIncludedTextField,
  3. TextEditingController? controller,
  4. FocusNode? focusNode,
  5. bool collapsable = true,
  6. bool alignCollapseButtonEnd = false,
  7. bool flipCollapseButtonIcon = false,
  8. Color backgroundColor = const Color(0xFFEEEEEE),
  9. Color dropdownTextColor = Colors.blue,
  10. Color iconColor = const Color(0xFF303030),
  11. double iconSize = 24.0,
  12. double width = 60.0,
  13. double height = 40.0,
  14. double spacing = 4.0,
  15. double runSpacing = 4.0,
  16. WrapAlignment alignment = WrapAlignment.end,
  17. String boldCharacter = '**',
  18. String italicCharacter = '*',
  19. String codeCharacter = '```',
  20. String bulletedListCharacter = '-',
  21. String horizontalRuleCharacter = '---',
  22. bool hideHeading = false,
  23. bool hideBold = false,
  24. bool hideItalic = false,
  25. bool hideStrikethrough = false,
  26. bool hideLink = false,
  27. bool hideImage = false,
  28. bool hideCode = false,
  29. bool hideBulletedList = false,
  30. bool hideNumberedList = false,
  31. bool hideCheckbox = false,
  32. bool hideQuote = false,
  33. bool hideHorizontalRule = false,
  34. bool showTooltips = true,
  35. String headingTooltip = 'Heading',
  36. String boldTooltip = 'Bold',
  37. String italicTooltip = 'Italic',
  38. String strikethroughTooltip = 'Strikethrough',
  39. String linkTooltip = 'Link',
  40. String imageTooltip = 'Image',
  41. String codeTooltip = 'Code',
  42. String bulletedListTooltip = 'Bulleted list',
  43. String numberedListTooltip = 'Numbered list',
  44. String checkboxTooltip = 'Checkbox',
  45. String quoteTooltip = 'Quote',
  46. String horizontalRuleTooltip = 'Horizontal rule'}
)

Creates a MarkdownToolbar widget.

The following field is necessary: useIncludedTextField (bool)

If you set useIncludedTextField to true, you are ready to use the Widget with its included TextField.

If you set useIncludedTextField to false, you need a TextField widget outside of the MarkdownToolbar which has the same controller and focusNode set as the MarkdownToolbar (see below).

Remember: In this case, you have to set the controller and focusNode fields in your MarkdownToolbar. Hover over each field for more details on implementing your own TextField correctly.

Implementation

const MarkdownToolbar({
  super.key,
  required this.useIncludedTextField,
  this.controller,
  this.focusNode,
  this.collapsable = true,
  this.alignCollapseButtonEnd = false,
  this.flipCollapseButtonIcon = false,
  this.backgroundColor = const Color(0xFFEEEEEE),
  this.dropdownTextColor = Colors.blue,
  this.iconColor = const Color(0xFF303030),
  this.iconSize = 24.0,
  this.width = 60.0,
  this.height = 40.0,
  this.spacing = 4.0,
  this.runSpacing = 4.0,
  this.alignment = WrapAlignment.end,
  this.boldCharacter = '**',
  this.italicCharacter = '*',
  this.codeCharacter = '```',
  this.bulletedListCharacter = '-',
  this.horizontalRuleCharacter = '---',
  this.hideHeading = false,
  this.hideBold = false,
  this.hideItalic = false,
  this.hideStrikethrough = false,
  this.hideLink = false,
  this.hideImage = false,
  this.hideCode = false,
  this.hideBulletedList = false,
  this.hideNumberedList = false,
  this.hideCheckbox = false,
  this.hideQuote = false,
  this.hideHorizontalRule = false,
  this.showTooltips = true,
  this.headingTooltip = 'Heading',
  this.boldTooltip = 'Bold',
  this.italicTooltip = 'Italic',
  this.strikethroughTooltip = 'Strikethrough',
  this.linkTooltip = 'Link',
  this.imageTooltip = 'Image',
  this.codeTooltip = 'Code',
  this.bulletedListTooltip = 'Bulleted list',
  this.numberedListTooltip = 'Numbered list',
  this.checkboxTooltip = 'Checkbox',
  this.quoteTooltip = 'Quote',
  this.horizontalRuleTooltip = 'Horizontal rule',
});