Reduce colors for icons too

This commit is contained in:
Manav 2023-01-01 00:03:12 +05:30
parent 0c0aaaa76e
commit ab43dd54db
2 changed files with 13 additions and 2 deletions

View file

@ -71,7 +71,13 @@ class _ExpandableMenuItemWidgetState extends State<ExpandableMenuItemWidget> {
),
isExpandable: true,
leadingIcon: widget.leadingIcon,
leadingIconColor: isSuppressed
? enteColorScheme.strokeMuted
: enteColorScheme.strokeBase,
trailingIcon: Icons.expand_more,
trailingIconColor: isSuppressed
? enteColorScheme.strokeMuted
: enteColorScheme.strokeBase,
menuItemColor: enteColorScheme.fillFaint,
expandableController: expandableController,
),

View file

@ -18,6 +18,7 @@ class MenuItemWidget extends StatefulWidget {
/// trailing icon can be passed without size as default size set by
/// flutter is what this component expects
final IconData? trailingIcon;
final Color? trailingIconColor;
final Widget? trailingWidget;
final bool trailingIconIsMuted;
final VoidCallback? onTap;
@ -41,6 +42,7 @@ class MenuItemWidget extends StatefulWidget {
this.leadingIconSize = 20.0,
this.leadingIconWidget,
this.trailingIcon,
this.trailingIconColor,
this.trailingWidget,
this.trailingIconIsMuted = false,
this.onTap,
@ -167,7 +169,10 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
switchInCurve: Curves.easeOut,
child: isExpanded
? const SizedBox.shrink()
: Icon(widget.trailingIcon),
: Icon(
widget.trailingIcon,
color: widget.trailingIconColor,
),
),
)
: widget.trailingIcon != null
@ -175,7 +180,7 @@ class _MenuItemWidgetState extends State<MenuItemWidget> {
widget.trailingIcon,
color: widget.trailingIconIsMuted
? enteColorScheme.strokeMuted
: null,
: widget.trailingIconColor,
)
: widget.trailingWidget ?? const SizedBox.shrink(),
],