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( configurations: QuillSimpleToolbarConfigurations(
controller: controller, controller: controller,
showAlignmentButtons: true, showAlignmentButtons: true,
headerStyleType: HeaderStyleType.dropdown,
buttonOptions: QuillSimpleToolbarButtonOptions( buttonOptions: QuillSimpleToolbarButtonOptions(
base: QuillToolbarBaseButtonOptions( base: QuillToolbarBaseButtonOptions(
// Request editor focus when any button is pressed // Request editor focus when any button is pressed

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

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

Loading…
Cancel
Save