TestViewConfiguration class

A ViewConfiguration that pretends the display is of a particular size (in logical pixels).

The resulting ViewConfiguration maps the given size onto the actual display using the BoxFit.contain algorithm.

If the underlying FlutterView changes, a new TestViewConfiguration should be created. See RendererBinding.handleMetricsChanged and RendererBinding.createViewConfigurationFor.

Implemented types

Constructors

TestViewConfiguration({Size size = _kDefaultTestViewportSize, FlutterView? window})
Deprecated. Will be removed in a future version of Flutter.
factory
TestViewConfiguration.fromView({required FlutterView view, Size size = _kDefaultTestViewportSize})
Creates a TestViewConfiguration with the given size and view.

Properties

devicePixelRatio double
The pixel density of the output surface.
final
hashCode int
The hash code for this object.
no setterinherited
logicalConstraints BoxConstraints
The constraints of the output surface in logical pixel.
final
physicalConstraints BoxConstraints
The constraints of the output surface in physical pixel.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldUpdateMatrix(ViewConfiguration oldConfiguration) bool
Returns whether toMatrix would return a different value for this configuration than it would for the given oldConfiguration.
override
toMatrix() Matrix4
Creates a transformation matrix that applies the devicePixelRatio.
override
toPhysicalSize(Size logicalSize) Size
Transforms the provided Size in logical pixels to physical pixels.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited