@ -1,29 +1,10 @@
import ' package:flutter/material.dart ' ;
import ' package:i18n_extension/i18n_widget.dart ' ;
import ' ../models/documents/attribute.dart ' ;
import ' ../models/structs/link_dialog_action.dart ' ;
import ' ../models/themes/quill_custom_button.dart ' ;
import ' ../models/themes/quill_dialog_theme.dart ' ;
import ' ../models/themes/quill_icon_theme.dart ' ;
import ' ../../flutter_quill.dart ' ;
import ' ../translations/toolbar.i18n.dart ' ;
import ' controller.dart ' ;
import ' embeds.dart ' ;
import ' ../utils/extensions/build_context.dart ' ;
import ' toolbar/arrow_indicated_button_list.dart ' ;
import ' toolbar/clear_format_button.dart ' ;
import ' toolbar/color_button.dart ' ;
import ' toolbar/custom_button.dart ' ;
import ' toolbar/enum.dart ' ;
import ' toolbar/history_button.dart ' ;
import ' toolbar/indent_button.dart ' ;
import ' toolbar/link_style_button.dart ' ;
import ' toolbar/quill_font_family_button.dart ' ;
import ' toolbar/quill_font_size_button.dart ' ;
import ' toolbar/search_button.dart ' ;
import ' toolbar/select_alignment_button.dart ' ;
import ' toolbar/select_header_style_button.dart ' ;
import ' toolbar/toggle_check_list_button.dart ' ;
import ' toolbar/toggle_style_button.dart ' ;
export ' toolbar/clear_format_button.dart ' ;
export ' toolbar/color_button.dart ' ;
@ -50,9 +31,13 @@ const double kIconButtonFactor = 1.77;
/ / / The horizontal margin between the contents of each toolbar section .
const double kToolbarSectionSpacing = 4 ;
typedef QuillToolbarChildrenBuilder = List < Widget > Function (
BuildContext context ,
) ;
class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
const QuillToolbar ( {
required this . children ,
required this . childrenBuilder ,
this . axis = Axis . horizontal ,
this . toolbarSize = kDefaultIconSize * 2 ,
this . toolbarSectionSpacing = kToolbarSectionSpacing ,
@ -71,7 +56,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
} ) : super ( key: key ) ;
factory QuillToolbar . basic ( {
required QuillController controller ,
Axis axis = Axis . horizontal ,
double toolbarIconSize = kDefaultIconSize ,
double toolbarSectionSpacing = kToolbarSectionSpacing ,
@ -261,349 +245,370 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
customButtons: customButtons ,
locale: locale ,
afterButtonPressed: afterButtonPressed ,
children: [
if ( showUndo )
HistoryButton (
icon: Icons . undo_outlined ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . undo ] ,
controller: controller ,
undo: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showRedo )
HistoryButton (
icon: Icons . redo_outlined ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . redo ] ,
controller: controller ,
undo: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showFontFamily )
QuillFontFamilyButton (
iconTheme: iconTheme ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . fontFamily ] ,
attribute: Attribute . font ,
controller: controller ,
rawItemsMap: fontFamilies ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showFontSize )
QuillFontSizeButton (
iconTheme: iconTheme ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . fontSize ] ,
attribute: Attribute . size ,
controller: controller ,
rawItemsMap: fontSizes ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showBoldButton )
ToggleStyleButton (
attribute: Attribute . bold ,
icon: Icons . format_bold ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . bold ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSubscript )
ToggleStyleButton (
attribute: Attribute . subscript ,
icon: Icons . subscript ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . subscript ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSuperscript )
ToggleStyleButton (
attribute: Attribute . superscript ,
icon: Icons . superscript ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . superscript ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showItalicButton )
ToggleStyleButton (
attribute: Attribute . italic ,
icon: Icons . format_italic ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . italic ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSmallButton )
ToggleStyleButton (
attribute: Attribute . small ,
icon: Icons . format_size ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . small ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showUnderLineButton )
ToggleStyleButton (
attribute: Attribute . underline ,
icon: Icons . format_underline ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . underline ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showStrikeThrough )
ToggleStyleButton (
attribute: Attribute . strikeThrough ,
icon: Icons . format_strikethrough ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . strikeThrough ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showInlineCode )
ToggleStyleButton (
attribute: Attribute . inlineCode ,
icon: Icons . code ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . inlineCode ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showColorButton )
ColorButton (
icon: Icons . color_lens ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . color ] ,
controller: controller ,
background: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showBackgroundColorButton )
ColorButton (
icon: Icons . format_color_fill ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . backgroundColor ] ,
controller: controller ,
background: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showClearFormat )
ClearFormatButton (
icon: Icons . format_clear ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . clearFormat ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( embedButtons ! = null )
for ( final builder in embedButtons )
builder ( controller , toolbarIconSize , iconTheme , dialogTheme ) ,
if ( showDividers & &
isButtonGroupShown [ 0 ] & &
( isButtonGroupShown [ 1 ] | |
isButtonGroupShown [ 2 ] | |
isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showAlignmentButtons )
SelectAlignmentButton (
controller: controller ,
tooltips: Map . of ( buttonTooltips )
. . removeWhere ( ( key , value ) = > ! [
ToolbarButtons . leftAlignment ,
ToolbarButtons . centerAlignment ,
ToolbarButtons . rightAlignment ,
ToolbarButtons . justifyAlignment ,
] . contains ( key ) ) ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
showLeftAlignment: showLeftAlignment ,
showCenterAlignment: showCenterAlignment ,
showRightAlignment: showRightAlignment ,
showJustifyAlignment: showJustifyAlignment ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDirection )
ToggleStyleButton (
attribute: Attribute . rtl ,
tooltip: buttonTooltips [ ToolbarButtons . direction ] ,
controller: controller ,
icon: Icons . format_textdirection_r_to_l ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 1 ] & &
( isButtonGroupShown [ 2 ] | |
isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showHeaderStyle )
SelectHeaderStyleButton (
tooltip: buttonTooltips [ ToolbarButtons . headerStyle ] ,
controller: controller ,
axis: axis ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
showHeaderStyle & &
isButtonGroupShown [ 2 ] & &
( isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showListNumbers )
ToggleStyleButton (
attribute: Attribute . ol ,
tooltip: buttonTooltips [ ToolbarButtons . listNumbers ] ,
controller: controller ,
icon: Icons . format_list_numbered ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showListBullets )
ToggleStyleButton (
attribute: Attribute . ul ,
tooltip: buttonTooltips [ ToolbarButtons . listBullets ] ,
controller: controller ,
icon: Icons . format_list_bulleted ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showListCheck )
ToggleCheckListButton (
attribute: Attribute . unchecked ,
tooltip: buttonTooltips [ ToolbarButtons . listChecks ] ,
controller: controller ,
icon: Icons . check_box ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showCodeBlock )
ToggleStyleButton (
attribute: Attribute . codeBlock ,
tooltip: buttonTooltips [ ToolbarButtons . codeBlock ] ,
controller: controller ,
icon: Icons . code ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 3 ] & &
( isButtonGroupShown [ 4 ] | | isButtonGroupShown [ 5 ] ) )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showQuote )
ToggleStyleButton (
attribute: Attribute . blockQuote ,
tooltip: buttonTooltips [ ToolbarButtons . quote ] ,
controller: controller ,
icon: Icons . format_quote ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showIndent )
IndentButton (
icon: Icons . format_indent_increase ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentIncrease ] ,
controller: controller ,
isIncrease: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showIndent )
IndentButton (
icon: Icons . format_indent_decrease ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentDecrease ] ,
controller: controller ,
isIncrease: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & & isButtonGroupShown [ 4 ] & & isButtonGroupShown [ 5 ] )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showLink )
LinkStyleButton (
tooltip: buttonTooltips [ ToolbarButtons . link ] ,
controller: controller ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
dialogTheme: dialogTheme ,
afterButtonPressed: afterButtonPressed ,
linkRegExp: linkRegExp ,
linkDialogAction: linkDialogAction ,
) ,
if ( showSearchButton )
SearchButton (
icon: Icons . search ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . search ] ,
controller: controller ,
iconTheme: iconTheme ,
dialogTheme: dialogTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( customButtons . isNotEmpty )
if ( showDividers )
childrenBuilder: ( context ) {
final controller = context . requireQuillController ;
return [
if ( showUndo )
HistoryButton (
icon: Icons . undo_outlined ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . undo ] ,
controller: controller ,
undo: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showRedo )
HistoryButton (
icon: Icons . redo_outlined ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . redo ] ,
controller: controller ,
undo: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showFontFamily )
QuillFontFamilyButton (
iconTheme: iconTheme ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . fontFamily ] ,
attribute: Attribute . font ,
controller: controller ,
rawItemsMap: fontFamilies ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showFontSize )
QuillFontSizeButton (
iconTheme: iconTheme ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . fontSize ] ,
attribute: Attribute . size ,
controller: controller ,
rawItemsMap: fontSizes ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showBoldButton )
ToggleStyleButton (
attribute: Attribute . bold ,
icon: Icons . format_bold ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . bold ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSubscript )
ToggleStyleButton (
attribute: Attribute . subscript ,
icon: Icons . subscript ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . subscript ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSuperscript )
ToggleStyleButton (
attribute: Attribute . superscript ,
icon: Icons . superscript ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . superscript ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showItalicButton )
ToggleStyleButton (
attribute: Attribute . italic ,
icon: Icons . format_italic ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . italic ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showSmallButton )
ToggleStyleButton (
attribute: Attribute . small ,
icon: Icons . format_size ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . small ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showUnderLineButton )
ToggleStyleButton (
attribute: Attribute . underline ,
icon: Icons . format_underline ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . underline ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showStrikeThrough )
ToggleStyleButton (
attribute: Attribute . strikeThrough ,
icon: Icons . format_strikethrough ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . strikeThrough ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showInlineCode )
ToggleStyleButton (
attribute: Attribute . inlineCode ,
icon: Icons . code ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . inlineCode ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showColorButton )
ColorButton (
icon: Icons . color_lens ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . color ] ,
controller: controller ,
background: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
dialogBarrierColor:
context . requireSharedQuillConfigurations . dialogBarrierColor ,
) ,
if ( showBackgroundColorButton )
ColorButton (
icon: Icons . format_color_fill ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . backgroundColor ] ,
controller: controller ,
background: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
dialogBarrierColor:
context . requireSharedQuillConfigurations . dialogBarrierColor ,
) ,
if ( showClearFormat )
ClearFormatButton (
icon: Icons . format_clear ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . clearFormat ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( embedButtons ! = null )
for ( final builder in embedButtons )
builder ( controller , toolbarIconSize , iconTheme , dialogTheme ) ,
if ( showDividers & &
isButtonGroupShown [ 0 ] & &
( isButtonGroupShown [ 1 ] | |
isButtonGroupShown [ 2 ] | |
isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider (
axis ,
color: sectionDividerColor ,
space: sectionDividerSpace ,
) ,
if ( showAlignmentButtons )
SelectAlignmentButton (
controller: controller ,
tooltips: Map . of ( buttonTooltips )
. . removeWhere ( ( key , value ) = > ! [
ToolbarButtons . leftAlignment ,
ToolbarButtons . centerAlignment ,
ToolbarButtons . rightAlignment ,
ToolbarButtons . justifyAlignment ,
] . contains ( key ) ) ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
showLeftAlignment: showLeftAlignment ,
showCenterAlignment: showCenterAlignment ,
showRightAlignment: showRightAlignment ,
showJustifyAlignment: showJustifyAlignment ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDirection )
ToggleStyleButton (
attribute: Attribute . rtl ,
tooltip: buttonTooltips [ ToolbarButtons . direction ] ,
controller: controller ,
icon: Icons . format_textdirection_r_to_l ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 1 ] & &
( isButtonGroupShown [ 2 ] | |
isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider (
axis ,
color: sectionDividerColor ,
space: sectionDividerSpace ,
) ,
for ( final customButton in customButtons )
if ( customButton . child ! = null ) . . . [
InkWell (
onTap: customButton . onTap ,
child: customButton . child ,
if ( showHeaderStyle )
SelectHeaderStyleButton (
tooltip: buttonTooltips [ ToolbarButtons . headerStyle ] ,
controller: controller ,
axis: axis ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
showHeaderStyle & &
isButtonGroupShown [ 2 ] & &
( isButtonGroupShown [ 3 ] | |
isButtonGroupShown [ 4 ] | |
isButtonGroupShown [ 5 ] ) )
QuillDivider (
axis ,
color: sectionDividerColor ,
space: sectionDividerSpace ,
) ,
] else . . . [
CustomButton (
onPressed: customButton . onTap ,
icon: customButton . icon ,
iconColor: customButton . iconColor ,
if ( showListNumbers )
ToggleStyleButton (
attribute: Attribute . ol ,
tooltip: buttonTooltips [ ToolbarButtons . listNumbers ] ,
controller: controller ,
icon: Icons . format_list_numbered ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
tooltip: customButton . tooltip ,
) ,
] ,
] ,
if ( showListBullets )
ToggleStyleButton (
attribute: Attribute . ul ,
tooltip: buttonTooltips [ ToolbarButtons . listBullets ] ,
controller: controller ,
icon: Icons . format_list_bulleted ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showListCheck )
ToggleCheckListButton (
attribute: Attribute . unchecked ,
tooltip: buttonTooltips [ ToolbarButtons . listChecks ] ,
controller: controller ,
icon: Icons . check_box ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showCodeBlock )
ToggleStyleButton (
attribute: Attribute . codeBlock ,
tooltip: buttonTooltips [ ToolbarButtons . codeBlock ] ,
controller: controller ,
icon: Icons . code ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 3 ] & &
( isButtonGroupShown [ 4 ] | | isButtonGroupShown [ 5 ] ) )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showQuote )
ToggleStyleButton (
attribute: Attribute . blockQuote ,
tooltip: buttonTooltips [ ToolbarButtons . quote ] ,
controller: controller ,
icon: Icons . format_quote ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showIndent )
IndentButton (
icon: Icons . format_indent_increase ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentIncrease ] ,
controller: controller ,
isIncrease: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showIndent )
IndentButton (
icon: Icons . format_indent_decrease ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentDecrease ] ,
controller: controller ,
isIncrease: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & & isButtonGroupShown [ 4 ] & & isButtonGroupShown [ 5 ] )
QuillDivider ( axis ,
color: sectionDividerColor , space: sectionDividerSpace ) ,
if ( showLink )
LinkStyleButton (
tooltip: buttonTooltips [ ToolbarButtons . link ] ,
controller: controller ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
dialogTheme: dialogTheme ,
afterButtonPressed: afterButtonPressed ,
linkRegExp: linkRegExp ,
linkDialogAction: linkDialogAction ,
dialogBarrierColor:
context . requireSharedQuillConfigurations . dialogBarrierColor ,
) ,
if ( showSearchButton )
SearchButton (
icon: Icons . search ,
iconSize: toolbarIconSize ,
dialogBarrierColor:
context . requireSharedQuillConfigurations . dialogBarrierColor ,
tooltip: buttonTooltips [ ToolbarButtons . search ] ,
controller: controller ,
iconTheme: iconTheme ,
dialogTheme: dialogTheme ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( customButtons . isNotEmpty )
if ( showDividers )
QuillDivider (
axis ,
color: sectionDividerColor ,
space: sectionDividerSpace ,
) ,
for ( final customButton in customButtons )
if ( customButton . child ! = null ) . . . [
InkWell (
onTap: customButton . onTap ,
child: customButton . child ,
) ,
] else . . . [
CustomButton (
onPressed: customButton . onTap ,
icon: customButton . icon ,
iconColor: customButton . iconColor ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
tooltip: customButton . tooltip ,
) ,
] ,
] ;
} ,
) ;
}
final List < Widget > children ;
final QuillToolbarChildrenBuilder childrenBuilder ;
final Axis axis ;
final double toolbarSize ;
final double toolbarSectionSpacing ;
@ -620,10 +625,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
/ / / is given .
final Color ? color ;
/ / We will add this in the next major release and not now
/ / / The barrier color of the shown dialogs
/ / final Color dialogbarrierColor ;
/ / / The locale to use for the editor toolbar , defaults to system locale
/ / / More https: / / github . com / singerdmx / flutter - quill # translation
final Locale ? locale ;
@ -659,7 +660,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
crossAxisAlignment: toolbarIconCrossAlignment ,
runSpacing: 4 ,
spacing: toolbarSectionSpacing ,
children: children ,
children: childrenBuilder ( context ) ,
)
: Container (
decoration: decoration ? ?
@ -672,7 +673,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
) ,
child: ArrowIndicatedButtonList (
axis: axis ,
buttons: children ,
buttons: childrenBuilder ( context ) ,
) ,
) ,
) ;