walletTextScaleForcesStack function
Whether the OS text scale alone forces the trailing element onto its own line.
Probes the BODY text size, not an arbitrary large one. TextScaler.scale
is size-dependent by contract, and on Android 14+ MediaQuery.textScalerOf
returns SystemTextScaler, which forwards to the platform's NON-LINEAR
curve — that curve boosts small text more than large. Probing at font size
100 therefore under-reports what the row's real (body-sized) text is doing
and the stack engages late, or not at all, on precisely the devices whose
users need it. labeled_zat_row.dart documented that reasoning first; this
is the same probe, shared.
Implementation
bool walletTextScaleForcesStack(BuildContext context) {
final refSize = Theme.of(context).textTheme.bodyMedium?.fontSize ?? 14.0;
return MediaQuery.textScalerOf(context).scale(refSize) >
refSize * kWalletStackTextScale;
}