physicalSize property
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:
- FlutterView.physicalSize for the standard implementation
- resetPhysicalSize to reset this value specifically
- reset to reset all test values for this view
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;
}
Implementation
set physicalSize(Size value) {
_physicalSize = value;
platformDispatcher.onMetricsChanged?.call();
}