ZefyrToolbar.basic constructor

ZefyrToolbar.basic({
  1. Key? key,
  2. required ZefyrController controller,
  3. bool hideBoldButton = false,
  4. bool hideItalicButton = false,
  5. bool hideUnderLineButton = false,
  6. bool hideStrikeThrough = false,
  7. bool hideHeadingStyle = false,
  8. bool hideListNumbers = false,
  9. bool hideListBullets = false,
  10. bool hideCodeBlock = false,
  11. bool hideQuote = false,
  12. bool hideLink = false,
  13. bool hideHorizontalRule = false,
})

Implementation

factory ZefyrToolbar.basic(
    {Key? key,
    required ZefyrController controller,
    bool hideBoldButton = false,
    bool hideItalicButton = false,
    bool hideUnderLineButton = false,
    bool hideStrikeThrough = false,
    bool hideHeadingStyle = false,
    bool hideListNumbers = false,
    bool hideListBullets = false,
    bool hideCodeBlock = false,
    bool hideQuote = false,
    bool hideLink = false,
    bool hideHorizontalRule = false}) {
  return ZefyrToolbar(key: key, children: [
    Visibility(
      visible: !hideBoldButton,
      child: ToggleStyleButton(
        attribute: NotusAttribute.bold,
        icon: Icons.format_bold,
        controller: controller,
      ),
    ),
    SizedBox(width: 1),
    Visibility(
      visible: !hideItalicButton,
      child: ToggleStyleButton(
        attribute: NotusAttribute.italic,
        icon: Icons.format_italic,
        controller: controller,
      ),
    ),
    SizedBox(width: 1),
    Visibility(
      visible: !hideUnderLineButton,
      child: ToggleStyleButton(
        attribute: NotusAttribute.underline,
        icon: Icons.format_underline,
        controller: controller,
      ),
    ),
    SizedBox(width: 1),
    Visibility(
      visible: !hideStrikeThrough,
      child: ToggleStyleButton(
        attribute: NotusAttribute.strikethrough,
        icon: Icons.format_strikethrough,
        controller: controller,
      ),
    ),
    Visibility(
        visible: !hideHeadingStyle,
        child: VerticalDivider(
            indent: 16, endIndent: 16, color: Colors.grey.shade400)),
    Visibility(
        visible: !hideHeadingStyle,
        child: SelectHeadingStyleButton(controller: controller)),
    VerticalDivider(indent: 16, endIndent: 16, color: Colors.grey.shade400),
    Visibility(
      visible: !hideListNumbers,
      child: ToggleStyleButton(
        attribute: NotusAttribute.block.numberList,
        controller: controller,
        icon: Icons.format_list_numbered,
      ),
    ),
    Visibility(
      visible: !hideListBullets,
      child: ToggleStyleButton(
        attribute: NotusAttribute.block.bulletList,
        controller: controller,
        icon: Icons.format_list_bulleted,
      ),
    ),
    Visibility(
      visible: !hideCodeBlock,
      child: ToggleStyleButton(
        attribute: NotusAttribute.block.code,
        controller: controller,
        icon: Icons.code,
      ),
    ),
    Visibility(
        visible: !hideListNumbers || !hideListBullets || !hideCodeBlock,
        child: VerticalDivider(
            indent: 16, endIndent: 16, color: Colors.grey.shade400)),
    Visibility(
      visible: !hideQuote,
      child: ToggleStyleButton(
        attribute: NotusAttribute.block.quote,
        controller: controller,
        icon: Icons.format_quote,
      ),
    ),
    Visibility(
        visible: !hideQuote,
        child: VerticalDivider(
            indent: 16, endIndent: 16, color: Colors.grey.shade400)),
    Visibility(
        visible: !hideLink, child: LinkStyleButton(controller: controller)),
    Visibility(
      visible: !hideHorizontalRule,
      child: InsertEmbedButton(
        controller: controller,
        icon: Icons.horizontal_rule,
      ),
    ),
  ]);
}