physicalSize property

  1. @override
Size physicalSize
override

The physical size to use for this test.

Defaults to the value provided by FlutterView.physicalSize. This can only be set in a test environment to emulate different view configurations. A standard FlutterView is not mutable from the framework.

This property and physicalGeometry are dependent on one another. If both properties are set through their test setters, the final result will be that physicalGeometry determines the location and physicalSize determines the size of the physicalGeometry Rect. If only physicalSize is set, the final result is that the default value of physicalGeometry determines the location and physicalSize determines the size of the physicalGeometry Rect. If only physicalGeometry is set, it will determine both the location and size of the physicalGeometry Rect.

See also:

Implementation

@override
Size get physicalSize {
  // This has to be able to default to `_view.physicalSize` as web_ui handles
  // `physicalSize` and `physicalGeometry` differently than dart:ui, where
  // the values are both based off of `physicalGeometry`.
  return _physicalSize ?? _physicalGeometry?.size ?? _view.physicalSize;
}
void physicalSize=(Size value)

Implementation

set physicalSize(Size value) {
  _physicalSize = value;
  platformDispatcher.onMetricsChanged?.call();
}