@ -160,32 +160,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
/ / default button tooltips
final buttonTooltips = tooltips ? ?
< ToolbarButtons , String > {
ToolbarButtons . fontFamily: ' Font family ' . i18n ,
ToolbarButtons . fontSize: ' Font size ' . i18n ,
ToolbarButtons . bold: ' Bold ' . i18n ,
ToolbarButtons . subscript: ' Subscript ' . i18n ,
ToolbarButtons . superscript: ' Superscript ' . i18n ,
ToolbarButtons . italic: ' Italic ' . i18n ,
ToolbarButtons . small: ' Small ' . i18n ,
ToolbarButtons . underline: ' Underline ' . i18n ,
ToolbarButtons . strikeThrough: ' Strike through ' . i18n ,
ToolbarButtons . inlineCode: ' Inline code ' . i18n ,
ToolbarButtons . color: ' Font color ' . i18n ,
ToolbarButtons . backgroundColor: ' Background color ' . i18n ,
ToolbarButtons . clearFormat: ' Clear format ' . i18n ,
ToolbarButtons . leftAlignment: ' Align left ' . i18n ,
ToolbarButtons . centerAlignment: ' Align center ' . i18n ,
ToolbarButtons . rightAlignment: ' Align right ' . i18n ,
ToolbarButtons . justifyAlignment: ' Justify win width ' . i18n ,
ToolbarButtons . direction: ' Text direction ' . i18n ,
ToolbarButtons . headerStyle: ' Header style ' . i18n ,
ToolbarButtons . listNumbers: ' Numbered list ' . i18n ,
ToolbarButtons . listBullets: ' Bullet list ' . i18n ,
ToolbarButtons . listChecks: ' Checked list ' . i18n ,
ToolbarButtons . codeBlock: ' Code block ' . i18n ,
ToolbarButtons . quote: ' Quote ' . i18n ,
ToolbarButtons . indentIncrease: ' Increase indent ' . i18n ,
ToolbarButtons . indentDecrease: ' Decrease indent ' . i18n ,
ToolbarButtons . link: ' Insert URL ' . i18n ,
ToolbarButtons . search: ' Search ' . i18n ,
} ;
@ -237,12 +212,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
options: toolbarConfigurations . buttonOptions . bold ,
controller: toolbarConfigurations . buttonOptions . bold . controller ? ?
context . requireQuillController ,
/ / icon: Icons . format_bold ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . bold ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showSubscript )
QuillToolbarToggleStyleButton (
@ -251,12 +220,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . subscript . controller ? ?
context . requireQuillController ,
/ / icon: Icons . subscript ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . subscript ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showSuperscript )
QuillToolbarToggleStyleButton (
@ -265,12 +228,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . superscript . controller ? ?
context . requireQuillController ,
/ / icon: Icons . superscript ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . superscript ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showItalicButton )
QuillToolbarToggleStyleButton (
@ -279,12 +236,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . italic . controller ? ?
context . requireQuillController ,
/ / icon: Icons . format_italic ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . italic ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showSmallButton )
QuillToolbarToggleStyleButton (
@ -293,12 +244,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . small . controller ? ?
context . requireQuillController ,
/ / icon: Icons . format_size ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . small ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showUnderLineButton )
QuillToolbarToggleStyleButton (
@ -307,12 +252,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . underLine . controller ? ?
context . requireQuillController ,
/ / icon: Icons . format_underline ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . underline ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showStrikeThrough )
QuillToolbarToggleStyleButton (
@ -321,12 +260,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller: toolbarConfigurations
. buttonOptions . strikeThrough . controller ? ?
context . requireQuillController ,
/ / icon: Icons . format_strikethrough ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . strikeThrough ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showInlineCode )
QuillToolbarToggleStyleButton (
@ -335,45 +268,23 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . inlineCode . controller ? ?
context . requireQuillController ,
/ / icon: Icons . code ,
/ / iconSize: toolbarIconSize ,
/ / tooltip: buttonTooltips [ ToolbarButtons . inlineCode ] ,
/ / controller: controller ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showColorButton )
QuillToolbarColorButton (
icon: Icons . color_lens ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . color ] ,
controller: controller ,
background: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
dialogBarrierColor:
context . requireQuillSharedConfigurations . dialogBarrierColor ,
isBackground: false ,
options: toolbarConfigurations . buttonOptions . color ,
) ,
if ( showBackgroundColorButton )
QuillToolbarColorButton (
icon: Icons . format_color_fill ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . backgroundColor ] ,
options: toolbarConfigurations . buttonOptions . backgroundColor ,
controller: controller ,
background: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
dialogBarrierColor:
context . requireQuillSharedConfigurations . dialogBarrierColor ,
isBackground: true ,
) ,
if ( showClearFormat )
QuillToolbarClearFormatButton (
icon: Icons . format_clear ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . clearFormat ] ,
controller: controller ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
options: toolbarConfigurations . buttonOptions . clearFormat ,
) ,
if ( embedButtons ! = null )
for ( final builder in embedButtons )
@ -393,20 +304,19 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
if ( showAlignmentButtons )
QuillToolbarSelectAlignmentButton (
controller: controller ,
tooltips: Map . of ( buttonTooltips )
. . removeWhere ( ( key , value ) = > ! [
ToolbarButtons . leftAlignment ,
ToolbarButtons . centerAlignment ,
ToolbarButtons . righ tAlignment,
ToolbarButtons . justify Alignment,
] . contains ( key ) ) ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
options:
toolbarConfigurations . buttonOptions . selectAlignmentButtons ,
/ / tooltips: Map . of ( buttonTooltips )
/ / . . removeWhere ( ( key , value ) = > ! [
/ / ToolbarButtons . lef tAlignment,
/ / ToolbarButtons . center Alignment,
/ / ToolbarButtons . rightAlignment ,
/ / ToolbarButtons . justifyAlignment ,
/ / ] . contains ( key ) ) ,
showLeftAlignment: showLeftAlignment ,
showCenterAlignment: showCenterAlignment ,
showRightAlignment: showRightAlignment ,
showJustifyAlignment: showJustifyAlignment ,
afterButtonPressed: afterButtonPressed ,
) ,
if ( showDirection )
QuillToolbarToggleStyleButton (
@ -415,12 +325,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . direction . controller ? ?
context . requireQuillController ,
/ / tooltip: buttonTooltips [ ToolbarButtons . direction ] ,
/ / controller: controller ,
/ / icon: Icons . format_textdirection_r_to_l ,
/ / iconSize: toolbarIconSize ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 1 ] & &
@ -460,12 +364,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . listNumbers . controller ? ?
context . requireQuillController ,
/ / tooltip: buttonTooltips [ ToolbarButtons . listNumbers ] ,
/ / controller: controller ,
/ / icon: Icons . format_list_numbered ,
/ / iconSize: toolbarIconSize ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showListBullets )
QuillToolbarToggleStyleButton (
@ -474,22 +372,13 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . listBullets . controller ? ?
context . requireQuillController ,
/ / tooltip: buttonTooltips [ ToolbarButtons . listBullets ] ,
/ / controller: controller ,
/ / icon: Icons . format_list_bulleted ,
/ / iconSize: toolbarIconSize ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showListCheck )
QuillToolbarToggleCheckListButton (
attribute: Attribute . unchecked ,
tooltip: buttonTooltips [ ToolbarButtons . listChecks ] ,
controller: controller ,
icon: Icons . check_box ,
iconSize: toolbarIconSize ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
options: toolbarConfigurations . buttonOptions . toggleCheckList ,
controller: toolbarConfigurations
. buttonOptions . toggleCheckList . controller ? ?
context . requireQuillController ,
) ,
if ( showCodeBlock )
QuillToolbarToggleStyleButton (
@ -498,12 +387,6 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
controller:
toolbarConfigurations . buttonOptions . codeBlock . controller ? ?
context . requireQuillController ,
/ / tooltip: buttonTooltips [ ToolbarButtons . codeBlock ] ,
/ / controller: controller ,
/ / icon: Icons . code ,
/ / iconSize: toolbarIconSize ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showDividers & &
isButtonGroupShown [ 3 ] & &
@ -517,32 +400,22 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
toolbarConfigurations . buttonOptions . quote . controller ? ?
context . requireQuillController ,
attribute: Attribute . blockQuote ,
/ / tooltip: buttonTooltips [ ToolbarButtons . quote ] ,
/ / controller: controller ,
/ / icon: Icons . format_quote ,
/ / iconSize: toolbarIconSize ,
/ / iconTheme: iconTheme ,
/ / afterButtonPressed: afterButtonPressed ,
) ,
if ( showIndent )
QuillToolbarIndentButton (
icon: Icons . format_indent_increase ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentIncrease ] ,
controller: controller ,
controller: toolbarConfigurations
. buttonOptions . indentIncrease . controller ? ?
context . requireQuillController ,
isIncrease: true ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
options: toolbarConfigurations . buttonOptions . indentIncrease ,
) ,
if ( showIndent )
QuillToolbarIndentButton (
icon: Icons . format_indent_decrease ,
iconSize: toolbarIconSize ,
tooltip: buttonTooltips [ ToolbarButtons . indentDecrease ] ,
controller: controller ,
controller: toolbarConfigurations
. buttonOptions . indentDecrease . controller ? ?
context . requireQuillController ,
isIncrease: false ,
iconTheme: iconTheme ,
afterButtonPressed: afterButtonPressed ,
options: toolbarConfigurations . buttonOptions . indentDecrease ,
) ,
if ( showDividers & & isButtonGroupShown [ 4 ] & & isButtonGroupShown [ 5 ] )
QuillToolbarDivider ( axis ,
@ -680,10 +553,10 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
class QuillToolbarDivider extends StatelessWidget {
const QuillToolbarDivider (
this . axis , {
Key ? key ,
super . key ,
this . color ,
this . space ,
} ) : super ( key: key ) ;
} ) ;
/ / / Provides a horizontal divider for vertical toolbar .
const QuillToolbarDivider . horizontal ( { Color ? color , double ? space } )