defaultToggleStyleButtonBuilder function

Widget defaultToggleStyleButtonBuilder(
  1. BuildContext context,
  2. Attribute attribute,
  3. IconData icon,
  4. bool? isToggled,
  5. VoidCallback? onPressed,
  6. VoidCallback? afterPressed, [
  7. double iconSize = kDefaultIconSize,
  8. double iconButtonFactor = kDefaultIconButtonFactor,
  9. 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,
  );
}