value static method

double value(
  1. double base,
  2. StrategyFormula formula,
  3. DpQualifier qualifier,
  4. Inverter inverter, {
  5. bool ignoreMultiWindows = false,
  6. bool applyAspectRatio = false,
  7. double? customSensitivityK,
  8. CalcType calcType = CalcType.auto,
  9. 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);
}