defaultToggleStyleButtonBuilder function
Widget
defaultToggleStyleButtonBuilder(
- BuildContext context,
- Attribute attribute,
- IconData icon,
- bool? isToggled,
- VoidCallback? onPressed,
- VoidCallback? afterPressed, [
- double iconSize = kDefaultIconSize,
- double iconButtonFactor = kDefaultIconButtonFactor,
- QuillIconTheme? iconTheme,
Implementation
Widget defaultToggleStyleButtonBuilder(
BuildContext context,
Attribute attribute,
IconData icon,
bool? isToggled,
VoidCallback? onPressed,
VoidCallback? afterPressed, [
double iconSize = kDefaultIconSize,
double iconButtonFactor = kDefaultIconButtonFactor,
QuillIconTheme? iconTheme,
]) {
final isEnabled = onPressed != null;
return QuillToolbarIconButton(
icon: Icon(
icon,
size: iconSize * iconButtonFactor,
),
isSelected: isEnabled ? isToggled == true : false,
onPressed: onPressed,
afterPressed: afterPressed,
iconTheme: iconTheme,
);
}