DimenMetrics class

EN: A value snapshot, not a process-wide mutable "current screen". The constructor contains only the inputs that affect a result; derived factors are calculated once when the snapshot is created. Equality is therefore an exact cache-partition key.

PT: Um snapshot de valores, não uma "tela atual" mutável do processo. O construtor contém apenas as entradas que afetam o resultado; os fatores derivados são calculados uma única vez na criação do snapshot. Portanto, a igualdade funciona como chave exata de partição de cache.

Constructors

DimenMetrics({required int screenWidthDp, required int screenHeightDp, required int smallestScreenWidthDp, required int densityDpi, double fontScale = 1.0, int orientation = ScreenConfiguration.orientationUndefined, int uiMode = 0, bool isInMultiWindowMode = false, ScreenConfiguration? configuration})
DimenMetrics.from(ScreenConfiguration configuration, {bool isInMultiWindowMode = false})
Builds the metrics from a ScreenConfiguration.
factory

Properties

aspectRatioSlope → double
Shared AR slope adjScale + k_default · lnAR — hoists one multiply-add out of every per-axis AR factor computation.
no setter
autoHeightFactor → double
Auto HEIGHT-axis factor.
no setter
autoScale → double
Auto satellite smallest-width scale (flat below the transition point, log-curved above).
no setter
autoWidthFactor → double
Auto WIDTH-axis factor.
no setter
configuration → ScreenConfiguration
The configuration this snapshot was derived from (identity helper for the engine; excluded from equality because every field already is).
final
defaultAspectRatioMultiplier → double
1 + k_default · lnAR.
no setter
defaultScaledAspectRatioMultiplier → double
1 + (sw − 300) × (adjScale + k_default · lnAR).
no setter
density → double
dpi / 160, guarded to a finite positive value.
no setter
densityDpi → int
final
diagonalScale → double
√(min² + max²) / 611.6305 — diagonal satellite default-path scale.
no setter
fillScale → double
max(minDp/300, maxDp/533) — fill (cover) scale.
no setter
fitScale → double
min(minDp/300, maxDp/533) — fit (contain) scale.
no setter
fontScale → double
The configured font scale, normalized to a safe value.
no setter
hashCode → int
The hash code for this object.
no setteroverride
interpolatedScale → double
1 + (sw/300 − 1) × 0.5 — interpolated satellite default-path scale.
no setter
isInMultiWindowMode → bool
final
isLandscape → bool
True when the raw orientation code is landscape (2).
no setter
isPortrait → bool
True when the raw orientation code is portrait (1).
no setter
logarithmicHeightFactor → double
Logarithmic HEIGHT-axis factor (piecewise ±slope·ln).
no setter
logarithmicScale → double
Logarithmic satellite default-path scale (piecewise ±0.4·ln).
no setter
logarithmicWidthFactor → double
Logarithmic WIDTH-axis factor (piecewise ±slope·ln).
no setter
logNormalizedAspectRatio → double
Exact natural logarithm — computed once when the snapshot is created.
no setter
maxDimensionDp → double
no setter
minDimensionDp → double
Current window bounds in dp — min/max sides, clamped at zero.
no setter
normalizedAspectRatio → double
max/min normalized by the 1.78 reference ratio, guarded to finite > 0.
no setter
orientation → int
final
perimeterScale → double
(min + max) / 833 — perimeter satellite default-path scale.
no setter
powerHeightFactor → double
(h / 300)^0.75 — power HEIGHT-axis factor.
no setter
powerScale → double
(sw / 300)^0.75 — power satellite default-path scale.
no setter
powerWidthFactor → double
(w / 300)^0.75 — power WIDTH-axis factor.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → double
sw / 300 — the scaled default-path factor (plain field read: no late-initialization check on the hot lane).
no setter
screenHeightDp → int
final
screenHeightFactor → double
Precomputed HEIGHT factor: h × 1/300.
no setter
screenWidthDp → int
final
screenWidthFactor → double
Precomputed WIDTH factor: w × 1/300.
no setter
smallestScreenWidthDp → int
final
smallestWidthDp → double
Keeps the historical sw contract while remaining well-defined for synthetic/test configurations where it is undefined.
no setter
uiMode → int
final

Methods

aspectRatioMultiplier(double? customSensitivityK) → double
Multiplier shared by satellite strategies that apply AR after their base formula.
fastScaledMultiplier(DpQualifier qualifier, bool applyAspectRatio) → double
Fast-lane kernel: the multiplier for qualifier honoring AR.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scaledMultiplier(bool applyAspectRatio, double? customSensitivityK) → double
Multiplier used by the scaled SDP/SSP path. Invalid sensitivities are rejected instead of leaking NaN or infinity into a layout.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Properties

baseline → DimenMetrics
Baseline snapshot (300 × 533 @ 160dpi, fs 1.0, undefined orientation).
final