calculateBackgroundColor function
Color
calculateBackgroundColor(
- Color backgroundColor, {
- bool isActive = false,
- bool isDisabled = false,
- bool isPlain = false,
})
Implementation
Color calculateBackgroundColor(
Color backgroundColor, {
bool isActive = false,
bool isDisabled = false,
bool isPlain = false,
}) {
if (isPlain) {
if (isDisabled) {
return backgroundColor.withValues(alpha: 0.1);
}
if (isActive) {
return backgroundColor.withValues(alpha: 0.8);
}
return backgroundColor.withValues(alpha: 0.1);
} else {
if (isDisabled) {
return backgroundColor.withValues(alpha: 0.4);
}
if (isActive) {
return backgroundColor.withValues(alpha: 0.8);
}
return backgroundColor;
}
}