value static method
double
value(
- double base,
- StrategyFormula formula,
- DpQualifier qualifier,
- Inverter inverter, {
- bool ignoreMultiWindows = false,
- bool applyAspectRatio = false,
- double? customSensitivityK,
- CalcType calcType = CalcType.auto,
- ValueType valueType = ValueType.dp,
Logical-dp value through the published scope.
Implementation
static double value(
double base,
StrategyFormula formula,
DpQualifier qualifier,
Inverter inverter, {
bool ignoreMultiWindows = false,
bool applyAspectRatio = false,
double? customSensitivityK,
CalcType calcType = CalcType.auto,
ValueType valueType = ValueType.dp,
}) {
final m = AppDimensScope.metricsOrDefault;
if (ignoreMultiWindows && m.isInMultiWindowMode) {
return _unitConvert(base, m, valueType);
}
final effectiveQ = DimenCalculationPlumbing.effectiveQualifier(
qualifier,
inverter,
m.isLandscape,
m.isPortrait,
);
final computed =
formula(base, m, effectiveQ, applyAspectRatio, customSensitivityK);
return _unitConvertSp(computed, m, valueType);
}