Make the header dropdown button as a default

pull/1631/head
Ellet 1 year ago
parent 55db4a721f
commit 48af9ae2d9
  1. 1
      example/lib/presentation/quill/my_quill_toolbar.dart
  2. 8
      lib/src/models/config/toolbar/simple_toolbar_configurations.dart
  3. 12
      lib/src/widgets/toolbar/simple_toolbar.dart

@ -201,7 +201,6 @@ class MyQuillToolbar extends StatelessWidget {
configurations: QuillSimpleToolbarConfigurations(
controller: controller,
showAlignmentButtons: true,
headerStyleType: HeaderStyleType.dropdown,
buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed

@ -52,14 +52,14 @@ enum LinkStyleType {
}
enum HeaderStyleType {
/// Defines the original [QuillToolbarSelectHeaderStyleButtons].
/// Defines the original [QuillToolbarSelectHeaderStyleDropdownButton].
original,
/// Defines the alternative [QuillToolbarSelectHeaderStyleDropdownButton].
dropdown;
/// Defines the alternative [QuillToolbarSelectHeaderStyleButtons].
buttons;
bool get isOriginal => this == HeaderStyleType.original;
bool get isDropdown => this == HeaderStyleType.dropdown;
bool get isButtons => this == HeaderStyleType.buttons;
}
/// The configurations for the toolbar widget of flutter quill

@ -197,16 +197,16 @@ class QuillSimpleToolbar extends StatelessWidget
),
if (configurations.showHeaderStyle) ...[
if (configurations.headerStyleType.isOriginal)
QuillToolbarSelectHeaderStyleButtons(
controller: globalController,
options:
toolbarConfigurations.buttonOptions.selectHeaderStyleButtons,
)
else
QuillToolbarSelectHeaderStyleDropdownButton(
controller: globalController,
options: toolbarConfigurations
.buttonOptions.selectHeaderStyleDropdownButton,
)
else
QuillToolbarSelectHeaderStyleButtons(
controller: globalController,
options:
toolbarConfigurations.buttonOptions.selectHeaderStyleButtons,
),
],
if (configurations.showDividers &&

Loading…
Cancel
Save