detect method
T?
detect(})
Implementation
T? detect(
bool activated, {
bool enabled = true,
bool error = false,
bool focused = false,
bool hover = false,
bool valid = false,
}) {
if (enabled) {
if (hover) {
return this.hover ?? secondary ?? primary;
} else if (error) {
if (focused) {
return this.error ?? secondary ?? primary;
} else {
return primary ?? this.error;
}
} else if (valid) {
if (focused) {
return this.valid ?? secondary ?? primary;
} else {
return primary ?? this.valid;
}
} else if (activated) {
return secondary ?? primary;
} else {
return primary;
}
} else {
return disable ?? ternary ?? primary;
}
}