Update quill_icon_button.dart

Add padding property to icon buttons
pull/1592/head
mark8044 1 year ago committed by GitHub
parent e063afe61d
commit 33b5987ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      lib/src/widgets/toolbar/buttons/quill_icon_button.dart

@ -7,6 +7,7 @@ class QuillToolbarIconButton extends StatelessWidget {
required this.isFilled, required this.isFilled,
this.afterPressed, this.afterPressed,
this.tooltip, this.tooltip,
this.padding,
super.key, super.key,
}); });
@ -15,14 +16,20 @@ class QuillToolbarIconButton extends StatelessWidget {
final Widget icon; final Widget icon;
final String? tooltip; final String? tooltip;
final EdgeInsets? padding;
final bool isFilled; final bool isFilled;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (isFilled) { if (isFilled) {
return IconButton.filled(onPressed: onPressed, icon: icon); return IconButton.filled(
padding: (padding != null) ? padding : null,
constraints: BoxConstraints(),
onPressed: onPressed, icon: icon);
} }
return IconButton( return IconButton(
padding: (padding != null) ? padding : null,
constraints: BoxConstraints(),
onPressed: () { onPressed: () {
onPressed?.call(); onPressed?.call();
afterPressed?.call(); afterPressed?.call();

Loading…
Cancel
Save