Преглед на файлове

Reduce colors for icons too

Manav преди 2 години
родител
ревизия
ab43dd54db
променени са 2 файла, в които са добавени 13 реда и са изтрити 2 реда
  1. 6 0
      lib/ui/components/expandable_menu_item_widget.dart
  2. 7 2
      lib/ui/components/menu_item_widget.dart

+ 6 - 0
lib/ui/components/expandable_menu_item_widget.dart

@@ -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,
               ),

+ 7 - 2
lib/ui/components/menu_item_widget.dart

@@ -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(),
         ],