From faf55dda793da4b709ce2e80c3a90bf61de9e227 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Fri, 26 Feb 2016 16:33:05 -0800 Subject: [PATCH] Disabled IconButtons render correctly --- packages/flutter/lib/src/material/icon.dart | 2 +- packages/flutter/lib/src/material/icon_button.dart | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/material/icon.dart b/packages/flutter/lib/src/material/icon.dart index 3c8873ccf6a..9548ebd8d0b 100644 --- a/packages/flutter/lib/src/material/icon.dart +++ b/packages/flutter/lib/src/material/icon.dart @@ -84,7 +84,7 @@ class Icon extends StatelessComponent { final int iconAlpha = (255.0 * (IconTheme.of(context)?.clampedOpacity ?? 1.0)).round(); if (iconAlpha != 255) { if (color != null) { - iconColor = color.withAlpha(iconAlpha); + iconColor = color.withAlpha((iconAlpha * color.opacity).round()); } else { switch(iconThemeColor) { case IconThemeColor.black: diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index 85adc34b6a5..58353f63679 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart'; import 'icon.dart'; import 'icon_theme_data.dart'; import 'ink_well.dart'; +import 'theme.dart'; import 'tooltip.dart'; /// A material design "icon button". @@ -47,7 +48,7 @@ class IconButton extends StatelessComponent { size: size, icon: icon, colorTheme: colorTheme, - color: color + color: onPressed != null ? color : Theme.of(context).disabledColor ) ); if (tooltip != null) {