diff --git a/example/lib/screens/quill/my_quill_toolbar.dart b/example/lib/screens/quill/my_quill_toolbar.dart index dde676d2..5acfb2de 100644 --- a/example/lib/screens/quill/my_quill_toolbar.dart +++ b/example/lib/screens/quill/my_quill_toolbar.dart @@ -222,24 +222,25 @@ class MyQuillToolbar extends StatelessWidget { '35': '35.0', '40': '40.0' }, - buttonOptions: QuillSimpleToolbarButtonOptions( - base: QuillToolbarBaseButtonOptions( - afterButtonPressed: focusNode.requestFocus, - // iconSize: 20, - // iconTheme: QuillIconTheme( - // iconButtonSelectedData: IconButtonData( - // style: IconButton.styleFrom( - // foregroundColor: Colors.blue, - // ), - // ), - // iconButtonUnselectedData: IconButtonData( - // style: IconButton.styleFrom( - // foregroundColor: Colors.red, - // ), - // ), - // ), - ), - ), + // headerStyleType: HeaderStyleType.buttons, + // buttonOptions: QuillSimpleToolbarButtonOptions( + // base: QuillToolbarBaseButtonOptions( + // afterButtonPressed: focusNode.requestFocus, + // // iconSize: 20, + // iconTheme: QuillIconTheme( + // iconButtonSelectedData: IconButtonData( + // style: IconButton.styleFrom( + // foregroundColor: Colors.blue, + // ), + // ), + // iconButtonUnselectedData: IconButtonData( + // style: IconButton.styleFrom( + // foregroundColor: Colors.red, + // ), + // ), + // ), + // ), + // ), customButtons: [ QuillToolbarCustomButtonOptions( icon: const Icon(Icons.add_alarm_rounded), diff --git a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_buttons.dart b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_buttons.dart index 6cb72cac..e04a1f22 100644 --- a/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_buttons.dart +++ b/lib/src/widgets/toolbar/buttons/hearder_style/select_header_style_buttons.dart @@ -89,8 +89,7 @@ class QuillToolbarSelectHeaderStyleButtonsState return options.axis ?? context.quillSimpleToolbarConfigurations?.axis ?? context.quillToolbarConfigurations?.axis ?? - (throw ArgumentError( - 'There is no default value for the Axis of the toolbar')); + Axis.horizontal; } void _sharedOnPressed(Attribute attribute) { @@ -130,15 +129,7 @@ class QuillToolbarSelectHeaderStyleButtonsState final children = _attrbuites.map((attribute) { if (childBuilder != null) { return childBuilder( - QuillToolbarSelectHeaderStyleButtonsOptions( - afterButtonPressed: afterButtonPressed, - attributes: _attrbuites, - axis: axis, - iconSize: iconSize, - iconButtonFactor: iconButtonFactor, - iconTheme: iconTheme, - tooltip: tooltip, - ), + options, QuillToolbarSelectHeaderStyleButtonsExtraOptions( controller: controller, context: context, @@ -146,30 +137,24 @@ class QuillToolbarSelectHeaderStyleButtonsState ), ); } - // final theme = Theme.of(context); + final isSelected = _selectedAttribute == attribute; return Padding( padding: const EdgeInsets.symmetric(horizontal: !kIsWeb ? 1.0 : 5.0), - child: ConstrainedBox( - constraints: BoxConstraints.tightFor( - width: iconSize * iconButtonFactor, - height: iconSize * iconButtonFactor, - ), - child: QuillToolbarIconButton( - tooltip: tooltip, - iconTheme: iconTheme, - isSelected: isSelected, - onPressed: () => _sharedOnPressed(attribute), - icon: Text( - _valueToText[attribute] ?? - (throw ArgumentError.notNull( - 'attrbuite', - )), - style: style.copyWith( - color: isSelected - ? iconTheme?.iconButtonSelectedData?.color - : iconTheme?.iconButtonUnselectedData?.color, - ), + child: QuillToolbarIconButton( + tooltip: tooltip, + iconTheme: iconTheme, + isSelected: isSelected, + onPressed: () => _sharedOnPressed(attribute), + icon: Text( + _valueToText[attribute] ?? + (throw ArgumentError.notNull( + 'attrbuite', + )), + style: style.copyWith( + color: isSelected + ? iconTheme?.iconButtonSelectedData?.color + : iconTheme?.iconButtonUnselectedData?.color, ), ), ),