Class that programmatically interacts with widgets and the test environment.

For convenience, instances of this class (such as the one provided by testWidget) can be used as the vsync for AnimationController objects.

Inheritance
Implements

Properties

binding TestWidgetsFlutterBinding
The binding instance used by the testing framework.
@override, read-only
hasRunningAnimations bool
Whether there are any any transient callbacks scheduled. [...]
read-only
testTextInput TestTextInput
Returns the TestTextInput singleton. [...]
read-only
allElements Iterable<Element>
All elements currently in the widget tree (lazy pre-order traversal). [...]
read-only, inherited
allRenderObjects Iterable<RenderObject>
Render objects of all the widgets currently in the widget tree (lazy pre-order traversal). [...]
read-only, inherited
allStates Iterable<State>
All states currently in the widget tree (lazy pre-order traversal). [...]
read-only, inherited
allWidgets Iterable<Widget>
All widgets currently in the widget tree (lazy pre-order traversal). [...]
read-only, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
layers List<Layer>
Returns a list of all the Layer objects in the rendering.
read-only, inherited
nextPointer int
The next available pointer identifier. [...]
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createTicker(TickerCallback onTick) Ticker
Creates a ticker with the given callback. [...]
dispatchEvent(PointerEvent event, HitTestResult result) → void
Handler for device events caught by the binding in live test mode.
enterText(Finder finder, String text) Future<Null>
Give the text input widget specified by finder the focus and enter text as if it been provided by the onscreen keyboard. [...]
hitTestOnBinding(Offset location) HitTestResult
Forwards the given location to the binding's hitTest logic.
idle() Future<Null>
Acts as if the application went idle. [...]
pump([Duration duration, EnginePhase phase = EnginePhase.sendSemanticsUpdate ]) Future<Null>
Triggers a frame after duration amount of time. [...]
pumpAndSettle([Duration duration = const Duration(milliseconds: 100), EnginePhase phase = EnginePhase.sendSemanticsUpdate, Duration timeout = const Duration(minutes: 10) ]) Future<int>
Repeatedly calls pump with the given duration until there are no longer any frames scheduled. This will call pump at least once, even if no frames are scheduled when the function is called, to flush any pending microtasks which may themselves schedule a frame. [...]
pumpWidget(Widget widget, [ Duration duration, EnginePhase phase = EnginePhase.sendSemanticsUpdate ]) Future<Null>
Renders the UI from the given widget. [...]
sendEventToBinding(PointerEvent event, HitTestResult result) Future<Null>
Forwards the given pointer event to the binding.
showKeyboard(Finder finder) Future<Null>
Give the text input widget specified by finder the focus, as if the onscreen keyboard had appeared. [...]
takeException() → dynamic
Returns the exception most recently caught by the Flutter framework. [...]
verifyTickersWereDisposed([String when = 'when none should have been' ]) → void
Throws an exception if any tickers created by the WidgetTester are still active when the method is called. [...]
any(Finder finder) bool
Checks if finder exists in the tree.
inherited
drag(Finder finder, Offset offset, { int pointer }) Future<Null>
Attempts to drag the given widget by the given offset, by starting a drag in the middle of the widget. [...]
inherited
dragFrom(Offset startLocation, Offset offset, { int pointer }) Future<Null>
Attempts a drag gesture consisting of a pointer down, a move by the given offset, and a pointer up. [...]
inherited
element<T extends Element>(Finder finder) → T
The matching element in the widget tree. [...]
inherited
elementList<T extends Element>(Finder finder) Iterable<T>
The matching elements in the widget tree. [...]
inherited
firstElement<T extends Element>(Finder finder) → T
The first matching element according to a depth-first pre-order traversal of the widget tree. [...]
inherited
firstRenderObject<T extends RenderObject>(Finder finder) → T
The render object of the first matching widget according to a depth-first pre-order traversal of the widget tree. [...]
inherited
firstState<T extends State>(Finder finder) → T
The first matching state according to a depth-first pre-order traversal of the widget tree. [...]
inherited
firstWidget<T extends Widget>(Finder finder) → T
The first matching widget according to a depth-first pre-order traversal of the widget tree. [...]
inherited
fling(Finder finder, Offset offset, double speed, { int pointer, Duration frameInterval: const Duration(milliseconds: 16) }) Future<Null>
Attempts a fling gesture starting from the center of the given widget, moving the given distance, reaching the given speed. [...]
inherited
flingFrom(Offset startLocation, Offset offset, double speed, { int pointer, Duration frameInterval: const Duration(milliseconds: 16) }) Future<Null>
Attempts a fling gesture starting from the given location, moving the given distance, reaching the given speed. [...]
inherited
getBottomLeft(Finder finder) Offset
Returns the point at the bottom left of the given widget. This point is not inside the object's hit test area.
inherited
getBottomRight(Finder finder) Offset
Returns the point at the bottom right of the given widget. This point is not inside the object's hit test area.
inherited
getCenter(Finder finder) Offset
Returns the point at the center of the given widget.
inherited
getSize(Finder finder) Size
Returns the size of the given widget. This is only valid once the widget's render object has been laid out at least once.
inherited
getTopLeft(Finder finder) Offset
Returns the point at the top left of the given widget.
inherited
getTopRight(Finder finder) Offset
Returns the point at the top right of the given widget. This point is not inside the object's hit test area.
inherited
longPress(Finder finder, { int pointer }) Future<Null>
Dispatch a pointer down / pointer up sequence (with a delay of kLongPressTimeout + kPressTimeout between the two events) at the center of the given widget, assuming it is exposed. [...]
inherited
longPressAt(Offset location, { int pointer }) Future<Null>
Dispatch a pointer down / pointer up sequence at the given location with a delay of kLongPressTimeout + kPressTimeout between the two events.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
renderObject<T extends RenderObject>(Finder finder) → T
The render object of the matching widget in the widget tree. [...]
inherited
renderObjectList<T extends RenderObject>(Finder finder) Iterable<T>
The render objects of the matching widgets in the widget tree. [...]
inherited
startGesture(Offset downLocation, { int pointer }) Future<TestGesture>
Begins a gesture at a particular point, and returns the TestGesture object which you can use to continue the gesture.
inherited
state<T extends State>(Finder finder) → T
The matching state in the widget tree. [...]
inherited
stateList<T extends State>(Finder finder) Iterable<T>
The matching states in the widget tree. [...]
inherited
tap(Finder finder, { int pointer }) Future<Null>
Dispatch a pointer down / pointer up sequence at the center of the given widget, assuming it is exposed. [...]
inherited
tapAt(Offset location, { int pointer }) Future<Null>
Dispatch a pointer down / pointer up sequence at the given location.
inherited
toString() String
Returns a string representation of this object.
inherited
widget<T extends Widget>(Finder finder) → T
The matching widget in the widget tree. [...]
inherited
widgetList<T extends Widget>(Finder finder) Iterable<T>
The matching widgets in the widget tree. [...]
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited