Skip to content

Commit 4dd4212

Browse files
authored
Add icon color to custom button (singerdmx#1245)
1 parent 94da3cf commit 4dd4212

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/src/models/themes/quill_custom_button.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import 'package:flutter/material.dart';
33
class QuillCustomButton {
44
const QuillCustomButton({
55
this.icon,
6+
this.iconColor,
67
this.onTap,
78
this.tooltip,
89
});
910

1011
///The icon widget
1112
final IconData? icon;
1213

14+
///The icon color;
15+
final Color? iconColor;
16+
1317
///The function when the icon is tapped
1418
final VoidCallback? onTap;
1519

lib/src/widgets/toolbar.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,11 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
570570
highlightElevation: 0,
571571
hoverElevation: 0,
572572
size: toolbarIconSize * kIconButtonFactor,
573-
icon: Icon(customButton.icon, size: toolbarIconSize),
573+
icon: Icon(
574+
customButton.icon,
575+
size: toolbarIconSize,
576+
color: customButton.iconColor,
577+
),
574578
tooltip: customButton.tooltip,
575579
borderRadius: iconTheme?.borderRadius ?? 2,
576580
onPressed: customButton.onTap,

0 commit comments

Comments
 (0)