titleTextColor method

  1. @override
Color titleTextColor(
  1. BuildContext context, {
  2. Set<MaterialState>? materialStates,
  3. Map<String, dynamic>? extraInfo,
})
override

Implementation

@override
Color titleTextColor(BuildContext context, {Set<MaterialState>? materialStates, Map<String, dynamic>? extraInfo}) {
  materialStates ??= <MaterialState>{};

  if (materialStates.isPressed) {
    return Colors.white;
  } else if (materialStates.isHovering || materialStates.isFocused) {
    return Colors.white.withAlpha(100);
  } else if (materialStates.isSelected) {
    return Colors.white.withAlpha(200);
  } else if (materialStates.isDisabled) {
    return Colors.white;
  } else {
    // isNormal
    return Colors.white;
  }
}