Rich text editor for Flutter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
892 B

import 'package:flutter/material.dart';
class QuillToolbarIconButton extends StatelessWidget {
const QuillToolbarIconButton({
required this.onPressed,
required this.icon,
required this.isFilled,
this.afterPressed,
this.tooltip,
this.padding,
super.key,
});
final VoidCallback? onPressed;
final VoidCallback? afterPressed;
final Widget icon;
final String? tooltip;
final EdgeInsets? padding;
final bool isFilled;
@override
Widget build(BuildContext context) {
if (isFilled) {
return IconButton.filled(
padding: padding,
constraints: const BoxConstraints(),
onPressed: onPressed, icon: icon);
}
return IconButton(
padding: padding,
constraints: const BoxConstraints(),
onPressed: () {
onPressed?.call();
afterPressed?.call();
},
icon: icon,
);
}
}