getDisabledColor method
Color?
getDisabledColor(
- BuildContext context, {
- FastButtonEmphasis? emphasis,
- bool isEnabled = true,
- Color? disabledColor,
- Color? color,
- Widget? icon,
Implementation
Color? getDisabledColor(
BuildContext context, {
FastButtonEmphasis? emphasis,
bool isEnabled = true,
Color? disabledColor,
Color? color,
Widget? icon,
}) {
if (disabledColor != null) return disabledColor;
if (color != null) return color.withAlpha(kDisabledAlpha);
if ((icon is FaIcon) && icon.color != null) {
return icon.color!.withAlpha(kDisabledAlpha);
}
if ((icon is Icon) && icon.color != null) {
return icon.color!.withAlpha(kDisabledAlpha);
}
return getEmphasisedColor(context, emphasis: emphasis)
?.withAlpha(kDisabledAlpha);
}