TestFlutterView class
A FlutterView that wraps another FlutterView and allows faking of some properties for testing purposes.
This class should not be instantiated manually, as it requires a backing FlutterView that must be produced from a PlatformDispatcher.
See also:
- WidgetTester.view which allows for accessing the TestFlutterView for single view applications or widget testing.
- WidgetTester.viewOf which allows for accessing the appropriate TestFlutterView in a given situation for multi-view applications.
- TestPlatformDispatcher, which allows for faking of platform specific functionality.
- Implemented types
Constructors
- TestFlutterView({required FlutterView view, required TestPlatformDispatcher platformDispatcher, required TestDisplay display})
- Constructs a TestFlutterView that defers all behavior to the given FlutterView unless explicitly overridden for testing.
Properties
- devicePixelRatio ↔ double
-
The device pixel ratio to use for this test.
getter/setter pairoverride-getter
- display → TestDisplay
-
The Display this view is drawn in.
no setteroverride
-
displayFeatures
↔ List<
DisplayFeature> -
The display features to use for this test.
getter/setter pairoverride-getter
- gestureSettings ↔ GestureSettings
-
The gesture settings to use for this test.
getter/setter pairoverride-getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- padding ↔ FakeViewPadding
-
The padding to use for this test.
getter/setter pairoverride-getter
- physicalConstraints ↔ ViewConstraints
-
The physical constraints to use for this test.
getter/setter pairoverride-getter
- physicalSize ↔ Size
-
The physical size to use for this test.
getter/setter pairoverride-getter
- platformDispatcher → TestPlatformDispatcher
-
The platform dispatcher that this view is registered with, and gets its
information from.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemGestureInsets ↔ FakeViewPadding
-
The system gesture insets to use for this test.
getter/setter pairoverride-getter
- viewId → int
-
The opaque ID for this view.
no setteroverride
- viewInsets ↔ FakeViewPadding
-
The view insets to use for this test.
getter/setter pairoverride-getter
- viewPadding ↔ FakeViewPadding
-
The view padding to use for this test.
getter/setter pairoverride-getter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
This gives us some grace time when the dart:ui side adds something to
FlutterView, and makes things easier when we do rolls to give
us time to catch up.
override
-
render(
Scene scene, {Size? size}) → void -
Updates the view's rendering on the GPU with the newly provided Scene.
override
-
reset(
) → void - Resets all test values to the defaults for this view.
-
resetDevicePixelRatio(
) → void - Resets devicePixelRatio for this test view to the default value for this view.
-
resetDisplayFeatures(
) → void - Resets displayFeatures to the default values for this view.
-
resetGestureSettings(
) → void - Resets gestureSettings to the default value for this view.
-
resetPadding(
) → void - Resets padding to the default value for this view.
-
resetPhysicalConstraints(
) → void - Resets physicalConstraints to the default value for this view.
-
resetPhysicalSize(
) → void - Resets physicalSize (and implicitly also the physicalConstraints) to the default value for this view.
-
resetSystemGestureInsets(
) → void - Resets systemGestureInsets to the default value for this view.
-
resetViewInsets(
) → void - Resets viewInsets to the default value for this view.
-
resetViewPadding(
) → void - Resets viewPadding to the default value for this view.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateSemantics(
SemanticsUpdate update) → void -
Change the retained semantics data about this FlutterView.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited