From f62f358f20f61ad0a0da1cfd2a40503a6970fd39 Mon Sep 17 00:00:00 2001 From: Aleksei <130981115+MacDeveloper1@users.noreply.github.com> Date: Wed, 20 Dec 2023 14:04:21 +0100 Subject: [PATCH] Restore old feel & look in `defaultToggleStyleButtonBuilder` --- .../toolbar/buttons/toggle_style_button.dart | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart index 8e9ae3e9..5d88c330 100644 --- a/lib/src/widgets/toolbar/buttons/toggle_style_button.dart +++ b/lib/src/widgets/toolbar/buttons/toggle_style_button.dart @@ -252,11 +252,19 @@ Widget defaultToggleStyleButtonBuilder( .primaryIconTheme.color) //You can specify your own icon color : (iconTheme?.iconUnselectedColor ?? theme.iconTheme.color) : (iconTheme?.disabledIconColor ?? theme.disabledColor); - return QuillToolbarIconButton( - icon: Icon(icon, size: iconSize * iconButtonFactor, color: iconColor), - isFilled: isEnabled ? isToggled == true : false, - onPressed: onPressed, - afterPressed: afterPressed, - padding: iconTheme?.padding, - ); + return theme.useMaterial3 + ? QuillToolbarIconButton( + icon: Icon(icon, size: iconSize * iconButtonFactor, color: iconColor), + isFilled: isEnabled ? isToggled == true : false, + onPressed: onPressed, + afterPressed: afterPressed, + padding: iconTheme?.padding, + ) + : QuillToolbarIconButton( + size: iconSize * iconButtonFactor, + isFilled: isEnabled ? isToggled == true : false, + icon: Icon(icon, size: iconSize, color: iconColor), + onPressed: onPressed, + afterPressed: afterPressed, + ); }