debugEmulateFlutterTesterEnvironment top-level property

bool debugEmulateFlutterTesterEnvironment

Whether the Flutter engine is running in flutter test emulation mode.

When true, the engine will emulate a specific screen size, and always use the "Ahem" font to reduce test flakiness and dependence on the test environment.

Implementation

bool get debugEmulateFlutterTesterEnvironment =>
    _debugEmulateFlutterTesterEnvironment;
void debugEmulateFlutterTesterEnvironment=(bool value)

Sets whether the Flutter engine is running in flutter test emulation mode.

Implementation

set debugEmulateFlutterTesterEnvironment(bool value) {
  _debugEmulateFlutterTesterEnvironment = value;
  if (_debugEmulateFlutterTesterEnvironment) {
    const ui.Size logicalSize = ui.Size(800.0, 600.0);
    final EngineFlutterWindow? implicitView = EnginePlatformDispatcher.instance.implicitView;
    implicitView?.debugPhysicalSizeOverride = logicalSize * implicitView.devicePixelRatio;
  }
  debugDisableFontFallbacks = value;
}