Disabled IconButtons render correctly

This commit is contained in:
Hans Muller 2016-02-26 16:33:05 -08:00
parent c56be8efba
commit faf55dda79
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

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