debugOverrideVersions static method

  1. @visibleForTesting
void debugOverrideVersions({
  1. int? iosVersion,
  2. int? macOSVersion,
})

Pretends the running OS has these major versions, so a test can check the version gates (e.g. macOS 15, where shouldUseNativeGlass is false but shouldUseNativeControls is true). Platform itself is not changed. Call reset afterwards.

Implementation

@visibleForTesting
static void debugOverrideVersions({int? iosVersion, int? macOSVersion}) {
  _cachedIOSVersion = iosVersion;
  _cachedMacOSVersion = macOSVersion;
  _isInitialized = true;
}