mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Disabled IconButtons render correctly
This commit is contained in:
parent
c56be8efba
commit
faf55dda79
@ -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:
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user