Add conditional rendering for toolbar header style options

The toolbar header style now has two possible displays. If the 'headerStyleType' configuration is set to 'isOriginal', the toolbar will exhibit 'QuillToolbarSelectHeaderStyleButtons'. Otherwise, it will show a dropdown menu 'QuillToolbarSelectHeaderStyleDropdownButton'. This adds flexibility to the UI of the toolbar.
pull/1613/head
Sobhan Moradi 1 year ago
parent d1b8e36ff0
commit 94f92bfe5a
  1. 10
      lib/src/widgets/toolbar/simple_toolbar.dart

@ -195,12 +195,20 @@ class QuillSimpleToolbar extends StatelessWidget
color: configurations.sectionDividerColor,
space: configurations.sectionDividerSpace,
),
if (configurations.showHeaderStyle)
if (configurations.showHeaderStyle) ...[
if (configurations.headerStyleType.isOriginal)
QuillToolbarSelectHeaderStyleButtons(
controller: globalController,
options:
toolbarConfigurations.buttonOptions.selectHeaderStyleButtons,
)
else
QuillToolbarSelectHeaderStyleDropdownButton(
controller: globalController,
options: toolbarConfigurations
.buttonOptions.selectHeaderStyleDropdownButton,
),
],
if (configurations.showDividers &&
configurations.showHeaderStyle &&
isButtonGroupShown[2] &&

Loading…
Cancel
Save