Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- flutter/examples/api/macos/Podfile-1
- flutter/examples/api/pubspec.yaml+57-56
- flutter/examples/api/test/flutter_test_config.dart+1-2
- flutter/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.1_test.dart+3-4
- flutter/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart+3-4
- flutter/examples/api/test/material/bottom_sheet/show_bottom_sheet.0_test.dart+4-4
- flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.0_test.dart+3-4
- flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.1_test.dart+3-4
- flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.2_test.dart+6-5
- flutter/examples/api/test/material/button_style/button_style.0_test.dart+56-56
- flutter/examples/api/test/material/button_style_button/button_style_button.icon_alignment.0_test.dart+7-9
- flutter/examples/api/test/material/card/card.0_test.dart+5-4
- flutter/examples/api/test/material/card/card.2_test.dart+21-19
- flutter/examples/api/test/material/carousel/carousel.0_test.dart+29-6
- flutter/examples/api/test/material/checkbox/checkbox.0_test.dart+8-28
- flutter/examples/api/test/material/checkbox/checkbox.1_test.dart+2-5
- flutter/examples/api/test/material/checkbox_list_tile/checkbox_list_tile.0_test.dart+3-4
- flutter/examples/api/test/material/checkbox_list_tile/checkbox_list_tile.1_test.dart+4-7
- flutter/examples/api/test/material/checkbox_list_tile/custom_labeled_checkbox.0_test.dart+3-4
- flutter/examples/api/test/material/checkbox_list_tile/custom_labeled_checkbox.1_test.dart+3-4
- flutter/examples/api/test/material/chip/chip_attributes.avatar_box_constraints.0_test.dart+24-20
- flutter/examples/api/test/material/chip/chip_attributes.chip_animation_style.0_test.dart+18-17
- flutter/examples/api/test/sample_templates/cupertino.0_test.dart+1-3
- flutter/examples/api/test/sample_templates/material.0_test.dart+1-3
- flutter/examples/api/test/sample_templates/widgets.0_test.dart+1-3
- flutter/examples/api/test/widgets/actions/action.action_overridable.0_test.dart+6-6
- flutter/examples/api/test/widgets/actions/action_listener.0_test.dartAdded+47
- flutter/examples/api/test/widgets/actions/actions.0_test.dart+7-24
- flutter/examples/api/test/widgets/actions/focusable_action_detector.0_test.dartAdded+67
- flutter/examples/api/test/widgets/animated_grid/animated_grid.0_test.dart+2-5
- flutter/examples/api/test/widgets/animated_grid/sliver_animated_grid.0_test.dart+2-5
- flutter/examples/api/test/widgets/animated_list/animated_list.0_test.dartAdded+44
- flutter/examples/api/test/widgets/animated_list/animated_list_separated.0_test.dart+47-47
- flutter/examples/api/test/widgets/animated_list/sliver_animated_list.0_test.dart+34-35
- flutter/examples/api/test/widgets/animated_size/animated_size.0_test.dart+8-25
- flutter/examples/api/test/widgets/animated_switcher/animated_switcher.0_test.dart+5-16
- flutter/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart+1-3
- flutter/examples/api/test/widgets/app_lifecycle_listener/app_lifecycle_listener.0_test.dart+3-4
- flutter/examples/api/test/widgets/app_lifecycle_listener/app_lifecycle_listener.1_test.dart+4-5
- flutter/examples/api/test/widgets/async/future_builder.0_test.dart+2-5
- flutter/examples/api/test/widgets/async/stream_builder.0_test.dart+7-30
- flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.0_test.dart+4-4
- flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.1_test.dart+8-8
- flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.2_test.dart+9-5
- flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.focus_node.0_test.dart+5-13
- flutter/examples/api/test/widgets/autofill/autofill_group.0_test.dartAdded+64
- flutter/examples/api/test/widgets/basic/absorb_pointer.0_test.dart+13-6
- flutter/examples/api/test/widgets/basic/aspect_ratio.0_test.dart+1-3
- flutter/examples/api/test/widgets/basic/aspect_ratio.1_test.dart+1-3
- flutter/examples/api/test/widgets/basic/aspect_ratio.2_test.dart+1-3
27 unmodified lines2829303132333427 unmodified linestarget 'Runner' douse_frameworks!use_modular_headers!flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))end27 unmodified lines28293031323327 unmodified linestarget 'Runner' douse_frameworks!flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))end
6 unmodified lines7891011121314151617181920212223249 unmodified lines3435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495966 unmodified linesversion: 1.0.0environment:sdk: '>=3.2.0-0 <4.0.0'flutter: ">=2.5.0-6.0.pre.30 <3.0.0"dependencies:cupertino_icons: 1.0.6flutter:sdk: fluttercharacters: 1.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"collection: 1.18.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"material_color_utilities: 0.8.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"meta: 1.11.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"vector_math: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"dev_dependencies:9 unmodified linessdk: flutterflutter_web_plugins:sdk: fluttertest: 1.24.9_fe_analyzer_shared: 65.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"analyzer: 6.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"args: 2.4.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"async: 2.11.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"boolean_selector: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"clock: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"convert: 3.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"coverage: 1.7.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"crypto: 3.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"fake_async: 1.3.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"file: 7.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"frontend_server_client: 3.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"glob: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"http_multi_server: 3.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"http_parser: 4.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"intl: 0.18.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"io: 1.0.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"js: 0.6.7 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker: 10.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker_flutter_testing: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker_testing: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"logging: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"matcher: 0.12.16+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"mime: 1.0.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"node_preamble: 2.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"package_config: 2.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"path: 1.9.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"platform: 3.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"pool: 1.5.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"process: 5.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"pub_semver: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf: 1.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_packages_handler: 3.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_static: 1.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_web_socket: 1.0.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_map_stack_trace: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_maps: 0.10.12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_span: 1.10.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"stack_trace: 1.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"stream_channel: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"string_scanner: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"sync_http: 0.3.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"term_glyph: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"test_api: 0.6.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"test_core: 0.5.9 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"typed_data: 1.3.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"vm_service: 13.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"watcher: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"web: 0.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"web_socket_channel: 2.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"webdriver: 3.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"webkit_inspection_protocol: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"yaml: 3.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"flutter:uses-material-design: true# PUBSPEC CHECKSUM: e00b6 unmodified lines7891011121314151617181920212223249 unmodified lines343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596976 unmodified linesversion: 1.0.0environment:sdk: ^3.7.0-0flutter: ">=2.5.0-6.0.pre.30 <3.0.0"dependencies:cupertino_icons: 1.0.8flutter:sdk: fluttercharacters: 1.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"collection: 1.19.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"material_color_utilities: 0.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"meta: 1.16.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"vector_math: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"dev_dependencies:9 unmodified linessdk: flutterflutter_web_plugins:sdk: fluttertest: 1.25.15_fe_analyzer_shared: 80.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"analyzer: 7.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"args: 2.7.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"async: 2.13.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"boolean_selector: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"clock: 1.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"convert: 3.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"coverage: 1.11.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"crypto: 3.0.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"fake_async: 1.3.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"file: 7.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"frontend_server_client: 4.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"glob: 2.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"http_multi_server: 3.2.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"http_parser: 4.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"intl: 0.20.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"io: 1.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"js: 0.7.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker: 10.0.9 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker_flutter_testing: 3.0.9 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"leak_tracker_testing: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"logging: 1.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"matcher: 0.12.17 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"mime: 2.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"node_preamble: 2.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"package_config: 2.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"path: 1.9.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"platform: 3.1.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"pool: 1.5.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"process: 5.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"pub_semver: 2.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf: 1.4.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_packages_handler: 3.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_static: 1.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"shelf_web_socket: 2.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_map_stack_trace: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_maps: 0.10.13 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"source_span: 1.10.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"stack_trace: 1.12.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"stream_channel: 2.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"string_scanner: 1.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"sync_http: 0.3.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"term_glyph: 1.2.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"test_api: 0.7.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"test_core: 0.6.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"typed_data: 1.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"vm_service: 15.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"watcher: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"web: 1.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"web_socket: 0.1.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"web_socket_channel: 3.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"webdriver: 3.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"webkit_inspection_protocol: 1.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"yaml: 3.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"flutter:uses-material-design: true# PUBSPEC CHECKSUM: 2cd7
3 unmodified lines45678910113 unmodified linesimport 'dart:async';import 'goldens_io.dart' if (dart.library.html) 'goldens_web.dart' as flutter_goldens;Future<void> testExecutable(FutureOr<void> Function() testMain) {// Enable golden file testing using Skia Gold.3 unmodified lines456789103 unmodified linesimport 'dart:async';import 'goldens_io.dart' if (dart.library.js_interop) 'goldens_web.dart' as flutter_goldens;Future<void> testExecutable(FutureOr<void> Function() testMain) {// Enable golden file testing using Skia Gold.
2 unmodified lines3456789101112131415162 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_navigation_bar/bottom_navigation_bar.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {await tester.pumpWidget(const example.BottomNavigationBarExampleApp(),);expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);expect(find.byType(BottomNavigationBar), findsOneWidget);2 unmodified lines34567891011121314152 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_navigation_bar/bottom_navigation_bar.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {await tester.pumpWidget(const example.BottomNavigationBarExampleApp());expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);expect(find.byType(BottomNavigationBar), findsOneWidget);
2 unmodified lines3456789101112131415162 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_navigation_bar/bottom_navigation_bar.2.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {await tester.pumpWidget(const example.BottomNavigationBarExampleApp(),);expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);expect(find.byType(BottomNavigationBar), findsOneWidget);2 unmodified lines34567891011121314152 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_navigation_bar/bottom_navigation_bar.2.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('BottomNavigationBar Updates Screen Content', (WidgetTester tester) async {await tester.pumpWidget(const example.BottomNavigationBarExampleApp());expect(find.widgetWithText(AppBar, 'BottomNavigationBar Sample'), findsOneWidget);expect(find.byType(BottomNavigationBar), findsOneWidget);
6 unmodified lines789101112131415166 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Bottom sheet animation can be customized using AnimationStyle', (WidgetTester tester) async {await tester.pumpWidget(const example.BottomSheetExampleApp(),);// Show the bottom sheet with default animation style.await tester.tap(find.widgetWithText(ElevatedButton, 'showBottomSheet'));6 unmodified lines789101112131415166 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Bottom sheet animation can be customized using AnimationStyle', (WidgetTester tester,) async {await tester.pumpWidget(const example.BottomSheetExampleApp());// Show the bottom sheet with default animation style.await tester.tap(find.widgetWithText(ElevatedButton, 'showBottomSheet'));
2 unmodified lines34567891 unmodified line1112131415161718192 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {1 unmodified lineconst String titleText = 'Modal BottomSheet';const String closeText = 'Close BottomSheet';await tester.pumpWidget(const example.BottomSheetApp(),);expect(find.text(titleText), findsNothing);expect(find.text(closeText), findsNothing);2 unmodified lines3456789101 unmodified line121314151617182 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {1 unmodified lineconst String titleText = 'Modal BottomSheet';const String closeText = 'Close BottomSheet';await tester.pumpWidget(const example.BottomSheetApp());expect(find.text(titleText), findsNothing);expect(find.text(closeText), findsNothing);
2 unmodified lines34567891 unmodified line1112131415161718192 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {1 unmodified lineconst String titleText = 'Modal BottomSheet';const String closeText = 'Close BottomSheet';await tester.pumpWidget(const example.BottomSheetApp(),);expect(find.text(titleText), findsNothing);expect(find.text(closeText), findsNothing);2 unmodified lines3456789101 unmodified line121314151617182 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {1 unmodified lineconst String titleText = 'Modal BottomSheet';const String closeText = 'Close BottomSheet';await tester.pumpWidget(const example.BottomSheetApp());expect(find.text(titleText), findsNothing);expect(find.text(closeText), findsNothing);
2 unmodified lines3456789101112131415162 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.2.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Modal bottom sheet animation can be customized using AnimationStyle', (WidgetTester tester) async {await tester.pumpWidget(const example.ModalBottomSheetApp(),);// Show the bottom sheet with default animation style.await tester.tap(find.widgetWithText(ElevatedButton, 'showModalBottomSheet'));2 unmodified lines345678910111213141516172 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/bottom_sheet/show_modal_bottom_sheet.2.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Modal bottom sheet animation can be customized using AnimationStyle', (WidgetTester tester,) async {await tester.pumpWidget(const example.ModalBottomSheetApp());// Show the bottom sheet with default animation style.await tester.tap(find.widgetWithText(ElevatedButton, 'showModalBottomSheet'));
2 unmodified lines345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273742 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/button_style/button_style.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Shows ElevatedButtons, FilledButtons, OutlinedButtons and TextButtons in enabled and disabled states',(WidgetTester tester) async {await tester.pumpWidget(const example.ButtonApp());expect(find.byWidgetPredicate((Widget widget) {return widget is ElevatedButton && widget.onPressed == null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is ElevatedButton && widget.onPressed != null;}),findsOne,);// One OutlinedButton with onPressed null.expect(find.byWidgetPredicate((Widget widget) {return widget is OutlinedButton && widget.onPressed == null;}),findsOne,);// One OutlinedButton with onPressed not null.expect(find.byWidgetPredicate((Widget widget) {return widget is OutlinedButton && widget.onPressed != null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is TextButton && widget.onPressed == null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is TextButton && widget.onPressed != null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is FilledButton && widget.onPressed != null;}),findsNWidgets(2),);expect(find.byWidgetPredicate((Widget widget) {return widget is FilledButton && widget.onPressed == null;}),findsNWidgets(2),);});}2 unmodified lines345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273742 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/button_style/button_style.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Shows ElevatedButtons, FilledButtons, OutlinedButtons and TextButtons in enabled and disabled states',(WidgetTester tester) async {await tester.pumpWidget(const example.ButtonApp());expect(find.byWidgetPredicate((Widget widget) {return widget is ElevatedButton && widget.onPressed == null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is ElevatedButton && widget.onPressed != null;}),findsOne,);// One OutlinedButton with onPressed null.expect(find.byWidgetPredicate((Widget widget) {return widget is OutlinedButton && widget.onPressed == null;}),findsOne,);// One OutlinedButton with onPressed not null.expect(find.byWidgetPredicate((Widget widget) {return widget is OutlinedButton && widget.onPressed != null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is TextButton && widget.onPressed == null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is TextButton && widget.onPressed != null;}),findsOne,);expect(find.byWidgetPredicate((Widget widget) {return widget is FilledButton && widget.onPressed != null;}),findsNWidgets(2),);expect(find.byWidgetPredicate((Widget widget) {return widget is FilledButton && widget.onPressed == null;}),findsNWidgets(2),);},);}
2 unmodified lines3456789101112131415161718192021222 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/button_style_button/button_style_button.icon_alignment.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('ButtonStyleButton.iconAlignment updates button icons alignment', (WidgetTester tester) async {await tester.pumpWidget(const example.ButtonStyleButtonIconAlignmentApp(),);Finder findButtonMaterial(String text) {return find.ancestor(of: find.text(text),matching: find.byType(Material),).first;}void expectedLeftIconPosition({2 unmodified lines345678910111213141516171819202 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/button_style_button/button_style_button.icon_alignment.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('ButtonStyleButton.iconAlignment updates button icons alignment', (WidgetTester tester,) async {await tester.pumpWidget(const example.ButtonStyleButtonIconAlignmentApp());Finder findButtonMaterial(String text) {return find.ancestor(of: find.text(text), matching: find.byType(Material)).first;}void expectedLeftIconPosition({
7 unmodified lines8910111213141516171819207 unmodified linesvoid main() {testWidgets('Card Smoke Test', (WidgetTester tester) async {await tester.pumpWidget(const example.CardExampleApp(),);expect(find.byType(Card), findsOneWidget);expect(find.widgetWithIcon(Card, Icons.album), findsOneWidget);expect(find.widgetWithText(Card, 'The Enchanted Nightingale'), findsOneWidget);expect(find.widgetWithText(Card, 'Music by Julie Gable. Lyrics by Sidney Stein.'), findsOneWidget);expect(find.widgetWithText(Card, 'BUY TICKETS'), findsOneWidget);expect(find.widgetWithText(Card, 'LISTEN'), findsOneWidget);});7 unmodified lines891011121314151617181920217 unmodified linesvoid main() {testWidgets('Card Smoke Test', (WidgetTester tester) async {await tester.pumpWidget(const example.CardExampleApp());expect(find.byType(Card), findsOneWidget);expect(find.widgetWithIcon(Card, Icons.album), findsOneWidget);expect(find.widgetWithText(Card, 'The Enchanted Nightingale'), findsOneWidget);expect(find.widgetWithText(Card, 'Music by Julie Gable. Lyrics by Sidney Stein.'),findsOneWidget,);expect(find.widgetWithText(Card, 'BUY TICKETS'), findsOneWidget);expect(find.widgetWithText(Card, 'LISTEN'), findsOneWidget);});
17 unmodified lines18192021222324252627282930313233343536373839404142434445464748495051525354555657585917 unmodified linesMaterial getCardMaterial(WidgetTester tester, int cardIndex) {return tester.widget<Material>(find.descendant(of: find.byType(Card).at(cardIndex),matching: find.byType(Material),),);}final Material defaultCard = getCardMaterial(tester, 0);expect(defaultCard.clipBehavior, Clip.none);expect(defaultCard.elevation, 1.0);expect(defaultCard.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0)),));expect(defaultCard.color, const Color(0xfffffbfe));expect(defaultCard.shadowColor, const Color(0xff000000));expect(defaultCard.surfaceTintColor, const Color(0xff6750a4));final Material filledCard = getCardMaterial(tester, 1);expect(filledCard.clipBehavior, Clip.none);expect(filledCard.elevation, 0.0);expect(filledCard.shape, const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0)),));expect(filledCard.color, const Color(0xffe7e0ec));expect(filledCard.shadowColor, const Color(0xff000000));expect(filledCard.surfaceTintColor, const Color(0x00000000));final Material outlinedCard = getCardMaterial(tester, 2);expect(outlinedCard.clipBehavior, Clip.none);expect(outlinedCard.elevation, 0.0);expect(outlinedCard.shape, const RoundedRectangleBorder(side: BorderSide(color: Color(0xffcac4d0)),borderRadius: BorderRadius.all(Radius.circular(12.0)),));expect(outlinedCard.color, const Color(0xfffffbfe));expect(outlinedCard.shadowColor, const Color(0xff000000));expect(outlinedCard.surfaceTintColor, const Color(0xff6750a4));});}17 unmodified lines181920212223242526272829303132333435363738394041424344454647484950515253545556575859606117 unmodified linesMaterial getCardMaterial(WidgetTester tester, int cardIndex) {return tester.widget<Material>(find.descendant(of: find.byType(Card).at(cardIndex), matching: find.byType(Material)),);}final Material defaultCard = getCardMaterial(tester, 0);expect(defaultCard.clipBehavior, Clip.none);expect(defaultCard.elevation, 1.0);expect(defaultCard.shape,const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0))),);expect(defaultCard.color, const Color(0xfff7f2fa));expect(defaultCard.shadowColor, const Color(0xff000000));expect(defaultCard.surfaceTintColor, Colors.transparent);final Material filledCard = getCardMaterial(tester, 1);expect(filledCard.clipBehavior, Clip.none);expect(filledCard.elevation, 0.0);expect(filledCard.shape,const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(12.0))),);expect(filledCard.color, const Color(0xffe6e0e9));expect(filledCard.shadowColor, const Color(0xff000000));expect(filledCard.surfaceTintColor, const Color(0x00000000));final Material outlinedCard = getCardMaterial(tester, 2);expect(outlinedCard.clipBehavior, Clip.none);expect(outlinedCard.elevation, 0.0);expect(outlinedCard.shape,const RoundedRectangleBorder(side: BorderSide(color: Color(0xffcac4d0)),borderRadius: BorderRadius.all(Radius.circular(12.0)),),);expect(outlinedCard.color, const Color(0xfffef7ff));expect(outlinedCard.shadowColor, const Color(0xff000000));expect(outlinedCard.surfaceTintColor, Colors.transparent);});}
1 unmodified line23456789101112131415161718191 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/carousel/carousel.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Carousel Smoke Test', (WidgetTester tester) async {await tester.pumpWidget(const example.CarouselExampleApp(),);expect(find.byType(CarouselView), findsOneWidget);expect(find.widgetWithText(example.UncontainedLayoutCard, 'Item 0'), findsOneWidget);expect(find.widgetWithText(example.UncontainedLayoutCard, 'Item 1'), findsOneWidget);});}1 unmodified line234567891011121314151617181920212223242526272829303132333435363738394041421 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'dart:io';import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/carousel/carousel.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {// The app being tested loads images via HTTP which the test// framework defeats by default.setUpAll(() {HttpOverrides.global = null;});testWidgets('Carousel Smoke Test', (WidgetTester tester) async {await tester.pumpWidget(const example.CarouselExampleApp());expect(find.widgetWithText(example.HeroLayoutCard, 'Through the Pane'), findsOneWidget);final Finder firstCarousel = find.byType(CarouselView).first;await tester.drag(firstCarousel, const Offset(150, 0));await tester.pumpAndSettle();expect(find.widgetWithText(example.HeroLayoutCard, 'The Flow'), findsOneWidget);await tester.drag(firstCarousel, const Offset(0, -200));await tester.pumpAndSettle();expect(find.widgetWithText(CarouselView, 'Cameras'), findsOneWidget);expect(find.widgetWithText(CarouselView, 'Lighting'), findsOneWidget);expect(find.widgetWithText(CarouselView, 'Climate'), findsOneWidget);expect(find.widgetWithText(CarouselView, 'Wifi'), findsOneWidget);await tester.drag(find.widgetWithText(CarouselView, 'Cameras'), const Offset(0, -200));await tester.pumpAndSettle();expect(find.text('Uncontained layout'), findsOneWidget);expect(find.widgetWithText(CarouselView, 'Show 0'), findsOneWidget);expect(find.widgetWithText(CarouselView, 'Show 1'), findsOneWidget);});}
2 unmodified lines3456789101112131415161712 unmodified lines3031323334353637383940414243444546474849505152535455565758592 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox/checkbox.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp(),);Checkbox checkbox = tester.widget(find.byType(Checkbox));expect(checkbox.value, isFalse);12 unmodified lines});testWidgets('Checkbox color can be changed', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp(),);final Checkbox checkbox = tester.widget(find.byType(Checkbox));expect(checkbox.checkColor,Colors.white,);expect(checkbox.fillColor!.resolve(<MaterialState>{}),Colors.red,);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.pressed}),Colors.blue,);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.hovered}),Colors.blue,);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.focused}),Colors.blue,);});}2 unmodified lines3456789101112131412 unmodified lines272829303132333435363738392 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox/checkbox.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp());Checkbox checkbox = tester.widget(find.byType(Checkbox));expect(checkbox.value, isFalse);12 unmodified lines});testWidgets('Checkbox color can be changed', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp());final Checkbox checkbox = tester.widget(find.byType(Checkbox));expect(checkbox.checkColor, Colors.white);expect(checkbox.fillColor!.resolve(<MaterialState>{}), Colors.red);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.pressed}), Colors.blue);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.hovered}), Colors.blue);expect(checkbox.fillColor!.resolve(<MaterialState>{MaterialState.focused}), Colors.blue);});}
2 unmodified lines345678910111213141516172 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox/checkbox.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp(),);expect(find.byType(Checkbox), findsNWidgets(3));Checkbox checkbox = tester.widget(find.byType(Checkbox).first);2 unmodified lines345678910111213142 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox/checkbox.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxExampleApp());expect(find.byType(Checkbox), findsNWidgets(3));Checkbox checkbox = tester.widget(find.byType(Checkbox).first);
3 unmodified lines45678910111213141516173 unmodified linesimport 'package:flutter/material.dart';import 'package:flutter/scheduler.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/checkbox_list_tile.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('CheckboxListTile can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp(),);CheckboxListTile checkboxListTile = tester.widget(find.byType(CheckboxListTile));expect(checkboxListTile.value, isFalse);3 unmodified lines456789101112131415163 unmodified linesimport 'package:flutter/material.dart';import 'package:flutter/scheduler.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/checkbox_list_tile.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('CheckboxListTile can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp());CheckboxListTile checkboxListTile = tester.widget(find.byType(CheckboxListTile));expect(checkboxListTile.value, isFalse);
2 unmodified lines34567891011121314151617 unmodified lines3435363738394041422 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/checkbox_list_tile.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox aligns appropriately', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp(),);expect(find.byType(CheckboxListTile), findsNWidgets(3));17 unmodified lines});testWidgets('Checkboxes can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp(),);expect(find.byType(CheckboxListTile), findsNWidgets(3));2 unmodified lines345678910111213141517 unmodified lines333435363738392 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/checkbox_list_tile.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Checkbox aligns appropriately', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp());expect(find.byType(CheckboxListTile), findsNWidgets(3));17 unmodified lines});testWidgets('Checkboxes can be checked', (WidgetTester tester) async {await tester.pumpWidget(const example.CheckboxListTileApp());expect(find.byType(CheckboxListTile), findsNWidgets(3));
2 unmodified lines3456789101112131415162 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/custom_labeled_checkbox.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('LinkedLabelCheckbox contains RichText and Checkbox', (WidgetTester tester) async {await tester.pumpWidget(const example.LabeledCheckboxApp(),);// Label text is in a RichText widget with the correct text.final RichText richText = tester.widget(find.byType(RichText).first);2 unmodified lines34567891011121314152 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/custom_labeled_checkbox.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('LinkedLabelCheckbox contains RichText and Checkbox', (WidgetTester tester) async {await tester.pumpWidget(const example.LabeledCheckboxApp());// Label text is in a RichText widget with the correct text.final RichText richText = tester.widget(find.byType(RichText).first);
2 unmodified lines3456789101112131415162 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/custom_labeled_checkbox.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Tapping LabeledCheckbox toggles the checkbox', (WidgetTester tester) async {await tester.pumpWidget(const example.LabeledCheckboxApp(),);// Checkbox is initially unchecked.Checkbox checkbox = tester.widget(find.byType(Checkbox));2 unmodified lines34567891011121314152 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/checkbox_list_tile/custom_labeled_checkbox.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Tapping LabeledCheckbox toggles the checkbox', (WidgetTester tester) async {await tester.pumpWidget(const example.LabeledCheckboxApp());// Checkbox is initially unchecked.Checkbox checkbox = tester.widget(find.byType(Checkbox));
2 unmodified lines34567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253542 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/chip/chip_attributes.avatar_box_constraints.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('RawChip.avatarBoxConstraints updates avatar size constraints', (WidgetTester tester) async {const double border = 1.0;const double iconSize = 18.0;const double padding = 8.0;await tester.pumpWidget(const example.AvatarBoxConstraintsApp(),);expect(tester.getSize(find.byType(RawChip).at(0)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(0)).height, equals(58.0));Offset chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(0),matching: find.byType(Material),),)));Offset avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(0));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);expect(tester.getSize(find.byType(RawChip).at(1)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(1)).height, equals(78.0));chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(1),matching: find.byType(Material),),)));avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(1));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);expect(tester.getSize(find.byType(RawChip).at(2)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(2)).height, equals(78.0));chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(2),matching: find.byType(Material),),)));avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(2));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);});2 unmodified lines3456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657582 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/chip/chip_attributes.avatar_box_constraints.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('RawChip.avatarBoxConstraints updates avatar size constraints', (WidgetTester tester,) async {const double border = 1.0;const double iconSize = 18.0;const double padding = 8.0;await tester.pumpWidget(const example.AvatarBoxConstraintsApp());expect(tester.getSize(find.byType(RawChip).at(0)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(0)).height, equals(58.0));Offset chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(0), matching: find.byType(Material)),),),);Offset avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(0));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);expect(tester.getSize(find.byType(RawChip).at(1)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(1)).height, equals(78.0));chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(1), matching: find.byType(Material)),),),);avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(1));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);expect(tester.getSize(find.byType(RawChip).at(2)).width, equals(202.0));expect(tester.getSize(find.byType(RawChip).at(2)).height, equals(78.0));chipTopLeft = tester.getTopLeft(find.byWidget(tester.widget<Material>(find.descendant(of: find.byType(RawChip).at(2), matching: find.byType(Material)),),),);avatarCenter = tester.getCenter(find.byIcon(Icons.star).at(2));expect(chipTopLeft.dx, avatarCenter.dx - (iconSize / 2) - padding - border);});
2 unmodified lines34567891011121314151625 unmodified lines4243444546474849505125 unmodified lines7778798081828384858618 unmodified lines1051061071081091101111121131142 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/chip/chip_attributes.chip_animation_style.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('ChipAnimationStyle.enableAnimation overrides chip enable animation', (WidgetTester tester) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp(),);final RenderBox materialBox = tester.firstRenderObject<RenderBox>(find.descendant(25 unmodified linesexpect(materialBox, paints..rrect(color: const Color(0xffffc107)));});testWidgets('ChipAnimationStyle.selectAnimation overrides chip select animation', (WidgetTester tester) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp(),);final RenderBox materialBox = tester.firstRenderObject<RenderBox>(find.descendant(25 unmodified linesexpect(materialBox, paints..rrect(color: const Color(0xffffc107)));});testWidgets('ChipAnimationStyle.avatarDrawerAnimation overrides chip checkmark animation', (WidgetTester tester) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp(),);expect(tester.getSize(find.widgetWithText(RawChip, 'Checked')).width, closeTo(152.6, 0.1));18 unmodified linesexpect(tester.getSize(find.widgetWithText(RawChip, 'Checked')).width, closeTo(152.6, 0.1));});testWidgets('ChipAnimationStyle.deleteDrawerAnimation overrides chip delete icon animation', (WidgetTester tester) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp(),);expect(tester.getSize(find.widgetWithText(RawChip, 'Deletable')).width, closeTo(180.9, 0.1));2 unmodified lines3456789101112131415161725 unmodified lines4344454647484950515225 unmodified lines7879808182838485868718 unmodified lines1061071081091101111121131141152 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/material/chip/chip_attributes.chip_animation_style.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('ChipAnimationStyle.enableAnimation overrides chip enable animation', (WidgetTester tester,) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp());final RenderBox materialBox = tester.firstRenderObject<RenderBox>(find.descendant(25 unmodified linesexpect(materialBox, paints..rrect(color: const Color(0xffffc107)));});testWidgets('ChipAnimationStyle.selectAnimation overrides chip select animation', (WidgetTester tester,) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp());final RenderBox materialBox = tester.firstRenderObject<RenderBox>(find.descendant(25 unmodified linesexpect(materialBox, paints..rrect(color: const Color(0xffffc107)));});testWidgets('ChipAnimationStyle.avatarDrawerAnimation overrides chip checkmark animation', (WidgetTester tester,) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp());expect(tester.getSize(find.widgetWithText(RawChip, 'Checked')).width, closeTo(152.6, 0.1));18 unmodified linesexpect(tester.getSize(find.widgetWithText(RawChip, 'Checked')).width, closeTo(152.6, 0.1));});testWidgets('ChipAnimationStyle.deleteDrawerAnimation overrides chip delete icon animation', (WidgetTester tester,) async {await tester.pumpWidget(const example.ChipAnimationStyleExampleApp());expect(tester.getSize(find.widgetWithText(RawChip, 'Deletable')).width, closeTo(180.9, 0.1));
13 unmodified lines14151617181920212213 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp(),);expect(find.byType(Placeholder), findsOneWidget);});13 unmodified lines1415161718192013 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp());expect(find.byType(Placeholder), findsOneWidget);});
13 unmodified lines14151617181920212213 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp(),);expect(find.byType(Scaffold), findsOneWidget);expect(find.byType(Placeholder), findsOneWidget);13 unmodified lines1415161718192013 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp());expect(find.byType(Scaffold), findsOneWidget);expect(find.byType(Placeholder), findsOneWidget);
13 unmodified lines14151617181920212213 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp(),);expect(find.byType(Placeholder), findsOneWidget);});13 unmodified lines1415161718192013 unmodified linesvoid main() {testWidgets('Example app has a placeholder', (WidgetTester tester) async {await tester.pumpWidget(const example.SampleApp());expect(find.byType(Placeholder), findsOneWidget);});
11 unmodified lines12131415161718192021222311 unmodified linesfinal _MockClipboard mockClipboard = _MockClipboard();testWidgets('Copies text on Ctrl-C', (WidgetTester tester) async {tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform, mockClipboard.handleMethodCall);await tester.pumpWidget(const MaterialApp(home: Scaffold(body: Center(child: example.VerificationCodeGenerator()),),),);expect(primaryFocus, isNotNull);11 unmodified lines12131415161718192021222311 unmodified linesfinal _MockClipboard mockClipboard = _MockClipboard();testWidgets('Copies text on Ctrl-C', (WidgetTester tester) async {tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(SystemChannels.platform,mockClipboard.handleMethodCall,);await tester.pumpWidget(const MaterialApp(home: Scaffold(body: Center(child: example.VerificationCodeGenerator()))),);expect(primaryFocus, isNotNull);
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.
import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/actions/action_listener.0.dart' as example;import 'package:flutter_test/flutter_test.dart';
void main() { testWidgets('ActionListener can be enabled, triggered, and disabled', ( WidgetTester tester, ) async { final List<String?> log = <String?>[];
final DebugPrintCallback originalDebugPrint = debugPrint; debugPrint = (String? message, {int? wrapWidth}) { log.add(message); }; try { await tester.pumpWidget(const example.ActionListenerExampleApp());
expect(find.widgetWithText(AppBar, 'ActionListener Sample'), findsOne); expect(find.widgetWithText(OutlinedButton, 'Enable'), findsOne);
await tester.tap(find.byType(OutlinedButton)); await tester.pump();
expect(find.widgetWithText(OutlinedButton, 'Disable'), findsOne); expect(find.widgetWithText(ElevatedButton, 'Call Action Listener'), findsOne); expect(log, const <String?>['Action Listener was added']);
await tester.tap(find.text('Call Action Listener')); await tester.pumpAndSettle();
expect(find.widgetWithText(SnackBar, 'Action Listener Called'), findsOne);
await tester.tap(find.text('Disable')); await tester.pump();
expect(find.widgetWithText(OutlinedButton, 'Enable'), findsOne); expect(log, const <String?>['Action Listener was added', 'Action Listener was removed']); } finally { debugPrint = originalDebugPrint; } });}11 unmodified lines1213141516171819201 unmodified line22232425262728293019 unmodified lines50515253545556575826 unmodified lines8586878889909192939495969798991001011026 unmodified lines1091101111121131141151161171189 unmodified lines12812913013113213313413513613711 unmodified linesfinal ButtonStyleButton button = tester.widget<ButtonStyleButton>(find.descendant(of: find.byType(example.SaveButton),matching: find.byWidgetPredicate((Widget widget) => widget is TextButton,),),);1 unmodified line}testWidgets('Increments and decrements value', (WidgetTester tester) async {await tester.pumpWidget(const example.ActionsExampleApp(),);int value = 0;19 unmodified lines});testWidgets('SaveButton indicates dirty status', (WidgetTester tester) async {await tester.pumpWidget(const example.ActionsExampleApp(),);// Verify that initial color is green, as the value is not marked as dirty.Color? saveButtonColor = getSaveButtonColor(tester);26 unmodified lineslog.add(message);};await tester.pumpWidget(const example.ActionsExampleApp(),);// Verify that value is not marked as dirty.Color? saveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.green));expect(find.descendant(of: find.byType(example.SaveButton),matching: find.text('0'),),findsOneWidget,);6 unmodified linessaveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.red));expect(find.descendant(of: find.byType(example.SaveButton),matching: find.text('0'),),findsOneWidget,);9 unmodified linessaveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.green));expect(find.descendant(of: find.byType(example.SaveButton),matching: find.text('-1'),),findsOneWidget,);11 unmodified lines121314151617181 unmodified line2021222324252619 unmodified lines4647484950515226 unmodified lines798081828384858687888990916 unmodified lines98991001011021031049 unmodified lines11411511611711811912011 unmodified linesfinal ButtonStyleButton button = tester.widget<ButtonStyleButton>(find.descendant(of: find.byType(example.SaveButton),matching: find.byWidgetPredicate((Widget widget) => widget is TextButton),),);1 unmodified line}testWidgets('Increments and decrements value', (WidgetTester tester) async {await tester.pumpWidget(const example.ActionsExampleApp());int value = 0;19 unmodified lines});testWidgets('SaveButton indicates dirty status', (WidgetTester tester) async {await tester.pumpWidget(const example.ActionsExampleApp());// Verify that initial color is green, as the value is not marked as dirty.Color? saveButtonColor = getSaveButtonColor(tester);26 unmodified lineslog.add(message);};await tester.pumpWidget(const example.ActionsExampleApp());// Verify that value is not marked as dirty.Color? saveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.green));expect(find.descendant(of: find.byType(example.SaveButton), matching: find.text('0')),findsOneWidget,);6 unmodified linessaveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.red));expect(find.descendant(of: find.byType(example.SaveButton), matching: find.text('0')),findsOneWidget,);9 unmodified linessaveButtonColor = getSaveButtonColor(tester);expect(saveButtonColor, equals(Colors.green));expect(find.descendant(of: find.byType(example.SaveButton), matching: find.text('-1')),findsOneWidget,);
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.
import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:flutter_api_samples/widgets/actions/focusable_action_detector.0.dart' as example;import 'package:flutter_test/flutter_test.dart';
void main() { final Finder redContainerFinder = find.byWidgetPredicate( (Widget widget) => widget is Container && widget.color == Colors.red, );
testWidgets('Taps on the "And me" button toggle the red box', (WidgetTester tester) async { await tester.pumpWidget(const example.FocusableActionDetectorExampleApp());
expect(find.widgetWithText(AppBar, 'FocusableActionDetector Example'), findsOne);
expect(redContainerFinder, findsNothing);
await tester.tap(find.text('And Me')); await tester.pump();
expect(redContainerFinder, findsOne);
await tester.tap(find.text('And Me')); await tester.pump();
expect(redContainerFinder, findsNothing); });
testWidgets('Hits on the X key when "And me" is focused toggle the red box', ( WidgetTester tester, ) async { await tester.pumpWidget(const example.FocusableActionDetectorExampleApp());
expect(find.widgetWithText(AppBar, 'FocusableActionDetector Example'), findsOne);
expect(redContainerFinder, findsNothing);
await tester.sendKeyEvent(LogicalKeyboardKey.tab); // Focuses the "Press Me" button. await tester.pump();
expect(redContainerFinder, findsNothing);
await tester.sendKeyEvent(LogicalKeyboardKey.keyX); await tester.pump();
expect(redContainerFinder, findsNothing);
await tester.sendKeyEvent(LogicalKeyboardKey.tab); // Focuses the "And Me" button. await tester.pump();
expect(redContainerFinder, findsNothing);
await tester.sendKeyEvent(LogicalKeyboardKey.keyX); await tester.pump();
expect(redContainerFinder, findsOne);
await tester.sendKeyEvent(LogicalKeyboardKey.keyX); await tester.pump();
expect(redContainerFinder, findsNothing); });}2 unmodified lines345678910111213141516172 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_grid/animated_grid.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AnimatedGrid example', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedGridSample(),);expect(find.text('1'), findsOneWidget);expect(find.text('2'), findsOneWidget);2 unmodified lines345678910111213142 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_grid/animated_grid.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AnimatedGrid example', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedGridSample());expect(find.text('1'), findsOneWidget);expect(find.text('2'), findsOneWidget);
2 unmodified lines345678910111213141516172 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_grid/sliver_animated_grid.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('SliverAnimatedGrid example', (WidgetTester tester) async {await tester.pumpWidget(const example.SliverAnimatedGridSample(),);expect(find.text('1'), findsOneWidget);expect(find.text('2'), findsOneWidget);2 unmodified lines345678910111213142 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_grid/sliver_animated_grid.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('SliverAnimatedGrid example', (WidgetTester tester) async {await tester.pumpWidget(const example.SliverAnimatedGridSample());expect(find.text('1'), findsOneWidget);expect(find.text('2'), findsOneWidget);
1234567891011121314151617181920212223242526272829303132333435363738394041424344// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.
import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_list/animated_list.0.dart' as example;import 'package:flutter_test/flutter_test.dart';
void main() { testWidgets('Items can be selected, added, and removed from AnimatedList', ( WidgetTester tester, ) async { await tester.pumpWidget(const example.AnimatedListSample());
expect(find.text('Item 0'), findsOne); expect(find.text('Item 1'), findsOne); expect(find.text('Item 2'), findsOne);
// Add an item at the end of the list. await tester.tap(find.byIcon(Icons.add_circle)); await tester.pumpAndSettle(); expect(find.text('Item 3'), findsOne);
// Select Item 1. await tester.tap(find.text('Item 1')); await tester.pumpAndSettle();
// Add item at the top of the list. await tester.tap(find.byIcon(Icons.add_circle)); await tester.pumpAndSettle(); expect(find.text('Item 4'), findsOne);
// Remove selected item. await tester.tap(find.byIcon(Icons.remove_circle));
// Item animation is not completed. await tester.pump(); expect(find.text('Item 1'), findsOne);
// When the animation completes, Item 1 disappears. await tester.pumpAndSettle(); expect(find.text('Item 1'), findsNothing); });}2 unmodified lines345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455562 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_list/animated_list_separated.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Items can be selected, added, and removed from AnimatedList.separated',(WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedListSeparatedSample());expect(find.text('Item 0'), findsOneWidget);expect(find.text('Separator 0'), findsOneWidget);expect(find.text('Item 1'), findsOneWidget);expect(find.text('Separator 1'), findsOneWidget);expect(find.text('Item 2'), findsOneWidget);// Add an item at the end of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Separator 2'), findsOneWidget);expect(find.text('Item 3'), findsOneWidget);// Select Item 1.await tester.tap(find.text('Item 1'));await tester.pumpAndSettle();// Add item at the top of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 4'), findsOneWidget);// Contrary to the behavior for insertion at other places,// the Separator for the last item of the list will be added// before that item instead of after it.expect(find.text('Separator 4'), findsOneWidget);// Remove selected item.await tester.tap(find.byIcon(Icons.remove_circle));// Item animation is not completed.await tester.pump();expect(find.text('Item 1'), findsOneWidget);expect(find.text('Separator 1'), findsNothing);expect(find.text('Removing separator'), findsOneWidget);// When the animation completes, Item 1 disappears.await tester.pumpAndSettle();expect(find.text('Item 1'), findsNothing);expect(find.text('Separator 1'), findsNothing);expect(find.text('Removing separator'), findsNothing);},);}2 unmodified lines345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455562 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_list/animated_list_separated.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Items can be selected, added, and removed from AnimatedList.separated', (WidgetTester tester,) async {await tester.pumpWidget(const example.AnimatedListSeparatedSample());expect(find.text('Item 0'), findsOneWidget);expect(find.text('Separator 0'), findsOneWidget);expect(find.text('Item 1'), findsOneWidget);expect(find.text('Separator 1'), findsOneWidget);expect(find.text('Item 2'), findsOneWidget);// Add an item at the end of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Separator 2'), findsOneWidget);expect(find.text('Item 3'), findsOneWidget);// Select Item 1.await tester.tap(find.text('Item 1'));await tester.pumpAndSettle();// Add item at the top of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 4'), findsOneWidget);// Contrary to the behavior for insertion at other places,// the Separator for the last item of the list will be added// before that item instead of after it.expect(find.text('Separator 4'), findsOneWidget);// Remove selected item.await tester.tap(find.byIcon(Icons.remove_circle));// Item animation is not completed.await tester.pump();expect(find.text('Item 1'), findsOneWidget);expect(find.text('Separator 1'), findsNothing);expect(find.text('Removing separator'), findsOneWidget);// When the animation completes, Item 1 disappears.await tester.pumpAndSettle();expect(find.text('Item 1'), findsNothing);expect(find.text('Separator 1'), findsNothing);expect(find.text('Removing separator'), findsNothing);});}
6 unmodified lines7891011121314151617181920212223242526272829303132333435363738394041424344456 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Items can be selected, added, and removed from SliverAnimatedList',(WidgetTester tester) async {await tester.pumpWidget(const example.SliverAnimatedListSample());expect(find.text('Item 0'), findsOneWidget);expect(find.text('Item 1'), findsOneWidget);expect(find.text('Item 2'), findsOneWidget);// Add an item at the end of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 3'), findsOneWidget);// Select Item 1.await tester.tap(find.text('Item 1'));await tester.pumpAndSettle();// Add item at the top of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 4'), findsOneWidget);// Remove selected item.await tester.tap(find.byIcon(Icons.remove_circle));// Item animation is not completed.await tester.pump();expect(find.text('Item 1'), findsOneWidget);// When the animation completes, Item 1 disappears.await tester.pumpAndSettle();expect(find.text('Item 1'), findsNothing);},);}6 unmodified lines78910111213141516171819202122232425262728293031323334353637383940414243446 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Items can be selected, added, and removed from SliverAnimatedList', (WidgetTester tester,) async {await tester.pumpWidget(const example.SliverAnimatedListSample());expect(find.text('Item 0'), findsOneWidget);expect(find.text('Item 1'), findsOneWidget);expect(find.text('Item 2'), findsOneWidget);// Add an item at the end of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 3'), findsOneWidget);// Select Item 1.await tester.tap(find.text('Item 1'));await tester.pumpAndSettle();// Add item at the top of the listawait tester.tap(find.byIcon(Icons.add_circle));await tester.pumpAndSettle();expect(find.text('Item 4'), findsOneWidget);// Remove selected item.await tester.tap(find.byIcon(Icons.remove_circle));// Item animation is not completed.await tester.pump();expect(find.text('Item 1'), findsOneWidget);// When the animation completes, Item 1 disappears.await tester.pumpAndSettle();expect(find.text('Item 1'), findsNothing);});}
2 unmodified lines345678910111213141516179 unmodified lines272829303132333435363738394041424344454647486 unmodified lines55565758596061626364656667686970717273742 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_size/animated_size.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AnimatedSize animates on tap', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSizeExampleApp(),);const Size beginSize = Size.square(100.0);const Size endSize = Size.square(250.0);9 unmodified linesexpect(box.size, equals(beginSize));// Advance animation to the middle.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2,);final double t = example.AnimatedSizeExampleApp.curve.transform(0.5);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size,equals(Size.lerp(beginSize, endSize, t)),);// Advance animation to the end.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2,);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(endSize));6 unmodified linesexpect(box.size, equals(endSize));// Advance animation to the middle.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2,);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size,equals(Size.lerp(endSize, beginSize, t)),);// Advance animation to the end.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2,);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(beginSize));2 unmodified lines345678910111213149 unmodified lines2425262728293031323334353637386 unmodified lines454647484950515253545556572 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_size/animated_size.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AnimatedSize animates on tap', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSizeExampleApp());const Size beginSize = Size.square(100.0);const Size endSize = Size.square(250.0);9 unmodified linesexpect(box.size, equals(beginSize));// Advance animation to the middle.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2);final double t = example.AnimatedSizeExampleApp.curve.transform(0.5);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(Size.lerp(beginSize, endSize, t)));// Advance animation to the end.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(endSize));6 unmodified linesexpect(box.size, equals(endSize));// Advance animation to the middle.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(Size.lerp(endSize, beginSize, t)));// Advance animation to the end.await tester.pump(example.AnimatedSizeExampleApp.duration ~/ 2);box = tester.renderObject(find.byType(AnimatedSize));expect(box.size, equals(beginSize));
2 unmodified lines345678910111213141516172 unmodified lines202122232425262728295 unmodified lines35363738394041424315 unmodified lines596061626364656667682 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_switcher/animated_switcher.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Increments counter on button tap', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSwitcherExampleApp(),);int counter = 0;2 unmodified lineswhile (counter < 10) {// Tap on the button to increment the counter.await tester.tap(find.ancestor(of: find.text('Increment'),matching: find.byType(ElevatedButton),),);await tester.pumpAndSettle();5 unmodified lines});testWidgets('Animates counter change', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSwitcherExampleApp(),);// The animation duration defined in the example app.const Duration animationDuration = Duration(milliseconds: 500);15 unmodified lines// Tap on the button to increment the counter.await tester.tap(find.ancestor(of: find.text('Increment'),matching: find.byType(ElevatedButton),),);await tester.pump();2 unmodified lines345678910111213142 unmodified lines171819202122235 unmodified lines2930313233343515 unmodified lines515253545556572 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/animated_switcher/animated_switcher.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Increments counter on button tap', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSwitcherExampleApp());int counter = 0;2 unmodified lineswhile (counter < 10) {// Tap on the button to increment the counter.await tester.tap(find.ancestor(of: find.text('Increment'), matching: find.byType(ElevatedButton)),);await tester.pumpAndSettle();5 unmodified lines});testWidgets('Animates counter change', (WidgetTester tester) async {await tester.pumpWidget(const example.AnimatedSwitcherExampleApp());// The animation duration defined in the example app.const Duration animationDuration = Duration(milliseconds: 500);15 unmodified lines// Tap on the button to increment the counter.await tester.tap(find.ancestor(of: find.text('Increment'), matching: find.byType(ElevatedButton)),);await tester.pump();
6 unmodified lines7891011121314156 unmodified linesvoid main() {testWidgets('WidgetsApp test', (WidgetTester tester) async {await tester.pumpWidget(const example.WidgetsAppExampleApp(),);expect(find.text('Hello World'), findsOneWidget);});6 unmodified lines789101112136 unmodified linesvoid main() {testWidgets('WidgetsApp test', (WidgetTester tester) async {await tester.pumpWidget(const example.WidgetsAppExampleApp());expect(find.text('Hello World'), findsOneWidget);});
1 unmodified line234567891011121314151 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'package:flutter_api_samples/widgets/app_lifecycle_listener/app_lifecycle_listener.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AppLifecycleListener example', (WidgetTester tester) async {await tester.pumpWidget(const example.AppLifecycleListenerExample(),);expect(find.textContaining('Current State:'), findsOneWidget);expect(find.textContaining('State History:'), findsOneWidget);1 unmodified line2345678910111213141 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'package:flutter_api_samples/widgets/app_lifecycle_listener/app_lifecycle_listener.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AppLifecycleListener example', (WidgetTester tester) async {await tester.pumpWidget(const example.AppLifecycleListenerExample());expect(find.textContaining('Current State:'), findsOneWidget);expect(find.textContaining('State History:'), findsOneWidget);
1 unmodified line234567891011121314151 unmodified line171819202122231 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'package:flutter_api_samples/widgets/app_lifecycle_listener/app_lifecycle_listener.1.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AppLifecycleListener example', (WidgetTester tester) async {await tester.pumpWidget(const example.AppLifecycleListenerExample(),);expect(find.text('Do Not Allow Exit'), findsOneWidget);expect(find.text('Allow Exit'), findsOneWidget);1 unmodified lineexpect(find.textContaining('Exit Request:'), findsOneWidget);await tester.tap(find.text('Quit'));await tester.pump();// Responding to the the quit request happens in a Future that we don't have// visibility for, so to avoid a flaky test with a delay, we just check to// see if the request string prefix is still there, rather than the request// response string. Testing it wasn't worth exposing a Completer in the1 unmodified line2345678910111213141 unmodified line161718192021221 unmodified line// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.import 'package:flutter_api_samples/widgets/app_lifecycle_listener/app_lifecycle_listener.1.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('AppLifecycleListener example', (WidgetTester tester) async {await tester.pumpWidget(const example.AppLifecycleListenerExample());expect(find.text('Do Not Allow Exit'), findsOneWidget);expect(find.text('Allow Exit'), findsOneWidget);1 unmodified lineexpect(find.textContaining('Exit Request:'), findsOneWidget);await tester.tap(find.text('Quit'));await tester.pump();// Responding to the quit request happens in a Future that we don't have// visibility for, so to avoid a flaky test with a delay, we just check to// see if the request string prefix is still there, rather than the request// response string. Testing it wasn't worth exposing a Completer in the
2 unmodified lines345678910111213141516172 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/async/future_builder.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('StreamBuilder listens to internal stream', (WidgetTester tester) async {await tester.pumpWidget(const example.FutureBuilderExampleApp(),);expect(find.byType(CircularProgressIndicator), findsOne);expect(find.text('Awaiting result...'), findsOne);2 unmodified lines345678910111213142 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/async/future_builder.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('StreamBuilder listens to internal stream', (WidgetTester tester) async {await tester.pumpWidget(const example.FutureBuilderExampleApp());expect(find.byType(CircularProgressIndicator), findsOne);expect(find.text('Awaiting result...'), findsOne);
4 unmodified lines567891011121314151617181917 unmodified lines37383940414243444546472 unmodified lines50515253545556575859603 unmodified lines64656667686970717273747 unmodified lines82838485868788899091924 unmodified lines9798991001011021031041051061074 unmodified linesimport 'dart:async';import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/async/stream_builder.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('StreamBuilder listens to internal stream', (WidgetTester tester) async {await tester.pumpWidget(const example.StreamBuilderExampleApp(),);expect(find.byType(CircularProgressIndicator), findsOneWidget);expect(find.text('Awaiting bids...'), findsOneWidget);17 unmodified linescontroller.addError('Unexpected error!', StackTrace.empty);};await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream),),);await tester.pump();expect(find.byIcon(Icons.error_outline), findsOneWidget);2 unmodified lines});testWidgets('BidsStatus correctly displays none state', (WidgetTester tester) async {await tester.pumpWidget(const MaterialApp(home: example.BidsStatus(bids: null),),);expect(find.byIcon(Icons.info), findsOneWidget);expect(find.text('Select a lot'), findsOneWidget);3 unmodified linesfinal StreamController<int> controller = StreamController<int>();addTearDown(controller.close);await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream),),);expect(find.byType(CircularProgressIndicator), findsOneWidget);expect(find.text('Awaiting bids...'), findsOneWidget);7 unmodified linescontroller.add(1);};await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream),),);await tester.pump();expect(find.byIcon(Icons.check_circle_outline), findsOneWidget);4 unmodified linesfinal StreamController<int> controller = StreamController<int>();controller.close();await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream),),);await tester.pump();expect(find.byIcon(Icons.info), findsOneWidget);4 unmodified lines567891011121314151617 unmodified lines343536373839402 unmodified lines434445464748493 unmodified lines535455565758597 unmodified lines676869707172734 unmodified lines787980818283844 unmodified linesimport 'dart:async';import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/async/stream_builder.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {testWidgets('StreamBuilder listens to internal stream', (WidgetTester tester) async {await tester.pumpWidget(const example.StreamBuilderExampleApp());expect(find.byType(CircularProgressIndicator), findsOneWidget);expect(find.text('Awaiting bids...'), findsOneWidget);17 unmodified linescontroller.addError('Unexpected error!', StackTrace.empty);};await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));await tester.pump();expect(find.byIcon(Icons.error_outline), findsOneWidget);2 unmodified lines});testWidgets('BidsStatus correctly displays none state', (WidgetTester tester) async {await tester.pumpWidget(const MaterialApp(home: example.BidsStatus(bids: null)));expect(find.byIcon(Icons.info), findsOneWidget);expect(find.text('Select a lot'), findsOneWidget);3 unmodified linesfinal StreamController<int> controller = StreamController<int>();addTearDown(controller.close);await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));expect(find.byType(CircularProgressIndicator), findsOneWidget);expect(find.text('Awaiting bids...'), findsOneWidget);7 unmodified linescontroller.add(1);};await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));await tester.pump();expect(find.byIcon(Icons.check_circle_outline), findsOneWidget);4 unmodified linesfinal StreamController<int> controller = StreamController<int>();controller.close();await tester.pumpWidget(MaterialApp(home: example.BidsStatus(bids: controller.stream)));await tester.pump();expect(find.byIcon(Icons.info), findsOneWidget);
38 unmodified lines39404142434445464738 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField),matching: find.text('bobcat'),), findsOneWidget);});}38 unmodified lines39404142434445464738 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField), matching: find.text('bobcat')),findsOneWidget,);});}
38 unmodified lines3940414243444546474819 unmodified lines68697071727374757638 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField),matching: find.text('Bob'),), findsOneWidget);});testWidgets('Finds users by email address', (WidgetTester tester) async {19 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField),matching: find.text('Charlie'),), findsOneWidget);});}38 unmodified lines3940414243444546474819 unmodified lines68697071727374757638 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField), matching: find.text('Bob')),findsOneWidget,);});testWidgets('Finds users by email address', (WidgetTester tester) async {19 unmodified linesawait tester.pump();expect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField), matching: find.text('Charlie')),findsOneWidget,);});}
6 unmodified lines7891011121344 unmodified lines585960616263646566676 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Form is entirely visible and rejects invalid responses', (WidgetTester tester) async {await tester.pumpWidget(const example.AutocompleteExampleApp());expect(find.text('RawAutocomplete Form'), findsOneWidget);expect(find.byType(TextFormField), findsNWidgets(2));44 unmodified lines'regular user input',);await tester.tap(find.ancestor(of: find.text('This is a RawAutocomplete!'),matching: find.byType(TextFormField),));await tester.pump();expect(find.text('aardvark'), findsOneWidget);expect(find.text('bobcat'), findsOneWidget);6 unmodified lines78910111213141544 unmodified lines6061626364656667686970716 unmodified linesimport 'package:flutter_test/flutter_test.dart';void main() {testWidgets('Form is entirely visible and rejects invalid responses', (WidgetTester tester,) async {await tester.pumpWidget(const example.AutocompleteExampleApp());expect(find.text('RawAutocomplete Form'), findsOneWidget);expect(find.byType(TextFormField), findsNWidgets(2));44 unmodified lines'regular user input',);await tester.tap(find.ancestor(of: find.text('This is a RawAutocomplete!'),matching: find.byType(TextFormField),),);await tester.pump();expect(find.text('aardvark'), findsOneWidget);expect(find.text('bobcat'), findsOneWidget);
2 unmodified lines34567893 unmodified lines131415161718192021222 unmodified lines2526272829303132333421 unmodified lines565758596061626364652 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/autocomplete/raw_autocomplete.focus_node.0.dart' as example;import 'package:flutter_test/flutter_test.dart';void main() {3 unmodified linesexpect(find.byType(AppBar), findsOneWidget);expect(find.byType(TextFormField), findsOneWidget);expect(find.descendant(of: find.byType(AppBar),matching: find.byType(TextFormField)),findsOneWidget,);2 unmodified linesexpect(find.text('bobcat'), findsNothing);expect(find.text('chameleon'), findsNothing);expect(find.ancestor(matching: find.byType(AppBar),of: find.byType(RawAutocomplete)),findsNothing,);});21 unmodified linesexpect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField),matching: find.text('bobcat'),),findsOneWidget,);});2 unmodified lines3456789103 unmodified lines141516171819202 unmodified lines2324252627282921 unmodified lines515253545556572 unmodified lines// found in the LICENSE file.import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/autocomplete/raw_autocomplete.focus_node.0.dart'as example;import 'package:flutter_test/flutter_test.dart';void main() {3 unmodified linesexpect(find.byType(AppBar), findsOneWidget);expect(find.byType(TextFormField), findsOneWidget);expect(find.descendant(of: find.byType(AppBar), matching: find.byType(TextFormField)),findsOneWidget,);2 unmodified linesexpect(find.text('bobcat'), findsNothing);expect(find.text('chameleon'), findsNothing);expect(find.ancestor(matching: find.byType(AppBar), of: find.byType(RawAutocomplete)),findsNothing,);});21 unmodified linesexpect(find.byType(ListTile), findsNothing);expect(find.descendant(of: find.byType(TextFormField), matching: find.text('bobcat')),findsOneWidget,);});
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364// Copyright 2014 The Flutter Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.
import 'package:flutter/material.dart';import 'package:flutter_api_samples/widgets/autofill/autofill_group.0.dart' as example;import 'package:flutter_test/flutter_test.dart';
void main() { testWidgets('AutofillGroupExample renders and updates correctly', (WidgetTester tester) async { await tester.pumpWidget(const example.AutofillGroupExampleApp());
expect(find.text('Shipping address'), findsOneWidget); expect(find.text('Billing address'), findsOneWidget); expect(find.byType(TextField), findsNWidgets(5)); expect(find.byType(Checkbox), findsOneWidget); expect(find.text('Contact Phone Number'), findsOneWidget);
final Checkbox checkbox = tester.widget(find.byType(Checkbox)); expect(checkbox.value, isTrue);
// Tap to uncheck the checkbox (to show billing address fields). await tester.tap(find.byType(Checkbox)); await tester.pump();
expect( find.byType(AutofillGroup), findsNWidgets(3), // 3 AutofillGroup widgets created );
expect( find.byType(TextField), findsNWidgets(7), // 5 initial + 2 billing address fields );
final TextField shippingAddress1 = tester.widget(find.byType(TextField).at(0)); expect(shippingAddress1.autofillHints, contains(AutofillHints.streetAddressLine1));
final TextField shippingAddress2 = tester.widget(find.byType(TextField).at(1)); expect(shippingAddress2.autofillHints, contains(AutofillHints.streetAddressLine2));
final TextField billingAddress1 = tester.widget(find.byType(TextField).at(2)); expect(billingAddress1.autofillHints, contains(AutofillHints.streetAddressLine1));
final TextField billingAddress2 = tester.widget(find.byType(TextField).at(3)); expect(billingAddress2.autofillHints, contains(AutofillHints.streetAddressLine2));
// Credit card information fields. final TextField creditCardNumber = tester.widget(find.byType(TextField).at(4)); expect(creditCardNumber.autofillHints, contains(AutofillHints.creditCardNumber));
final TextField creditCardSecurityCode = tester.widget(find.byType(TextField).at(5)); expect(creditCardSecurityCode.autofillHints, contains(AutofillHints.creditCardSecurityCode));
// Contact phone number field. final TextField phoneNumber = tester.widget(find.byType(TextField).at(6)); expect(phoneNumber.autofillHints, contains(AutofillHints.telephoneNumber));
await tester.tap(find.byType(Checkbox)); await tester.pump();
expect(find.byType(TextField), findsNWidgets(5)); });}9 unmodified lines10111213141516171819202122232425262728299 unmodified linesvoid main() {testWidgets('AbsorbPointer prevents hit testing on its child', (WidgetTester tester) async {await tester.pumpWidget(const example.AbsorbPointerApp(),);// Get the center of the stack.final Offset center = tester.getCenter(find.byType(Stack).first);final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, pointer: 1);// Add the point to the center of the stack where the AbsorbPointer is.await gesture.addPointer(location: center);expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);// Move the pointer to the left of the stack where the AbsorbPointer is not.await gesture.moveTo(center + const Offset(-100, 0));expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.click);});}9 unmodified lines1011121314151617181920212223242526272829303132333435369 unmodified linesvoid main() {testWidgets('AbsorbPointer prevents hit testing on its child', (WidgetTester tester) async {await tester.pumpWidget(const example.AbsorbPointerApp());// Get the center of the stack.final Offset center = tester.getCenter(find.byType(Stack).first);final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse,pointer: 1,);// Add the point to the center of the stack where the AbsorbPointer is.await gesture.addPointer(location: center);expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),SystemMouseCursors.basic,);// Move the pointer to the left of the stack where the AbsorbPointer is not.await gesture.moveTo(center + const Offset(-100, 0));expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),SystemMouseCursors.click,);});}
9 unmodified lines1011121314151617189 unmodified linestestWidgets('AspectRatio applies 16 / 9 aspect ratio on its child', (WidgetTester tester) async {const double height = 100.0;await tester.pumpWidget(const example.AspectRatioApp(),);final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer.width, 800.0);9 unmodified lines101112131415169 unmodified linestestWidgets('AspectRatio applies 16 / 9 aspect ratio on its child', (WidgetTester tester) async {const double height = 100.0;await tester.pumpWidget(const example.AspectRatioApp());final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer.width, 800.0);
9 unmodified lines1011121314151617189 unmodified linestestWidgets('AspectRatio applies 2.0 aspect ratio on its child', (WidgetTester tester) async {const Size containerSize = Size(100, 100);await tester.pumpWidget(const example.AspectRatioApp(),);final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer, containerSize);9 unmodified lines101112131415169 unmodified linestestWidgets('AspectRatio applies 2.0 aspect ratio on its child', (WidgetTester tester) async {const Size containerSize = Size(100, 100);await tester.pumpWidget(const example.AspectRatioApp());final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer, containerSize);
9 unmodified lines1011121314151617189 unmodified linestestWidgets('AspectRatio applies 0.5 aspect ratio on its child', (WidgetTester tester) async {const Size containerSize = Size(100, 100);await tester.pumpWidget(const example.AspectRatioApp(),);final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer, containerSize);9 unmodified lines101112131415169 unmodified linestestWidgets('AspectRatio applies 0.5 aspect ratio on its child', (WidgetTester tester) async {const Size containerSize = Size(100, 100);await tester.pumpWidget(const example.AspectRatioApp());final Size parentContainer = tester.getSize(find.byType(Container).first);expect(parentContainer, containerSize);
flutter/examples/api/macos/Podfile-1
flutter/examples/api/pubspec.yaml+57-56
flutter/examples/api/test/flutter_test_config.dart+1-2
flutter/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.1_test.dart+3-4
flutter/examples/api/test/material/bottom_navigation_bar/bottom_navigation_bar.2_test.dart+3-4
flutter/examples/api/test/material/bottom_sheet/show_bottom_sheet.0_test.dart+4-4
flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.0_test.dart+3-4
flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.1_test.dart+3-4
flutter/examples/api/test/material/bottom_sheet/show_modal_bottom_sheet.2_test.dart+6-5
flutter/examples/api/test/material/button_style/button_style.0_test.dart+56-56
flutter/examples/api/test/material/button_style_button/button_style_button.icon_alignment.0_test.dart+7-9
flutter/examples/api/test/material/card/card.0_test.dart+5-4
flutter/examples/api/test/material/card/card.2_test.dart+21-19
flutter/examples/api/test/material/carousel/carousel.0_test.dart+29-6
flutter/examples/api/test/material/checkbox/checkbox.0_test.dart+8-28
flutter/examples/api/test/material/checkbox/checkbox.1_test.dart+2-5
flutter/examples/api/test/material/checkbox_list_tile/checkbox_list_tile.0_test.dart+3-4
flutter/examples/api/test/material/checkbox_list_tile/checkbox_list_tile.1_test.dart+4-7
flutter/examples/api/test/material/checkbox_list_tile/custom_labeled_checkbox.0_test.dart+3-4
flutter/examples/api/test/material/checkbox_list_tile/custom_labeled_checkbox.1_test.dart+3-4
flutter/examples/api/test/material/chip/chip_attributes.avatar_box_constraints.0_test.dart+24-20
flutter/examples/api/test/material/chip/chip_attributes.chip_animation_style.0_test.dart+18-17
flutter/examples/api/test/sample_templates/cupertino.0_test.dart+1-3
flutter/examples/api/test/sample_templates/material.0_test.dart+1-3
flutter/examples/api/test/sample_templates/widgets.0_test.dart+1-3
flutter/examples/api/test/widgets/actions/action.action_overridable.0_test.dart+6-6
flutter/examples/api/test/widgets/actions/action_listener.0_test.dartAdded+47
flutter/examples/api/test/widgets/actions/actions.0_test.dart+7-24
flutter/examples/api/test/widgets/actions/focusable_action_detector.0_test.dartAdded+67
flutter/examples/api/test/widgets/animated_grid/animated_grid.0_test.dart+2-5
flutter/examples/api/test/widgets/animated_grid/sliver_animated_grid.0_test.dart+2-5
flutter/examples/api/test/widgets/animated_list/animated_list.0_test.dartAdded+44
flutter/examples/api/test/widgets/animated_list/animated_list_separated.0_test.dart+47-47
flutter/examples/api/test/widgets/animated_list/sliver_animated_list.0_test.dart+34-35
flutter/examples/api/test/widgets/animated_size/animated_size.0_test.dart+8-25
flutter/examples/api/test/widgets/animated_switcher/animated_switcher.0_test.dart+5-16
flutter/examples/api/test/widgets/app/widgets_app.widgets_app.0_test.dart+1-3
flutter/examples/api/test/widgets/app_lifecycle_listener/app_lifecycle_listener.0_test.dart+3-4
flutter/examples/api/test/widgets/app_lifecycle_listener/app_lifecycle_listener.1_test.dart+4-5
flutter/examples/api/test/widgets/async/future_builder.0_test.dart+2-5
flutter/examples/api/test/widgets/async/stream_builder.0_test.dart+7-30
flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.0_test.dart+4-4
flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.1_test.dart+8-8
flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.2_test.dart+9-5
flutter/examples/api/test/widgets/autocomplete/raw_autocomplete.focus_node.0_test.dart+5-13
flutter/examples/api/test/widgets/autofill/autofill_group.0_test.dartAdded+64
flutter/examples/api/test/widgets/basic/absorb_pointer.0_test.dart+13-6
flutter/examples/api/test/widgets/basic/aspect_ratio.0_test.dart+1-3
flutter/examples/api/test/widgets/basic/aspect_ratio.1_test.dart+1-3
flutter/examples/api/test/widgets/basic/aspect_ratio.2_test.dart+1-3