getColor method

Color? getColor(
  1. BuildContext context, {
  2. FastButtonEmphasis? emphasis,
  3. bool isEnabled = true,
  4. Color? disabledColor,
  5. Color? color,
  6. Widget? icon,
})

Implementation

Color? getColor(
  BuildContext context, {
  FastButtonEmphasis? emphasis,
  bool isEnabled = true,
  Color? disabledColor,
  Color? color,
  Widget? icon,
}) {
  if (!isEnabled) {
    return getDisabledColor(
      context,
      disabledColor: disabledColor,
      isEnabled: isEnabled,
      emphasis: emphasis,
      color: color,
      icon: icon,
    );
  }

  if (color != null) return color;

  if ((icon is FaIcon) && icon.color != null) return icon.color!;

  if ((icon is Icon) && icon.color != null) return icon.color!;

  return getEmphasisedColor(context, emphasis: emphasis);
}