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,
this.afterPressed,
this.tooltip,
this.padding,
super.key,
});
@ -15,14 +16,20 @@ class QuillToolbarIconButton extends StatelessWidget {
final Widget icon;
final String? tooltip;
final EdgeInsets? padding;
final bool isFilled;
@override
Widget build(BuildContext context) {
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(
padding: (padding != null) ? padding : null,
constraints: BoxConstraints(),
onPressed: () {
onPressed?.call();
afterPressed?.call();

Loading…
Cancel
Save