Commit faf55dda authored by Hans Muller's avatar Hans Muller

Disabled IconButtons render correctly

parent c56be8ef
...@@ -84,7 +84,7 @@ class Icon extends StatelessComponent { ...@@ -84,7 +84,7 @@ class Icon extends StatelessComponent {
final int iconAlpha = (255.0 * (IconTheme.of(context)?.clampedOpacity ?? 1.0)).round(); final int iconAlpha = (255.0 * (IconTheme.of(context)?.clampedOpacity ?? 1.0)).round();
if (iconAlpha != 255) { if (iconAlpha != 255) {
if (color != null) { if (color != null) {
iconColor = color.withAlpha(iconAlpha); iconColor = color.withAlpha((iconAlpha * color.opacity).round());
} else { } else {
switch(iconThemeColor) { switch(iconThemeColor) {
case IconThemeColor.black: case IconThemeColor.black:
......
...@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart'; ...@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
import 'icon.dart'; import 'icon.dart';
import 'icon_theme_data.dart'; import 'icon_theme_data.dart';
import 'ink_well.dart'; import 'ink_well.dart';
import 'theme.dart';
import 'tooltip.dart'; import 'tooltip.dart';
/// A material design "icon button". /// A material design "icon button".
...@@ -47,7 +48,7 @@ class IconButton extends StatelessComponent { ...@@ -47,7 +48,7 @@ class IconButton extends StatelessComponent {
size: size, size: size,
icon: icon, icon: icon,
colorTheme: colorTheme, colorTheme: colorTheme,
color: color color: onPressed != null ? color : Theme.of(context).disabledColor
) )
); );
if (tooltip != null) { if (tooltip != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment