Add conditional rendering for toolbar header style options (#1613)

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.

Co-authored-by: Sobhan Moradi <sobhan.moradi@getflip.com>
pull/1621/head
Sobhan Moradi 1 year ago committed by GitHub
parent 32b698e6ad
commit a35c5cf93c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      lib/src/widgets/toolbar/simple_toolbar.dart

@ -195,12 +195,20 @@ class QuillSimpleToolbar extends StatelessWidget
color: configurations.sectionDividerColor,
space: configurations.sectionDividerSpace,
),
if (configurations.showHeaderStyle)
QuillToolbarSelectHeaderStyleDropdownButton(
controller: globalController,
options: toolbarConfigurations
.buttonOptions.selectHeaderStyleDropdownButton,
),
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