TestViewConfiguration.fromView constructor
- required FlutterView view,
- Size size = _kDefaultTestViewportSize,
Creates a TestViewConfiguration with the given size and view.
The size
defaults to 800x600.
The settings of the given FlutterView are captured when the constructor is called, and subsequent changes are ignored. A new TestViewConfiguration should be created if the underlying FlutterView changes. See RendererBinding.handleMetricsChanged and RendererBinding.createViewConfigurationFor.
Implementation
TestViewConfiguration.fromView({
required ui.FlutterView view,
Size size = _kDefaultTestViewportSize,
}) : devicePixelRatio = view.devicePixelRatio,
logicalConstraints = BoxConstraints.tight(size),
physicalConstraints = BoxConstraints.tight(size) * view.devicePixelRatio,
_paintMatrix = _getMatrix(size, view.devicePixelRatio, view),
_physicalSize = view.physicalSize;