Results for “WidgetTester”
Full-text search across Boring Doc explanations, official documentation pages, the Flutter API index and every indexed version change.
Concepts
- Testing3.47.7testing
unit tests (package:test) for plain Dart logic, widget tests (flutter_test: testWidgets, WidgetTester, find, matchers) that build real widgets in a fast headless environment, and integration
- Accessibility3.47.7accessibility
Flutter builds a semantics tree next to the render tree and hands
Guides
- An introduction to widget testingdoc
flutter_test package provides the following tools for testing widgets: The WidgetTester allows building and interacting with widgets in a test environment. The testWidgets() function automatically creates
- Tap, drag, and enter textdoc
simulate them in the test environment. For this purpose, use the WidgetTester library. The WidgetTester provides methods for entering text, tapping, and dragging. enterText() tap() drag
- Handle scrollingdoc
scroll through lists using the widget tests, use the methods provided by the WidgetTester class, which is included in the flutter_test package: In this recipe, learn
Version changes
- Deprecated the window singleton3.10.0deprecated
In preparation for supporting multiple views and multiple windows, the `window` singleton
- Change the enterText method to move the caret to the end of the input text2.5.0breaking
WidgetTester.enterText` and `TestTextInput.enterText` methods now move the caret to the end of the input text. In addition to replacing the text with the supplied text, `WidgetTester.enterText` and `TestTextInput.enterText
- Transition of platform channel test interfaces to flutter_test package2.5.0breaking
migrate most code. These shim APIs are deprecated, however. Instead, in code using `WidgetTester` (for example, using `testWidgets`), it is recommended to use the following patterns
- TestTextInput state reset1.17.0breaking
system's onscreen keyboard, is now reset between tests. The state of `WidgetTester.testTextInput` is now reset before running a `testWidgets` test. The Flutter test framework uses a class
- TestWidgetsFlutterBinding.clock1.20.0breaking
function tearoff to the `Clock` constructor: Code before migration: ```dart testWidgets('some test', (WidgetTester tester) { someApiThatWantsAQuiverClock(tester.binding.clock); }); ``` Code after migration: ```dart testWidgets('some test', (WidgetTester tester
- The default page transition on Android is now PredictiveBackPageTransitionBuilder3.38.0breaking
The default page transition on Android has been updated from `ZoomPageTransitionsBuilder` to
- Container color optimization1.17.0breaking
BoxDecoration` need to be modified. Code before migration: ```dart testWidgets('Container color', (WidgetTester tester) async { await tester.pumpWidget(Container(color: Colors.red)); final Container container = tester.widgetList ().first; expect(container.decoration.color
- Replace AnimationSheetBuilder.display with collate2.5.0breaking
The `AnimationSheetBuilder.display` and `sheetSize` methods are deprecated, and should be replaced with
- Semantics Order of the Overlay Entries in Modal Routes1.20.0breaking
test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:material_ui/material_ui.dart'; void main() { testWidgets('example test', (WidgetTester tester) async { final SemanticsHandle handle
- Deprecated API removed after v3.133.16.0removed
GlowingOverscrollIndicator StretchingOvercrollIndicator ThemeData.useMaterial3 StretchingOverscrollIndicator PaintingBinding ImageProvider DecoderCallback PaintingBinding.instantiateImageCodec PaintingBinding.instantiateImageCodecFromBuffer ImageProvider.load ImageProvider.loadBuffer DecoderBufferCallback TestWindow WidgetTester TestWidgetsFlutterBinding TestPlatformDispatcher