From 61a0add2865c51bfee33939c1820709d1115c77d Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 8 Oct 2021 09:25:14 -0700 Subject: [PATCH] Enable avoid_redundant_argument_values lint (#91409) (#91462) --- analysis_options.yaml | 2 +- dev/benchmarks/complex_layout/lib/main.dart | 2 - .../test_memory/scroll_perf.dart | 1 - .../lib/src/color_filter_and_fade.dart | 1 - .../lib/src/filtered_child_animation.dart | 1 - .../lib/src/multi_widget_construction.dart | 1 - .../bench_pageview_scroll_linethrough.dart | 2 +- .../lib/src/web/bench_paths_recording.dart | 4 +- .../web/bench_simple_lazy_text_scroll.dart | 3 - .../lib/src/web/bench_text_layout.dart | 1 - .../lib/src/web/bench_wrapbox_scroll.dart | 1 - .../macrobenchmarks/lib/web_benchmarks.dart | 2 +- .../macrobenchmarks/test/frame_policy.dart | 2 - .../lib/foundation/change_notifier_bench.dart | 8 +- .../lib/geometry/curves_bench.dart | 2 +- .../language/sync_star_semantics_bench.dart | 2 +- .../lib/android_platform_view.dart | 1 - dev/bots/analyze_sample_code.dart | 8 +- dev/bots/browser.dart | 2 - dev/bots/prepare_package.dart | 9 - dev/bots/test.dart | 4 +- dev/bots/test/analyze_test.dart | 2 +- dev/bots/test/prepare_package_test.dart | 3 +- dev/bots/unpublish_package.dart | 3 - dev/conductor/core/lib/src/repository.dart | 1 - dev/conductor/core/lib/src/roll_dev.dart | 1 - dev/conductor/core/lib/src/state.dart | 8 +- dev/conductor/core/lib/src/status.dart | 1 - dev/conductor/core/test/repository_test.dart | 2 +- dev/conductor/core/test/roll_dev_test.dart | 2 +- dev/conductor/ui/lib/main.dart | 1 - dev/conductor/ui/lib/widgets/progression.dart | 11 +- .../ui/test/widgets/stepper_test.dart | 2 - dev/customer_testing/run_tests.dart | 4 - dev/devicelab/bin/run.dart | 4 - .../bin/tasks/animated_image_gc_perf.dart | 2 - ...out_scroll_perf_ios__timeline_summary.dart | 2 +- .../tasks/ios_app_with_extensions_test.dart | 6 - .../tasks/large_image_changer_perf_ios.dart | 2 - ...rop_filter_perf_ios__timeline_summary.dart | 2 +- dev/devicelab/bin/tasks/routing_test.dart | 1 - .../bin/tasks/simple_animation_perf_ios.dart | 2 +- dev/devicelab/lib/command/test.dart | 2 - dev/devicelab/lib/framework/devices.dart | 5 +- dev/devicelab/lib/framework/utils.dart | 2 +- .../lib/tasks/dart_plugin_registry_tests.dart | 1 - dev/devicelab/lib/tasks/web_benchmarks.dart | 2 - dev/devicelab/test/adb_test.dart | 18 +- .../test/running_processes_test.dart | 2 +- .../lib/src/tests/text_field_page.dart | 2 - .../android_views/lib/motion_events_page.dart | 4 +- .../channels/lib/src/method_calls.dart | 15 +- .../lib/demo/animation/widgets.dart | 3 - .../lib/demo/calculator/logic.dart | 2 +- .../flutter_gallery/lib/demo/colors_demo.dart | 1 - .../cupertino/cupertino_navigation_demo.dart | 1 - .../demo/cupertino/cupertino_picker_demo.dart | 1 - .../cupertino_segmented_control_demo.dart | 2 - .../demo/cupertino/cupertino_slider_demo.dart | 2 - .../demo/material/bottom_app_bar_demo.dart | 1 - .../lib/demo/material/buttons_demo.dart | 1 - .../lib/demo/material/chip_demo.dart | 2 +- .../lib/demo/material/dialog_demo.dart | 2 - .../demo/material/expansion_panels_demo.dart | 1 - .../lib/demo/material/slider_demo.dart | 6 - .../lib/demo/material/tabs_demo.dart | 1 - .../demo/material/text_form_field_demo.dart | 1 - .../demo/shrine/expanding_bottom_sheet.dart | 4 +- .../lib/demo/shrine/shopping_cart.dart | 1 - .../shrine/supplemental/product_card.dart | 2 - .../lib/gallery/example_code.dart | 1 - .../flutter_gallery/lib/gallery/home.dart | 3 - .../flutter_gallery/test/smoke_test.dart | 2 +- .../test_driver/run_demos.dart | 2 +- .../test_driver/transitions_perf_e2e.dart | 2 +- .../test_memory/memory_nav.dart | 1 - .../lib/motion_events_page.dart | 4 +- .../web_e2e_tests/lib/scroll_wheel_main.dart | 1 - dev/manual_tests/lib/drag_and_drop.dart | 4 - dev/manual_tests/lib/hover.dart | 1 - dev/manual_tests/lib/text.dart | 1 - dev/tools/dartdoc.dart | 8 +- dev/tools/examples_smoke_test.dart | 3 +- dev/tools/gen_keycodes/bin/gen_keycodes.dart | 2 - dev/tools/gen_keycodes/lib/constants.dart | 2 +- dev/tools/gen_keycodes/lib/ios_code_gen.dart | 2 +- .../lib/keyboard_keys_code_gen.dart | 4 +- .../lib/testing_key_codes_gen.dart | 2 +- .../localization/bin/gen_subtag_registry.dart | 2 +- .../localization/localizations_utils.dart | 5 +- dev/tools/mega_gallery.dart | 2 +- dev/tools/update_icons.dart | 4 +- .../api/lib/animation/curves/curve2_d.0.dart | 4 +- .../cupertino_sliver_refresh_control.0.dart | 2 - .../pointer_signal_resolver.0.dart | 1 - .../date_picker/show_date_picker.0.dart | 4 +- .../date_picker/show_date_range_picker.0.dart | 6 +- .../material/dropdown/dropdown_button.0.dart | 1 - .../lib/material/list_tile/list_tile.5.dart | 2 - .../material_state_border_side.0.dart | 2 +- .../material/radio/radio.toggleable.0.dart | 1 - .../material/range_slider/range_slider.0.dart | 1 - .../api/lib/material/slider/slider.0.dart | 1 - .../actions/action.action_overridable.0.dart | 59 ++-- .../widgets/actions/action_listener.0.dart | 1 - .../animated_list/animated_list.0.dart | 2 - .../animated_list/sliver_animated_list.0.dart | 3 - .../lib/widgets/async/future_builder.0.dart | 1 - .../lib/widgets/async/stream_builder.0.dart | 1 - .../autocomplete/raw_autocomplete.2.dart | 1 - .../lib/widgets/basic/absorb_pointer.0.dart | 1 - .../api/lib/widgets/basic/expanded.1.dart | 1 - .../lib/widgets/page_view/page_view.0.dart | 3 +- .../decorated_box_transition.0.dart | 2 - examples/layers/rendering/flex_layout.dart | 2 +- examples/layers/rendering/hello_world.dart | 1 - .../layers/rendering/spinning_square.dart | 1 - examples/layers/widgets/sectors.dart | 2 +- .../src/animation/animation_controller.dart | 1 - .../flutter/lib/src/animation/curves.dart | 2 +- .../lib/src/cupertino/bottom_tab_bar.dart | 3 +- .../lib/src/cupertino/context_menu.dart | 21 +- .../src/cupertino/context_menu_action.dart | 2 +- .../lib/src/cupertino/date_picker.dart | 3 +- .../src/cupertino/desktop_text_selection.dart | 1 - .../flutter/lib/src/cupertino/dialog.dart | 6 +- .../flutter/lib/src/cupertino/nav_bar.dart | 6 +- .../flutter/lib/src/cupertino/picker.dart | 2 +- .../cupertino/sliding_segmented_control.dart | 1 - .../flutter/lib/src/cupertino/text_field.dart | 1 - .../lib/src/foundation/assertions.dart | 5 +- .../flutter/lib/src/foundation/constants.dart | 4 +- .../lib/src/foundation/diagnostics.dart | 8 +- .../flutter/lib/src/gestures/binding.dart | 1 - .../flutter/lib/src/gestures/monodrag.dart | 1 - packages/flutter/lib/src/gestures/scale.dart | 2 +- .../lib/src/gestures/velocity_tracker.dart | 4 +- packages/flutter/lib/src/material/about.dart | 5 +- packages/flutter/lib/src/material/app.dart | 1 - .../flutter/lib/src/material/app_bar.dart | 1 - packages/flutter/lib/src/material/banner.dart | 1 - .../src/material/bottom_navigation_bar.dart | 2 - .../lib/src/material/bottom_sheet.dart | 1 - .../lib/src/material/button_bar_theme.dart | 1 - .../src/material/calendar_date_picker.dart | 8 +- packages/flutter/lib/src/material/chip.dart | 7 - .../flutter/lib/src/material/date_picker.dart | 4 +- .../src/material/date_picker_deprecated.dart | 1 - packages/flutter/lib/src/material/drawer.dart | 3 +- .../flutter/lib/src/material/dropdown.dart | 5 +- .../lib/src/material/elevated_button.dart | 1 - .../lib/src/material/grid_tile_bar.dart | 1 - .../flutter/lib/src/material/material.dart | 1 - .../lib/src/material/mergeable_material.dart | 1 - .../lib/src/material/navigation_rail.dart | 2 - .../lib/src/material/outlined_button.dart | 1 - .../src/material/paginated_data_table.dart | 1 - .../lib/src/material/range_slider.dart | 1 - .../flutter/lib/src/material/scaffold.dart | 8 +- .../flutter/lib/src/material/shadows.dart | 20 +- packages/flutter/lib/src/material/slider.dart | 1 - .../flutter/lib/src/material/snack_bar.dart | 1 - packages/flutter/lib/src/material/tabs.dart | 1 - .../flutter/lib/src/material/text_button.dart | 1 - .../flutter/lib/src/material/tooltip.dart | 6 +- .../lib/src/material/tooltip_theme.dart | 6 +- .../flutter/lib/src/material/typography.dart | 260 ++++++++--------- .../flutter/lib/src/painting/borders.dart | 1 - .../lib/src/painting/notched_shapes.dart | 2 +- .../flutter/lib/src/painting/strut_style.dart | 2 +- .../flutter/lib/src/rendering/binding.dart | 2 +- packages/flutter/lib/src/rendering/box.dart | 2 - .../lib/src/rendering/custom_layout.dart | 1 - .../lib/src/rendering/custom_paint.dart | 2 +- .../rendering/debug_overflow_indicator.dart | 2 - .../flutter/lib/src/rendering/editable.dart | 8 +- .../flutter/lib/src/rendering/object.dart | 5 +- .../flutter/lib/src/rendering/paragraph.dart | 8 +- .../lib/src/rendering/sliver_list.dart | 1 - packages/flutter/lib/src/rendering/table.dart | 18 +- .../lib/src/services/keyboard_key.dart | 10 +- .../lib/src/services/message_codecs.dart | 2 +- .../lib/src/services/platform_channel.dart | 2 +- .../lib/src/services/raw_keyboard.dart | 8 +- .../lib/src/services/system_channels.dart | 4 - .../lib/src/services/system_chrome.dart | 4 - .../lib/src/widgets/animated_cross_fade.dart | 3 +- .../flutter/lib/src/widgets/autofill.dart | 2 +- .../flutter/lib/src/widgets/framework.dart | 4 +- .../flutter/lib/src/widgets/image_icon.dart | 1 - .../lib/src/widgets/interactive_viewer.dart | 7 - .../lib/src/widgets/modal_barrier.dart | 1 - .../lib/src/widgets/navigation_toolbar.dart | 1 - .../flutter/lib/src/widgets/navigator.dart | 2 +- .../lib/src/widgets/nested_scroll_view.dart | 1 - .../flutter/lib/src/widgets/page_view.dart | 1 - packages/flutter/lib/src/widgets/routes.dart | 2 +- packages/flutter/lib/src/widgets/table.dart | 2 +- .../widgets/text_editing_action_target.dart | 4 - .../lib/src/widgets/widget_inspector.dart | 9 +- .../animation/animation_controller_test.dart | 25 +- .../test/animation/animation_sheet_test.dart | 2 - .../flutter/test/animation/curves_test.dart | 17 -- .../test/animation/live_binding_test.dart | 4 +- .../flutter/test/animation/tween_test.dart | 18 +- .../cupertino/activity_indicator_test.dart | 12 +- .../flutter/test/cupertino/button_test.dart | 2 +- .../flutter/test/cupertino/colors_test.dart | 20 +- .../test/cupertino/context_menu_test.dart | 3 - .../test/cupertino/date_picker_test.dart | 18 +- .../flutter/test/cupertino/dialog_test.dart | 4 +- .../cupertino/material/tab_scaffold_test.dart | 4 +- .../flutter/test/cupertino/nav_bar_test.dart | 4 - .../flutter/test/cupertino/route_test.dart | 4 +- .../flutter/test/cupertino/scaffold_test.dart | 3 - .../test/cupertino/scrollbar_test.dart | 1 - .../cupertino/segmented_control_test.dart | 4 +- .../flutter/test/cupertino/switch_test.dart | 1 - .../test/cupertino/tab_scaffold_test.dart | 13 +- packages/flutter/test/cupertino/tab_test.dart | 1 - .../text_field_restoration_test.dart | 1 - .../test/cupertino/text_field_test.dart | 25 +- .../test/cupertino/text_selection_test.dart | 1 - .../test/foundation/diagnostics_test.dart | 2 - .../test/foundation/stack_frame_test.dart | 130 ++++----- packages/flutter/test/gestures/drag_test.dart | 34 +-- .../flutter/test/gestures/events_test.dart | 1 - .../test/gestures/force_press_test.dart | 80 ++---- ...binding_resample_event_on_widget_test.dart | 2 - .../gesture_binding_resample_event_test.dart | 4 +- .../test/gestures/gesture_binding_test.dart | 24 +- .../test/gestures/long_press_test.dart | 1 - .../flutter/test/gestures/multitap_test.dart | 4 +- .../test/gestures/pointer_router_test.dart | 2 +- .../flutter/test/gestures/scale_test.dart | 12 +- packages/flutter/test/gestures/tap_test.dart | 2 +- .../flutter/test/material/about_test.dart | 22 +- .../flutter/test/material/app_bar_test.dart | 27 +- .../test/material/app_bar_theme_test.dart | 2 +- packages/flutter/test/material/app_test.dart | 2 - .../test/material/bottom_app_bar_test.dart | 19 +- .../material/bottom_navigation_bar_test.dart | 10 - .../test/material/button_style_test.dart | 4 +- .../test/material/button_theme_test.dart | 1 - .../material/calendar_date_picker_test.dart | 33 ++- packages/flutter/test/material/card_test.dart | 3 +- .../flutter/test/material/checkbox_test.dart | 8 +- packages/flutter/test/material/chip_test.dart | 54 +--- .../test/material/chip_theme_test.dart | 24 +- .../test/material/data_table_test.dart | 8 +- .../test/material/date_picker_test.dart | 10 +- .../test/material/date_range_picker_test.dart | 21 +- .../flutter/test/material/dialog_test.dart | 13 +- .../test/material/dialog_theme_test.dart | 1 - .../flutter/test/material/drawer_test.dart | 2 +- .../material/dropdown_form_field_test.dart | 24 +- .../flutter/test/material/dropdown_test.dart | 67 ++--- .../test/material/elevated_button_test.dart | 7 +- .../material/elevated_button_theme_test.dart | 2 +- .../test/material/expand_icon_test.dart | 4 - .../test/material/expansion_panel_test.dart | 6 - .../test/material/expansion_tile_test.dart | 6 - .../test/material/flat_button_test.dart | 12 +- ...flexible_space_bar_collapse_mode_test.dart | 1 - .../floating_action_button_location_test.dart | 3 +- .../material/floating_action_button_test.dart | 2 +- .../test/material/icon_button_test.dart | 1 - .../test/material/inherited_theme_test.dart | 3 - .../flutter/test/material/ink_well_test.dart | 1 - .../input_date_picker_form_field_test.dart | 3 +- .../test/material/input_decorator_test.dart | 38 +-- .../flutter/test/material/list_tile_test.dart | 43 +-- .../test/material/material_button_test.dart | 7 +- .../flutter/test/material/material_test.dart | 12 +- .../test/material/navigation_bar_test.dart | 8 +- .../material/navigation_bar_theme_test.dart | 2 - .../test/material/outline_button_test.dart | 14 +- .../test/material/outlined_button_test.dart | 30 +- .../material/outlined_button_theme_test.dart | 4 +- packages/flutter/test/material/page_test.dart | 2 +- .../material/paginated_data_table_test.dart | 2 - .../persistent_bottom_sheet_test.dart | 1 - .../test/material/popup_menu_test.dart | 1 - .../material/progress_indicator_test.dart | 4 +- .../flutter/test/material/radio_test.dart | 4 +- .../test/material/raised_button_test.dart | 7 +- .../test/material/range_slider_test.dart | 15 - .../material/raw_material_button_test.dart | 7 +- .../test/material/reorderable_list_test.dart | 5 - .../flutter/test/material/scaffold_test.dart | 9 - .../flutter/test/material/scrollbar_test.dart | 2 - .../flutter/test/material/search_test.dart | 13 +- .../flutter/test/material/slider_test.dart | 35 +-- .../test/material/slider_theme_test.dart | 4 - .../flutter/test/material/snack_bar_test.dart | 4 +- .../flutter/test/material/stepper_test.dart | 9 +- .../test/material/switch_list_tile_test.dart | 6 +- .../flutter/test/material/switch_test.dart | 5 +- .../test/material/tab_bar_theme_test.dart | 3 +- .../material/tabbed_scrollview_warp_test.dart | 2 +- packages/flutter/test/material/tabs_test.dart | 29 +- .../test/material/text_button_test.dart | 10 +- .../test/material/text_button_theme_test.dart | 2 +- .../material/text_field_restoration_test.dart | 1 - .../test/material/text_field_test.dart | 65 ++--- .../text_form_field_restoration_test.dart | 5 +- .../test/material/text_form_field_test.dart | 8 +- .../test/material/text_selection_test.dart | 2 +- .../material/text_selection_theme_test.dart | 3 - .../test/material/text_theme_test.dart | 8 +- .../test/material/theme_data_test.dart | 4 +- .../test/material/theme_defaults_test.dart | 2 +- .../test/material/time_picker_test.dart | 11 +- .../test/material/toggle_buttons_test.dart | 4 - .../material/toggle_buttons_theme_test.dart | 1 - .../test/material/typography_test.dart | 5 +- .../flutter/test/painting/binding_test.dart | 1 - .../test/painting/border_radius_test.dart | 15 +- .../test/painting/border_rtl_test.dart | 10 +- .../test/painting/border_side_test.dart | 14 +- .../flutter/test/painting/border_test.dart | 14 +- .../test/painting/box_painter_test.dart | 5 +- .../test/painting/decoration_test.dart | 32 +-- .../test/painting/edge_insets_test.dart | 4 +- .../flutter/test/painting/geometry_test.dart | 10 - .../flutter/test/painting/gradient_test.dart | 5 - .../image_provider_resize_image_test.dart | 2 +- .../test/painting/matrix_utils_test.dart | 3 +- .../test/painting/mocks_for_image_cache.dart | 2 +- .../rounded_rectangle_border_test.dart | 8 +- .../test/painting/shape_decoration_test.dart | 12 +- .../test/painting/stadium_border_test.dart | 12 +- .../test/painting/text_painter_rtl_test.dart | 66 ++--- .../test/painting/text_painter_test.dart | 13 +- .../flutter/test/painting/text_span_test.dart | 4 +- .../test/painting/text_style_test.dart | 4 +- .../flutter/test/physics/newton_test.dart | 2 - .../test/rendering/annotated_region_test.dart | 4 +- .../flutter/test/rendering/baseline_test.dart | 10 +- .../test/rendering/box_constraints_test.dart | 10 - packages/flutter/test/rendering/box_test.dart | 5 +- .../flutter/test/rendering/debug_test.dart | 2 +- .../rendering/dynamic_intrinsics_test.dart | 6 - .../flutter/test/rendering/editable_test.dart | 12 +- .../flutter/test/rendering/flex_test.dart | 14 - .../rendering/independent_layout_test.dart | 1 - .../rendering/layer_annotations_test.dart | 6 +- .../rendering/mouse_tracker_cursor_test.dart | 6 +- .../test/rendering/mouse_tracker_test.dart | 4 +- .../non_render_object_root_test.dart | 1 - .../test/rendering/paragraph_test.dart | 12 +- .../test/rendering/proxy_box_test.dart | 8 - .../test/rendering/proxy_sliver_test.dart | 9 - .../flutter/test/rendering/reattach_test.dart | 4 +- .../test/rendering/repaint_boundary_test.dart | 10 +- .../semantics_and_children_test.dart | 1 - .../test/rendering/sliver_cache_test.dart | 5 - .../sliver_fixed_extent_layout_test.dart | 1 - .../sliver_persistent_header_test.dart | 2 - .../test/rendering/slivers_block_test.dart | 3 - .../flutter/test/rendering/slivers_test.dart | 5 - .../test/rendering/table_border_test.dart | 11 +- .../flutter/test/rendering/table_test.dart | 2 +- .../test/rendering/viewport_caching_test.dart | 1 - .../flutter/test/rendering/viewport_test.dart | 31 +- .../test/semantics/semantics_test.dart | 11 +- .../default_binary_messenger_test.dart | 2 +- .../test/services/message_codecs_test.dart | 1 - .../test/services/platform_channel_test.dart | 4 +- .../test/services/raw_keyboard_test.dart | 17 -- .../test/services/text_formatter_test.dart | 26 +- .../test/services/text_input_test.dart | 8 +- .../test/widgets/absorb_pointer_test.dart | 5 +- .../flutter/test/widgets/actions_test.dart | 19 +- packages/flutter/test/widgets/align_test.dart | 3 - .../test/widgets/animated_list_test.dart | 4 +- .../test/widgets/animated_switcher_test.dart | 51 +--- packages/flutter/test/widgets/app_test.dart | 1 - packages/flutter/test/widgets/async_test.dart | 25 +- .../test/widgets/autocomplete_test.dart | 1 - .../test/widgets/autofill_group_test.dart | 5 - .../widgets/automatic_keep_alive_test.dart | 2 +- packages/flutter/test/widgets/basic_test.dart | 8 - .../test/widgets/box_decoration_test.dart | 12 +- packages/flutter/test/widgets/clip_test.dart | 1 - .../flutter/test/widgets/container_test.dart | 9 +- .../test/widgets/custom_paint_test.dart | 2 +- .../test/widgets/custom_painter_test.dart | 4 +- .../default_text_editing_actions_test.dart | 2 +- .../default_text_height_behavior_test.dart | 2 - .../test/widgets/dismissible_test.dart | 45 +-- .../draggable_scrollable_sheet_test.dart | 1 - .../flutter/test/widgets/draggable_test.dart | 3 +- .../widgets/editable_text_cursor_test.dart | 18 +- .../editable_text_show_on_screen_test.dart | 8 +- .../test/widgets/editable_text_test.dart | 270 +++++++----------- .../test/widgets/editable_text_utils.dart | 1 - .../test/widgets/ensure_visible_test.dart | 1 - .../flutter/test/widgets/fitted_box_test.dart | 2 - .../test/widgets/focus_manager_test.dart | 12 +- .../test/widgets/focus_scope_test.dart | 24 +- .../test/widgets/focus_traversal_test.dart | 2 - packages/flutter/test/widgets/form_test.dart | 40 +-- .../gesture_detector_semantics_test.dart | 1 - .../test/widgets/gesture_detector_test.dart | 19 -- .../widgets/gesture_disambiguation_test.dart | 1 - .../flutter/test/widgets/grid_view_test.dart | 1 - .../flutter/test/widgets/heroes_test.dart | 3 - .../test/widgets/hit_testing_test.dart | 2 +- .../test/widgets/image_resolution_test.dart | 1 - .../flutter/test/widgets/image_rtl_test.dart | 2 - packages/flutter/test/widgets/image_test.dart | 23 +- .../test/widgets/implicit_semantics_test.dart | 3 - .../flutter/test/widgets/inherited_test.dart | 3 +- .../test/widgets/interactive_viewer_test.dart | 5 - .../test/widgets/keyboard_listener_test.dart | 6 +- .../flutter/test/widgets/list_body_test.dart | 1 - .../test/widgets/list_view_misc_test.dart | 2 +- .../test/widgets/list_view_relayout_test.dart | 8 +- .../flutter/test/widgets/list_view_test.dart | 4 +- .../test/widgets/list_view_vertical_test.dart | 2 - .../widgets/list_wheel_scroll_view_test.dart | 1 - .../flutter/test/widgets/listener_test.dart | 4 +- .../test/widgets/modal_barrier_test.dart | 5 +- .../test/widgets/mouse_region_test.dart | 31 +- .../widgets/navigator_restoration_test.dart | 4 +- .../flutter/test/widgets/navigator_test.dart | 11 - .../flutter/test/widgets/opacity_test.dart | 2 - .../test/widgets/overflow_bar_test.dart | 2 +- .../test/widgets/page_route_builder_test.dart | 1 - .../flutter/test/widgets/page_view_test.dart | 23 +- .../test/widgets/pageable_list_test.dart | 1 - .../test/widgets/physical_model_test.dart | 3 +- .../test/widgets/platform_view_test.dart | 2 - .../widgets/raw_keyboard_listener_test.dart | 6 +- .../test/widgets/restoration_mixin_test.dart | 8 +- .../test/widgets/restoration_scope_test.dart | 1 - .../flutter/test/widgets/rich_text_test.dart | 8 - .../flutter/test/widgets/safe_area_test.dart | 5 - .../test/widgets/scroll_activity_test.dart | 2 +- .../test/widgets/scroll_controller_test.dart | 2 +- .../test/widgets/scroll_position_test.dart | 1 - .../test/widgets/scroll_view_test.dart | 25 +- .../scrollable_list_hit_testing_test.dart | 1 - ...llable_semantics_traversal_order_test.dart | 5 - .../flutter/test/widgets/scrollable_test.dart | 7 +- .../flutter/test/widgets/scrollbar_test.dart | 7 - .../test/widgets/selectable_text_test.dart | 31 +- .../test/widgets/semantics_1_test.dart | 2 - .../test/widgets/semantics_2_test.dart | 1 - .../widgets/semantics_traversal_test.dart | 1 - .../test/widgets/shader_mask_test.dart | 3 - .../test/widgets/shape_decoration_test.dart | 8 +- .../single_child_scroll_view_test.dart | 5 +- .../widgets/sliver_fill_remaining_test.dart | 5 - .../widgets/sliver_fill_viewport_test.dart | 1 - .../test/widgets/sliver_visibility_test.dart | 14 +- .../slivers_appbar_floating_pinned_test.dart | 2 - .../widgets/slivers_appbar_pinned_test.dart | 2 +- .../test/widgets/slivers_evil_test.dart | 2 - .../test/widgets/slivers_padding_test.dart | 1 - .../flutter/test/widgets/slivers_test.dart | 5 - .../flutter/test/widgets/spacer_test.dart | 2 +- packages/flutter/test/widgets/stack_test.dart | 4 +- packages/flutter/test/widgets/table_test.dart | 2 +- .../text_editing_action_target_test.dart | 2 - .../test/widgets/text_golden_test.dart | 16 +- .../test/widgets/text_selection_test.dart | 22 -- ...election_toolbar_layout_delegate_test.dart | 2 +- packages/flutter/test/widgets/text_test.dart | 8 +- .../flutter/test/widgets/texture_test.dart | 2 +- .../test/widgets/transitions_test.dart | 7 - .../flutter/test/widgets/visibility_test.dart | 14 +- .../test/widgets/widget_inspector_test.dart | 8 - packages/flutter/test/widgets/wrap_test.dart | 18 -- .../lib/src/common/handler_factory.dart | 2 +- .../lib/src/driver/vmservice_driver.dart | 1 - .../test/src/real_tests/extension_test.dart | 8 +- .../src/real_tests/flutter_driver_test.dart | 6 +- .../src/real_tests/timeline_summary_test.dart | 1 - .../test/cupertino/translations_test.dart | 4 +- .../test/material/date_picker_test.dart | 5 +- .../test/material/date_time_test.dart | 11 +- .../test/material/tabs_test.dart | 1 - .../test/material/translations_test.dart | 88 +++--- .../test/override_test.dart | 2 +- packages/flutter_test/lib/src/binding.dart | 2 +- packages/flutter_test/lib/src/controller.dart | 2 - .../lib/src/event_simulation.dart | 4 +- packages/flutter_test/lib/src/image.dart | 2 +- .../src/test_default_binary_messenger.dart | 4 +- .../flutter_test/test/controller_test.dart | 12 +- packages/flutter_test/test/finders_test.dart | 14 +- packages/flutter_test/test/goldens_test.dart | 2 +- .../test/live_widget_controller_test.dart | 2 - .../test/widget_tester_live_device_test.dart | 2 +- .../flutter_test/test/widget_tester_test.dart | 2 - .../flutter_tools/bin/fuchsia_attach.dart | 2 - .../flutter_tools/bin/fuchsia_tester.dart | 1 - packages/flutter_tools/lib/runner.dart | 2 +- ...red_components_gen_snapshot_validator.dart | 1 - .../flutter_tools/lib/src/base/config.dart | 3 +- .../lib/src/base/error_handling_io.dart | 4 +- .../lib/src/build_system/build_system.dart | 9 +- .../lib/src/build_system/file_store.dart | 2 +- .../lib/src/build_system/targets/android.dart | 1 - .../lib/src/build_system/targets/assets.dart | 1 - .../lib/src/build_system/targets/common.dart | 2 - .../targets/dart_plugin_registrant.dart | 1 - .../lib/src/build_system/targets/ios.dart | 1 - .../lib/src/build_system/targets/macos.dart | 1 - .../lib/src/commands/build_appbundle.dart | 1 - .../lib/src/commands/build_bundle.dart | 1 - .../lib/src/commands/build_ios.dart | 2 +- .../lib/src/commands/build_ios_framework.dart | 2 +- .../lib/src/commands/build_web.dart | 2 +- .../lib/src/commands/custom_devices.dart | 5 +- .../lib/src/commands/daemon.dart | 2 +- .../flutter_tools/lib/src/commands/run.dart | 3 +- .../lib/src/commands/upgrade.dart | 3 +- packages/flutter_tools/lib/src/compile.dart | 2 +- .../flutter_tools/lib/src/context_runner.dart | 2 +- .../custom_devices/custom_device_config.dart | 3 +- packages/flutter_tools/lib/src/devfs.dart | 2 +- .../lib/src/drive/web_driver_service.dart | 1 - packages/flutter_tools/lib/src/features.dart | 31 -- .../flutter_tools/lib/src/flutter_cache.dart | 1 - .../lib/src/flutter_plugins.dart | 2 +- .../lib/src/ios/code_signing.dart | 2 - .../lib/src/isolated/devfs_web.dart | 2 +- .../lib/src/isolated/resident_web_runner.dart | 8 +- .../lib/src/localizations/gen_l10n.dart | 4 +- .../localizations/localizations_utils.dart | 2 +- packages/flutter_tools/lib/src/project.dart | 1 - .../lib/src/reporting/usage.dart | 12 +- .../lib/src/resident_runner.dart | 4 +- packages/flutter_tools/lib/src/run_hot.dart | 18 +- .../lib/src/test/test_compiler.dart | 2 +- packages/flutter_tools/lib/src/version.dart | 7 +- packages/flutter_tools/lib/src/vmservice.dart | 1 - .../flutter_tools/lib/src/xcode_project.dart | 1 - .../hermetic/analyze_continuously_test.dart | 4 +- .../hermetic/build_fuchsia_test.dart | 3 +- .../hermetic/build_ios_test.dart | 1 - .../hermetic/build_ipa_test.dart | 1 - .../hermetic/build_linux_test.dart | 7 +- .../hermetic/build_macos_test.dart | 7 +- .../hermetic/build_web_test.dart | 5 +- .../hermetic/build_windows_test.dart | 7 +- .../hermetic/custom_devices.dart | 17 +- .../commands.shard/hermetic/doctor_test.dart | 6 +- .../hermetic/downgrade_test.dart | 3 +- .../commands.shard/hermetic/drive_test.dart | 2 +- .../hermetic/precache_test.dart | 10 +- .../commands.shard/hermetic/run_test.dart | 6 +- .../commands.shard/hermetic/test_test.dart | 6 +- .../permeable/build_apk_test.dart | 2 - .../permeable/build_bundle_test.dart | 6 +- .../commands.shard/permeable/create_test.dart | 16 +- .../permeable/devices_test.dart | 2 +- .../permeable/packages_test.dart | 8 +- .../permeable/upgrade_test.dart | 5 +- .../test/general.shard/analytics_test.dart | 8 +- .../android_device_discovery_test.dart | 2 +- .../android_device_port_forwarder_test.dart | 1 - .../android/android_device_start_test.dart | 6 +- .../android/android_device_stop_test.dart | 2 +- .../android/android_device_test.dart | 4 +- .../android/android_emulator_test.dart | 1 - .../android/android_gradle_builder_test.dart | 10 - .../android/android_install_test.dart | 2 +- .../android/android_sdk_test.dart | 20 +- .../android/android_studio_test.dart | 1 - .../android_studio_validator_test.dart | 1 - .../android/android_workflow_test.dart | 40 +-- .../general.shard/android/gradle_test.dart | 12 +- .../android/gradle_utils_test.dart | 2 +- .../general.shard/artifact_updater_test.dart | 2 +- .../test/general.shard/artifacts_test.dart | 4 +- .../test/general.shard/asset_bundle_test.dart | 14 +- .../test/general.shard/base/build_test.dart | 13 - .../base/error_handling_io_test.dart | 7 +- .../general.shard/base/file_system_test.dart | 2 +- .../test/general.shard/base/io_test.dart | 2 +- .../test/general.shard/base/logger_test.dart | 29 +- .../test/general.shard/base/net_test.dart | 8 +- .../test/general.shard/base/os_test.dart | 18 +- .../test/general.shard/base/process_test.dart | 6 +- .../general.shard/base/terminal_test.dart | 4 +- .../base/user_messages_test.dart | 2 +- .../build_system/build_system_test.dart | 3 +- .../build_system/source_test.dart | 2 +- .../build_system/targets/android_test.dart | 2 +- .../build_system/targets/assets_test.dart | 2 +- .../build_system/targets/common_test.dart | 2 +- .../targets/dart_plugin_registrant_test.dart | 25 +- .../targets/deferred_components_test.dart | 13 +- .../targets/icon_tree_shaker_test.dart | 2 +- .../build_system/targets/web_test.dart | 1 - .../test/general.shard/cache_test.dart | 38 +-- .../test/general.shard/cold_test.dart | 16 +- .../general.shard/commands/build_test.dart | 13 +- .../compile_expression_test.dart | 2 +- .../compile_incremental_test.dart | 4 +- .../test/general.shard/config_test.dart | 3 +- .../general.shard/crash_reporting_test.dart | 3 +- .../custom_devices/custom_device_test.dart | 6 +- .../custom_device_workflow_test.dart | 2 +- .../custom_devices_config_test.dart | 3 +- .../dart/language_version_test.dart | 1 - .../test/general.shard/dart/pub_get_test.dart | 63 ++-- .../general.shard/desktop_device_test.dart | 1 - .../test/general.shard/device_test.dart | 2 +- .../test/general.shard/doctor.dart | 9 +- .../drive/drive_service_test.dart | 4 +- .../test/general.shard/emulator_test.dart | 2 +- .../general.shard/flutter_manifest_test.dart | 27 +- .../general.shard/flutter_platform_test.dart | 2 - .../flutter_tester_device_test.dart | 7 - .../general.shard/flutter_validator_test.dart | 1 - .../fuchsia/fuchsia_dev_finder_test.dart | 2 - .../fuchsia/fuchsia_device_start_test.dart | 6 +- .../fuchsia/fuchsia_device_test.dart | 44 ++- .../fuchsia/fuchsia_ffx_test.dart | 4 - .../fuchsia/fuchsia_workflow_test.dart | 28 +- .../generate_localizations_test.dart | 4 - .../test/general.shard/hot_test.dart | 29 +- .../integration_test_device_test.dart | 2 +- .../intellij/intellij_validator_test.dart | 1 - .../general.shard/ios/code_signing_test.dart | 2 +- .../test/general.shard/ios/devices_test.dart | 2 +- .../ios/ios_device_install_test.dart | 2 +- .../ios/ios_device_port_forwarder_test.dart | 5 +- .../general.shard/ios/ios_workflow_test.dart | 10 +- .../general.shard/ios/xcodeproj_test.dart | 2 +- .../linux/linux_device_test.dart | 6 +- .../linux/linux_workflow_test.dart | 3 +- .../macos/macos_device_test.dart | 6 +- .../macos/macos_workflow_test.dart | 6 +- .../test/general.shard/plugins_test.dart | 4 +- .../general.shard/reporting/events_test.dart | 2 +- .../general.shard/resident_runner_test.dart | 39 +-- .../resident_web_runner_cold_test.dart | 5 - .../resident_web_runner_test.dart | 39 +-- .../runner/flutter_command_test.dart | 2 +- .../general.shard/runner/runner_test.dart | 3 +- .../general.shard/terminal_handler_test.dart | 13 +- .../test/test_compiler_test.dart | 1 - .../tester/flutter_tester_test.dart | 2 +- .../test/general.shard/version_test.dart | 4 +- .../general.shard/vscode/vscode_test.dart | 2 +- .../general.shard/web/devfs_web_test.dart | 3 +- .../test/general.shard/web/devices_test.dart | 14 +- .../web/web_asset_server_test.dart | 1 - .../test/general.shard/web/workflow_test.dart | 4 +- .../windows/windows_device_test.dart | 4 +- .../windows/windows_workflow_test.dart | 6 +- .../integration.shard/analyze_once_test.dart | 2 - .../integration.shard/plist_parser_test.dart | 3 +- .../test/integration.shard/test_driver.dart | 6 +- .../test/src/custom_devices_common.dart | 2 - .../test/src/fake_process_manager.dart | 5 - .../test/web.shard/chrome_test.dart | 2 - .../test/web.shard/vm_service_web_test.dart | 2 +- .../test/plugin_registry_test.dart | 4 +- .../lib/src/dart/dart_vm.dart | 1 - .../lib/src/fuchsia_remote_connection.dart | 3 +- 667 files changed, 1694 insertions(+), 3386 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 55c346a3c6..f34fbe346b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -74,7 +74,7 @@ linter: # - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it - avoid_print # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) - # - avoid_redundant_argument_values # not yet tested + - avoid_redundant_argument_values - avoid_relative_lib_imports - avoid_renaming_method_parameters - avoid_return_types_on_setters diff --git a/dev/benchmarks/complex_layout/lib/main.dart b/dev/benchmarks/complex_layout/lib/main.dart index ab5249fc64..65f289edaf 100644 --- a/dev/benchmarks/complex_layout/lib/main.dart +++ b/dev/benchmarks/complex_layout/lib/main.dart @@ -370,7 +370,6 @@ class UserHeader extends StatelessWidget { ), Expanded( child: Column( - mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RichText(text: TextSpan( @@ -569,7 +568,6 @@ class BottomBar extends StatelessWidget { border: Border( top: BorderSide( color: Theme.of(context).dividerColor, - width: 1.0, ), ), ), diff --git a/dev/benchmarks/complex_layout/test_memory/scroll_perf.dart b/dev/benchmarks/complex_layout/test_memory/scroll_perf.dart index 47dff1ac12..addd1eff19 100644 --- a/dev/benchmarks/complex_layout/test_memory/scroll_perf.dart +++ b/dev/benchmarks/complex_layout/test_memory/scroll_perf.dart @@ -28,7 +28,6 @@ Future main() async { }, behavior: HitTestBehavior.opaque, child: const IgnorePointer( - ignoring: true, child: ComplexLayoutApp(), ), )); diff --git a/dev/benchmarks/macrobenchmarks/lib/src/color_filter_and_fade.dart b/dev/benchmarks/macrobenchmarks/lib/src/color_filter_and_fade.dart index 783ce964e6..eb7d854e3b 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/color_filter_and_fade.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/color_filter_and_fade.dart @@ -147,7 +147,6 @@ class _ShadowWidget extends StatelessWidget { ), size: Size(width, height), isComplex: true, - willChange: false, ), ); } diff --git a/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart b/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart index 97bcbf7e09..7d84f85c63 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart @@ -73,7 +73,6 @@ class _FilteredChildAnimationPageState extends State color: Colors.green, boxShadow: complex ? [ const BoxShadow( - color: Colors.black, blurRadius: 10.0, ), ] : null, diff --git a/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart b/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart index 05ed764157..fa242d943b 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart @@ -32,7 +32,6 @@ class _MultiWidgetConstructTableState extends State _controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 10000), - lowerBound: 0, upperBound: colorList.length + 1.0, )..repeat(); } diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_pageview_scroll_linethrough.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_pageview_scroll_linethrough.dart index 92dd2ffc2f..d517a8ab4b 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_pageview_scroll_linethrough.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_pageview_scroll_linethrough.dart @@ -113,7 +113,7 @@ class _CustomPainter extends CustomPainter { _textPainter.text = span; - _textPainter.layout(minWidth: 0, maxWidth: width); + _textPainter.layout(maxWidth: width); _linePainter.style = PaintingStyle.fill; canvas.drawRect( Rect.fromLTWH(xPosition, yPosition - viewPadding, width, height), diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart index ee55513849..e1a7c0ba8a 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_paths_recording.dart @@ -1833,7 +1833,7 @@ void pathOps78() { void pathOps79() { final Path path79 = Path(); - path79.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 64, 56), topLeft: Radius.zero, topRight: Radius.zero, bottomLeft: const Radius.circular(10), bottomRight: Radius.zero, )); + path79.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 64, 56), bottomLeft: const Radius.circular(10), )); gFillType = path79.fillType; path80 = path79.shift(const Offset(906, 136)); gFillType = path79.fillType; @@ -5828,7 +5828,7 @@ void pathOps576() { path576.moveTo(0, 0); path576.lineTo(220.60000000000002, 0); path576.quadraticBezierTo(235.60000000000002, 0, 237.569696969697, 7.817946907441011); - path576.arcToPoint(const Offset(299.630303030303, 7.817946907441011), radius: const Radius.circular(32), rotation: 0, largeArc: false, clockwise: false); + path576.arcToPoint(const Offset(299.630303030303, 7.817946907441011), radius: const Radius.circular(32), clockwise: false); path576.quadraticBezierTo(301.6, 0, 316.6, 0); path576.lineTo(312.6, 0); path576.lineTo(312.6, 48); diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart index 3dfcd4695e..6ea32b1e76 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart @@ -25,7 +25,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder { child: Row( children: const [ Flexible( - flex: 1, child: _TestScrollingWidget( initialScrollOffset: 0, scrollDistance: 300, @@ -33,7 +32,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder { ), ), Flexible( - flex: 1, child: _TestScrollingWidget( initialScrollOffset: 1000, scrollDistance: 500, @@ -41,7 +39,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder { ), ), Flexible( - flex: 1, child: _TestScrollingWidget( initialScrollOffset: 2000, scrollDistance: 700, diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart index d52d111deb..a233f26b1a 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_text_layout.dart @@ -417,7 +417,6 @@ class ColorItem extends StatelessWidget { bottom: false, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Text('$_counter:$prefix$index'), Text(colorString()), diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_wrapbox_scroll.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_wrapbox_scroll.dart index 785f5fa251..1b3e3ef12e 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_wrapbox_scroll.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_wrapbox_scroll.dart @@ -155,7 +155,6 @@ class ProductOption extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 11, vertical: 5), decoration: BoxDecoration( border: Border.all( - width: 1, color: const Color(0xffebebeb), ), borderRadius: const BorderRadius.all(Radius.circular(15)), diff --git a/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart b/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart index 72778b22a3..f05fe958bc 100644 --- a/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart +++ b/dev/benchmarks/macrobenchmarks/lib/web_benchmarks.dart @@ -31,7 +31,7 @@ import 'src/web/recorder.dart'; typedef RecorderFactory = Recorder Function(); -const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false); +const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA'); /// List of all benchmarks that run in the devicelab. /// diff --git a/dev/benchmarks/macrobenchmarks/test/frame_policy.dart b/dev/benchmarks/macrobenchmarks/test/frame_policy.dart index 7e13444b54..8256ca4f63 100644 --- a/dev/benchmarks/macrobenchmarks/test/frame_policy.dart +++ b/dev/benchmarks/macrobenchmarks/test/frame_policy.dart @@ -31,11 +31,9 @@ void main() { final List records = [ PointerEventRecord(Duration.zero, [ PointerAddedEvent( - timeStamp: Duration.zero, position: location, ), PointerDownEvent( - timeStamp: Duration.zero, position: location, pointer: 1, ), diff --git a/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart b/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart index 0ab7a400d1..a40000b40b 100644 --- a/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart +++ b/dev/benchmarks/microbenchmarks/lib/foundation/change_notifier_bench.dart @@ -167,16 +167,16 @@ void main() { } runAddListenerBenchmark(_kNumWarmUp, addResult: false); - runAddListenerBenchmark(_kNumIterations, addResult: true); + runAddListenerBenchmark(_kNumIterations); runNotifyListenerBenchmark(_kNumWarmUp, addResult: false); - runNotifyListenerBenchmark(_kNumIterations, addResult: true); + runNotifyListenerBenchmark(_kNumIterations); runRemoveListenerBenchmark(_kNumWarmUp, addResult: false); - runRemoveListenerBenchmark(_kNumIterations, addResult: true); + runRemoveListenerBenchmark(_kNumIterations); runRemoveListenerWhileNotifyingBenchmark(_kNumWarmUp, addResult: false); - runRemoveListenerWhileNotifyingBenchmark(_kNumIterations, addResult: true); + runRemoveListenerWhileNotifyingBenchmark(_kNumIterations); printer.printToStdout(); } diff --git a/dev/benchmarks/microbenchmarks/lib/geometry/curves_bench.dart b/dev/benchmarks/microbenchmarks/lib/geometry/curves_bench.dart index b373d21bd5..a971209f17 100644 --- a/dev/benchmarks/microbenchmarks/lib/geometry/curves_bench.dart +++ b/dev/benchmarks/microbenchmarks/lib/geometry/curves_bench.dart @@ -48,7 +48,7 @@ void main() { Offset(0.70, 0.04), Offset(0.78, 0.98), Offset(0.88, -0.00), - ], tension: 0.00); + ]); _testCurve( catmullRomCurve, name: 'catmullrom_transform_iteration', diff --git a/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart b/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart index db4472f18d..c44fe3049d 100644 --- a/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart +++ b/dev/benchmarks/microbenchmarks/lib/language/sync_star_semantics_bench.dart @@ -19,7 +19,7 @@ void main() { for (int i = 0; i < words.length; i++) { if (i.isEven) { data.add( - InlineSpanSemanticsInformation(words[i], isPlaceholder: false), + InlineSpanSemanticsInformation(words[i]), ); } else if (i.isEven) { data.add( diff --git a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/android_platform_view.dart b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/android_platform_view.dart index 35d8397253..98f35ec078 100644 --- a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/android_platform_view.dart +++ b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/android_platform_view.dart @@ -38,7 +38,6 @@ class AndroidPlatformView extends StatelessWidget { id: params.id, viewType: viewType, layoutDirection: TextDirection.ltr, - creationParams: null, creationParamsCodec: const StandardMessageCodec(), ) ..addOnPlatformViewCreatedListener(params.onPlatformViewCreated) diff --git a/dev/bots/analyze_sample_code.dart b/dev/bots/analyze_sample_code.dart index 2e750d30a1..3fcd63bbe4 100644 --- a/dev/bots/analyze_sample_code.dart +++ b/dev/bots/analyze_sample_code.dart @@ -30,14 +30,12 @@ Future main(List arguments) async { final ArgParser argParser = ArgParser(); argParser.addOption( 'temp', - defaultsTo: null, help: 'A location where temporary files may be written. Defaults to a ' 'directory in the system temp folder. If specified, will not be ' 'automatically removed at the end of execution.', ); argParser.addFlag( 'verbose', - defaultsTo: false, negatable: false, help: 'Print verbose output for the analysis process.', ); @@ -52,12 +50,10 @@ Future main(List arguments) async { argParser.addFlag( 'include-dart-ui', defaultsTo: true, - negatable: true, help: 'Includes the dart:ui code supplied by the engine in the analysis.', ); argParser.addFlag( 'help', - defaultsTo: false, negatable: false, help: 'Print help for this command.', ); @@ -69,7 +65,6 @@ Future main(List arguments) async { argParser.addFlag( 'global-activate-snippets', defaultsTo: true, - negatable: true, help: 'Whether or not to "pub global activate" the snippets package. If set, will ' 'activate version $_snippetsActivateVersion', ); @@ -476,7 +471,6 @@ class SampleChecker { if (!Platform.environment.containsKey('FLUTTER_ROOT')) 'FLUTTER_ROOT': _flutterRoot, if (_flutterVersion!.isNotEmpty) 'FLUTTER_VERSION': _flutterVersion!, }, - includeParentEnvironment: true, ); } @@ -1155,7 +1149,7 @@ class Sample { final StringBuffer buf = StringBuffer('sample ${args.join(' ')}\n'); int count = start.line; for (final String line in input) { - buf.writeln(' ${count.toString().padLeft(4, ' ')}: $line'); + buf.writeln(' ${count.toString().padLeft(4)}: $line'); count++; } return buf.toString(); diff --git a/dev/bots/browser.dart b/dev/bots/browser.dart index e0303dbe13..b650d8153c 100644 --- a/dev/bots/browser.dart +++ b/dev/bots/browser.dart @@ -94,8 +94,6 @@ class AppServer { debugPort: browserDebugPort, url: appUrl, userDataDirectory: userDataDirectory.path, - windowHeight: 1024, - windowWidth: 1024, ), onError: chromeErrorCompleter.complete); return AppServer._(server, chrome, chromeErrorCompleter.future); } diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart index df57ea66ff..433b7be48e 100644 --- a/dev/bots/prepare_package.dart +++ b/dev/bots/prepare_package.dart @@ -687,7 +687,6 @@ class ArchivePublisher { try { await _runGsUtil( ['stat', cloudPath], - failOk: false, ); } on PreparePackageException { // `gsutil stat gs://path/to/file` will exit with 1 if file does not exist @@ -737,7 +736,6 @@ Future main(List rawArguments) async { final ArgParser argParser = ArgParser(); argParser.addOption( 'temp_dir', - defaultsTo: null, help: 'A location where temporary files may be written. Defaults to a ' 'directory in the system temp folder. Will write a few GiB of data, ' 'so it should have sufficient free space. If a temp_dir is not ' @@ -745,18 +743,15 @@ Future main(List rawArguments) async { 'removed automatically.', ); argParser.addOption('revision', - defaultsTo: null, help: 'The Flutter git repo revision to build the ' 'archive with. Must be the full 40-character hash. Required.'); argParser.addOption( 'branch', - defaultsTo: null, allowed: Branch.values.map((Branch branch) => getBranchName(branch)), help: 'The Flutter branch to build the archive with. Required.', ); argParser.addOption( 'output', - defaultsTo: null, help: 'The path to the directory where the output archive should be ' 'written. If --output is not specified, the archive will be written to ' "the current directory. If the output directory doesn't exist, it, and " @@ -764,7 +759,6 @@ Future main(List rawArguments) async { ); argParser.addFlag( 'publish', - defaultsTo: false, help: 'If set, will publish the archive to Google Cloud Storage upon ' 'successful creation of the archive. Will publish under this ' 'directory: $baseUrl$releaseFolder', @@ -772,18 +766,15 @@ Future main(List rawArguments) async { argParser.addFlag( 'force', abbr: 'f', - defaultsTo: false, help: 'Overwrite a previously uploaded package.', ); argParser.addFlag( 'dry_run', - defaultsTo: false, negatable: false, help: 'Prints gsutil commands instead of executing them.', ); argParser.addFlag( 'help', - defaultsTo: false, negatable: false, help: 'Print help for this command.', ); diff --git a/dev/bots/test.dart b/dev/bots/test.dart index a76a0f20fe..61a431a796 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -645,7 +645,7 @@ Future _runFrameworkTests() async { Future runLibraries() async { final List tests = Directory(path.join(flutterRoot, 'packages', 'flutter', 'test')) - .listSync(followLinks: false, recursive: false) + .listSync(followLinks: false) .whereType() .where((Directory dir) => dir.path.endsWith('widgets') == false) .map((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator) @@ -1215,7 +1215,7 @@ Future _ensureChromeDriverIsRunning() async { final Uri chromeDriverUrl = Uri.parse('http://localhost:4444/status'); final HttpClientRequest request = await client.getUrl(chromeDriverUrl); final HttpClientResponse response = await request.close(); - final Map webDriverStatus = json.decode(await response.transform(utf8.decoder).join('')) as Map; + final Map webDriverStatus = json.decode(await response.transform(utf8.decoder).join()) as Map; client.close(); final bool webDriverReady = (webDriverStatus['value'] as Map)['ready'] as bool; if (!webDriverReady) { diff --git a/dev/bots/test/analyze_test.dart b/dev/bots/test/analyze_test.dart index 54dcc22b66..04e6a4b61e 100644 --- a/dev/bots/test/analyze_test.dart +++ b/dev/bots/test/analyze_test.dart @@ -193,6 +193,6 @@ void main() { const Hash256(0xA8100AE6AA1940D0, 0xB663BB31CD466142, 0xEBBDBD5187131B92, 0xD93818987832EB89), // sha256("\xff") const Hash256(0x155644D3F13D98BF, 0, 0, 0), }, - ), exitCode: 0); + )); }); } diff --git a/dev/bots/test/prepare_package_test.dart b/dev/bots/test/prepare_package_test.dart index a6f9f552c4..d1f89aed93 100644 --- a/dev/bots/test/prepare_package_test.dart +++ b/dev/bots/test/prepare_package_test.dart @@ -266,7 +266,6 @@ void main() { tempDir, testRef, Branch.dev, - strict: true, processManager: processManager, subprocessOutput: false, platform: platform, @@ -495,7 +494,7 @@ void main() { '$gsutilCall -- stat $gsArchivePath': [ProcessResult(0, 0, '', '')], }; processManager.addCommands(convertResults(calls)); - expect(() async => publisher.publishArchive(false), throwsException); + expect(() async => publisher.publishArchive(), throwsException); }); test('publishArchive does not throw if forceUpload is true and artifact already exists on cloud storage', () async { diff --git a/dev/bots/unpublish_package.dart b/dev/bots/unpublish_package.dart index 3e8e2bb42b..831b895e96 100644 --- a/dev/bots/unpublish_package.dart +++ b/dev/bots/unpublish_package.dart @@ -401,7 +401,6 @@ Future main(List rawArguments) async { final ArgParser argParser = ArgParser(); argParser.addOption( 'temp_dir', - defaultsTo: null, help: 'A location where temporary files may be written. Defaults to a ' 'directory in the system temp folder. If a temp_dir is not ' 'specified, then by default a generated temporary directory will be ' @@ -431,7 +430,6 @@ Future main(List rawArguments) async { ); argParser.addFlag( 'confirm', - defaultsTo: false, help: 'If set, will actually remove the archive from Google Cloud Storage ' 'upon successful execution of this script. Published archives will be ' 'removed from this directory: $baseUrl$releaseFolder. This option ' @@ -440,7 +438,6 @@ Future main(List rawArguments) async { ); argParser.addFlag( 'help', - defaultsTo: false, negatable: false, help: 'Print help for this command.', ); diff --git a/dev/conductor/core/lib/src/repository.dart b/dev/conductor/core/lib/src/repository.dart index 2087dc366d..e1f9e08723 100644 --- a/dev/conductor/core/lib/src/repository.dart +++ b/dev/conductor/core/lib/src/repository.dart @@ -496,7 +496,6 @@ class FrameworkRepository extends Repository { name: RemoteName.upstream, url: 'file://$upstreamPath/', ), - localUpstream: false, previousCheckoutLocation: previousCheckoutLocation, ); } diff --git a/dev/conductor/core/lib/src/roll_dev.dart b/dev/conductor/core/lib/src/roll_dev.dart index 3598f93e85..41ae61ac89 100644 --- a/dev/conductor/core/lib/src/roll_dev.dart +++ b/dev/conductor/core/lib/src/roll_dev.dart @@ -43,7 +43,6 @@ class RollDevCommand extends Command { kCandidateBranch, help: 'Specifies which git branch to roll to the dev branch. Required.', valueHelp: 'branch', - defaultsTo: null, // This option is required ); argParser.addFlag( kForce, diff --git a/dev/conductor/core/lib/src/state.dart b/dev/conductor/core/lib/src/state.dart index 28681d5bf1..c76a19e967 100644 --- a/dev/conductor/core/lib/src/state.dart +++ b/dev/conductor/core/lib/src/state.dart @@ -42,10 +42,10 @@ String presentState(pb.ConductorState state) { buffer.writeln('Conductor version: ${state.conductorVersion}'); buffer.writeln('Release channel: ${state.releaseChannel}'); buffer.writeln('Release version: ${state.releaseVersion}'); - buffer.writeln(''); + buffer.writeln(); buffer.writeln('Release started at: ${DateTime.fromMillisecondsSinceEpoch(state.createdDate.toInt())}'); buffer.writeln('Last updated at: ${DateTime.fromMillisecondsSinceEpoch(state.lastUpdatedDate.toInt())}'); - buffer.writeln(''); + buffer.writeln(); buffer.writeln('Engine Repo'); buffer.writeln('\tCandidate branch: ${state.engine.candidateBranch}'); buffer.writeln('\tStarting git HEAD: ${state.engine.startingGitHead}'); @@ -77,7 +77,7 @@ String presentState(pb.ConductorState state) { } else { buffer.writeln('0 Framework cherrypicks.'); } - buffer.writeln(''); + buffer.writeln(); if (state.currentPhase == ReleasePhase.VERIFY_RELEASE) { buffer.writeln( '${state.releaseChannel} release ${state.releaseVersion} has been published and verified.\n', @@ -88,7 +88,7 @@ String presentState(pb.ConductorState state) { buffer.writeln(presentPhases(state.currentPhase)); buffer.writeln(phaseInstructions(state)); - buffer.writeln(''); + buffer.writeln(); buffer.writeln('Issue `conductor next` when you are ready to proceed.'); return buffer.toString(); } diff --git a/dev/conductor/core/lib/src/status.dart b/dev/conductor/core/lib/src/status.dart index 9c5ad0a9ee..b3c6ab90af 100644 --- a/dev/conductor/core/lib/src/status.dart +++ b/dev/conductor/core/lib/src/status.dart @@ -30,7 +30,6 @@ class StatusCommand extends Command { argParser.addFlag( kVerboseFlag, abbr: 'v', - defaultsTo: false, help: 'Also print logs.', ); } diff --git a/dev/conductor/core/test/repository_test.dart b/dev/conductor/core/test/repository_test.dart index ce8a53660b..32a7429a67 100644 --- a/dev/conductor/core/test/repository_test.dart +++ b/dev/conductor/core/test/repository_test.dart @@ -56,7 +56,7 @@ void main() { 'cherry-pick', '--no-commit', commit, - ], exitCode: 0), + ]), const FakeCommand(command: [ 'git', 'reset', diff --git a/dev/conductor/core/test/roll_dev_test.dart b/dev/conductor/core/test/roll_dev_test.dart index 0d9d1cd57e..cc2b18640e 100644 --- a/dev/conductor/core/test/roll_dev_test.dart +++ b/dev/conductor/core/test/roll_dev_test.dart @@ -174,7 +174,7 @@ void main() { ), false, ); - expect(stdio.logs.join('').contains(nextVersion), true); + expect(stdio.logs.join().contains(nextVersion), true); }); test("exits with exception if --skip-tagging is provided but commit isn't already tagged", () { diff --git a/dev/conductor/ui/lib/main.dart b/dev/conductor/ui/lib/main.dart index bc7ac695bd..0b36a22021 100644 --- a/dev/conductor/ui/lib/main.dart +++ b/dev/conductor/ui/lib/main.dart @@ -53,7 +53,6 @@ class MyApp extends StatelessWidget { padding: const EdgeInsets.all(20.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, children: [ const SelectableText( 'Desktop app for managing a release of the Flutter SDK, currently in development', diff --git a/dev/conductor/ui/lib/widgets/progression.dart b/dev/conductor/ui/lib/widgets/progression.dart index 0bb97e917d..d6cc87bd69 100644 --- a/dev/conductor/ui/lib/widgets/progression.dart +++ b/dev/conductor/ui/lib/widgets/progression.dart @@ -75,12 +75,7 @@ class MainProgressionState extends State { stateFilePath: widget.stateFilePath, ), Stepper( - controlsBuilder: (BuildContext context, ControlsDetails details) { - return Row( - children: const [], - ); - }, - type: StepperType.vertical, + controlsBuilder: (BuildContext context, ControlsDetails details) => Row(), physics: const ScrollPhysics(), currentStep: _completedStep, onStepContinue: nextStep, @@ -127,9 +122,7 @@ class MainProgressionState extends State { ), Step( title: Text(MainProgression._stepTitles[4]), - content: Column( - children: const [], - ), + content: Column(), isActive: true, state: handleStepState(4), ), diff --git a/dev/conductor/ui/test/widgets/stepper_test.dart b/dev/conductor/ui/test/widgets/stepper_test.dart index daa1638045..60d8d13229 100644 --- a/dev/conductor/ui/test/widgets/stepper_test.dart +++ b/dev/conductor/ui/test/widgets/stepper_test.dart @@ -18,7 +18,6 @@ void main() { child: Column( children: const [ MainProgression( - releaseState: null, stateFilePath: './testPath', ), ], @@ -62,7 +61,6 @@ void main() { child: Column( children: const [ MainProgression( - releaseState: null, stateFilePath: './testPath', ), ], diff --git a/dev/customer_testing/run_tests.dart b/dev/customer_testing/run_tests.dart index c792722a8b..a0c90bf7df 100644 --- a/dev/customer_testing/run_tests.dart +++ b/dev/customer_testing/run_tests.dart @@ -41,22 +41,18 @@ Future run(List arguments) async { ) ..addFlag( 'skip-on-fetch-failure', - defaultsTo: false, help: 'Whether to skip tests that we fail to download.', ) ..addFlag( 'skip-template', - defaultsTo: false, help: 'Whether to skip tests named "template.test".', ) ..addFlag( 'verbose', - defaultsTo: false, help: 'Describe what is happening in detail.', ) ..addFlag( 'help', - defaultsTo: false, negatable: false, help: 'Print this help message.', ); diff --git a/dev/devicelab/bin/run.dart b/dev/devicelab/bin/run.dart index 2967b66f6a..515b3a185a 100644 --- a/dev/devicelab/bin/run.dart +++ b/dev/devicelab/bin/run.dart @@ -239,7 +239,6 @@ final ArgParser _argParser = ArgParser() ..addMultiOption( 'task', abbr: 't', - splitCommas: true, help: 'Either:\n' ' - the name of a task defined in manifest.yaml.\n' ' Example: complex_layout__start_up.\n' @@ -362,13 +361,10 @@ final ArgParser _argParser = ArgParser() ) ..addFlag( 'silent', - negatable: true, - defaultsTo: false, ) ..addMultiOption( 'test', hide: true, - splitCommas: true, callback: (List value) { if (value.isNotEmpty) { throw const FormatException( diff --git a/dev/devicelab/bin/tasks/animated_image_gc_perf.dart b/dev/devicelab/bin/tasks/animated_image_gc_perf.dart index b5fe9f8e0c..bb80e522fb 100644 --- a/dev/devicelab/bin/tasks/animated_image_gc_perf.dart +++ b/dev/devicelab/bin/tasks/animated_image_gc_perf.dart @@ -13,7 +13,5 @@ Future main() async { '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', 'test_driver/animated_image.dart', 'animated_image', - measureCpuGpu: true, - measureMemory: true, ).run); } diff --git a/dev/devicelab/bin/tasks/complex_layout_scroll_perf_ios__timeline_summary.dart b/dev/devicelab/bin/tasks/complex_layout_scroll_perf_ios__timeline_summary.dart index b514d35741..0deb613e26 100644 --- a/dev/devicelab/bin/tasks/complex_layout_scroll_perf_ios__timeline_summary.dart +++ b/dev/devicelab/bin/tasks/complex_layout_scroll_perf_ios__timeline_summary.dart @@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart'; Future main() async { deviceOperatingSystem = DeviceOperatingSystem.ios; - await task(createComplexLayoutScrollPerfTest(measureCpuGpu: true)); + await task(createComplexLayoutScrollPerfTest()); } diff --git a/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart b/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart index 11b21b390e..a410eb2c47 100644 --- a/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart +++ b/dev/devicelab/bin/tasks/ios_app_with_extensions_test.dart @@ -115,7 +115,6 @@ Future main() async { 'list', 'runtimes', ], - canFail: false, workingDirectory: flutterDirectory.path, ); @@ -166,7 +165,6 @@ Future main() async { 'com.apple.CoreSimulator.SimDeviceType.iPhone-11', iOSSimRuntime, ], - canFail: false, workingDirectory: flutterDirectory.path, ); @@ -180,7 +178,6 @@ Future main() async { 'com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm', watchSimRuntime, ], - canFail: false, workingDirectory: flutterDirectory.path, ); @@ -188,7 +185,6 @@ Future main() async { await eval( 'xcrun', ['simctl', 'pair', watchDeviceID, phoneDeviceID], - canFail: false, workingDirectory: flutterDirectory.path, ); @@ -196,13 +192,11 @@ Future main() async { await eval( 'xcrun', ['simctl', 'bootstatus', phoneDeviceID, '-b'], - canFail: false, workingDirectory: flutterDirectory.path, ); await eval( 'xcrun', ['simctl', 'bootstatus', watchDeviceID, '-b'], - canFail: false, workingDirectory: flutterDirectory.path, ); diff --git a/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart b/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart index ae17c3266f..5af76d438d 100644 --- a/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart +++ b/dev/devicelab/bin/tasks/large_image_changer_perf_ios.dart @@ -13,8 +13,6 @@ Future main() async { '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', 'test_driver/large_image_changer.dart', 'large_image_changer', - measureCpuGpu: true, - measureMemory: true, // This benchmark doesn't care about frame times, frame times will be heavily // impacted by IO time for loading the image initially. benchmarkScoreKeys: [ diff --git a/dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart b/dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart index 066a033acf..7baf142bc6 100644 --- a/dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart +++ b/dev/devicelab/bin/tasks/post_backdrop_filter_perf_ios__timeline_summary.dart @@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart'; Future main() async { deviceOperatingSystem = DeviceOperatingSystem.ios; - await task(createPostBackdropFilterPerfTest(measureCpuGpu: true)); + await task(createPostBackdropFilterPerfTest()); } diff --git a/dev/devicelab/bin/tasks/routing_test.dart b/dev/devicelab/bin/tasks/routing_test.dart index cdd956f45e..d694117566 100644 --- a/dev/devicelab/bin/tasks/routing_test.dart +++ b/dev/devicelab/bin/tasks/routing_test.dart @@ -32,7 +32,6 @@ void main() { '/smuggle-it', 'lib/route.dart', ], - canFail: false, ); }); section('TEST WHETHER `flutter run --route` WORKS'); diff --git a/dev/devicelab/bin/tasks/simple_animation_perf_ios.dart b/dev/devicelab/bin/tasks/simple_animation_perf_ios.dart index 56d8431d79..4f94ecd791 100644 --- a/dev/devicelab/bin/tasks/simple_animation_perf_ios.dart +++ b/dev/devicelab/bin/tasks/simple_animation_perf_ios.dart @@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart'; Future main() async { deviceOperatingSystem = DeviceOperatingSystem.ios; - await task(createSimpleAnimationPerfTest(measureCpuGpu: true)); + await task(createSimpleAnimationPerfTest()); } diff --git a/dev/devicelab/lib/command/test.dart b/dev/devicelab/lib/command/test.dart index 9e35fdde2d..58e8489d04 100644 --- a/dev/devicelab/lib/command/test.dart +++ b/dev/devicelab/lib/command/test.dart @@ -49,8 +49,6 @@ class TestCommand extends Command { 'task, will write test results to the file.'); argParser.addFlag( 'silent', - negatable: true, - defaultsTo: false, ); } diff --git a/dev/devicelab/lib/framework/devices.dart b/dev/devicelab/lib/framework/devices.dart index 071bdcf65c..70ed680917 100644 --- a/dev/devicelab/lib/framework/devices.dart +++ b/dev/devicelab/lib/framework/devices.dart @@ -274,7 +274,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery { @override Future> discoverDevices() async { - final List output = (await eval(adbPath, ['devices', '-l'], canFail: false)) + final List output = (await eval(adbPath, ['devices', '-l'])) .trim().split('\n'); final List results = []; for (final String line in output) { @@ -327,7 +327,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery { // Restarting `adb` helps with keeping device connections alive. When `adb` // runs non-stop for too long it loses connections to devices. There may be // a better method, but so far that's the best one I've found. - await exec(adbPath, ['kill-server'], canFail: false); + await exec(adbPath, ['kill-server']); } } @@ -555,7 +555,6 @@ class AndroidDevice extends Device { adbPath, ['-s', deviceId, ...arguments], environment: environment, - canFail: false, printStdout: !silent, printStderr: !silent, ); diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart index 7983e27bc0..ea2856d65e 100644 --- a/dev/devicelab/lib/framework/utils.dart +++ b/dev/devicelab/lib/framework/utils.dart @@ -224,7 +224,7 @@ Future getDartVersion() async { Future getCurrentFlutterRepoCommit() { if (!dir('${flutterDirectory.path}/.git').existsSync()) { - return Future.value(null); + return Future.value(); } return inDirectory(flutterDirectory, () { diff --git a/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart b/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart index c3ee1a8697..fe6bbf2534 100644 --- a/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart +++ b/dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart @@ -145,7 +145,6 @@ class PluginPlatformInterfaceMacOS { final Process run = await startProcess( path.join(flutterDirectory.path, 'bin', 'flutter'), flutterCommandArgs('run', ['-d', 'macos', '-v']), - environment: null, ); Completer registryExecutedCompleter = Completer(); final StreamSubscription subscription = run.stdout diff --git a/dev/devicelab/lib/tasks/web_benchmarks.dart b/dev/devicelab/lib/tasks/web_benchmarks.dart index cdafeadf42..b402a68c30 100644 --- a/dev/devicelab/lib/tasks/web_benchmarks.dart +++ b/dev/devicelab/lib/tasks/web_benchmarks.dart @@ -133,8 +133,6 @@ Future runWebBenchmark({ required bool useCanvasKit }) async { final ChromeOptions options = ChromeOptions( url: 'http://localhost:$benchmarkServerPort/index.html', userDataDirectory: userDataDir, - windowHeight: 1024, - windowWidth: 1024, headless: isUncalibratedSmokeTest, debugPort: chromeDebugPort, ); diff --git a/dev/devicelab/test/adb_test.dart b/dev/devicelab/test/adb_test.dart index d49bfad184..1f0f8a0bca 100644 --- a/dev/devicelab/test/adb_test.dart +++ b/dev/devicelab/test/adb_test.dart @@ -27,8 +27,8 @@ void main() { final AndroidDevice androidDevice = device as AndroidDevice; expect(await androidDevice.isArm64(), isTrue); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), - cmd(command: 'getprop', arguments: ['ro.product.cpu.abi'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), + cmd(command: 'getprop', arguments: ['ro.product.cpu.abi']), ]); }); }); @@ -51,7 +51,7 @@ void main() { test('sends power event', () async { await device.togglePower(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'input', arguments: ['keyevent', '26']), ]); }); @@ -62,7 +62,7 @@ void main() { FakeDevice.pretendAwake(); await device.wakeUp(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'dumpsys', arguments: ['power']), ]); }); @@ -71,7 +71,7 @@ void main() { FakeDevice.pretendAsleep(); await device.wakeUp(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'dumpsys', arguments: ['power']), cmd(command: 'input', arguments: ['keyevent', '26']), ]); @@ -83,7 +83,7 @@ void main() { FakeDevice.pretendAsleep(); await device.sendToSleep(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'dumpsys', arguments: ['power']), ]); }); @@ -92,7 +92,7 @@ void main() { FakeDevice.pretendAwake(); await device.sendToSleep(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'dumpsys', arguments: ['power']), cmd(command: 'input', arguments: ['keyevent', '26']), ]); @@ -104,7 +104,7 @@ void main() { FakeDevice.pretendAwake(); await device.unlock(); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'dumpsys', arguments: ['power']), cmd(command: 'input', arguments: ['keyevent', '82']), ]); @@ -115,7 +115,7 @@ void main() { test('tap', () async { await device.tap(100, 200); expectLog([ - cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null), + cmd(command: 'getprop', arguments: ['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']), cmd(command: 'input', arguments: ['tap', '100', '200']), ]); }); diff --git a/dev/devicelab/test/running_processes_test.dart b/dev/devicelab/test/running_processes_test.dart index ec27b8e742..76f3df029e 100644 --- a/dev/devicelab/test/running_processes_test.dart +++ b/dev/devicelab/test/running_processes_test.dart @@ -61,7 +61,7 @@ Sat Mar 9 20:13:00 2019 49 /usr/sbin/syslogd ), RunningProcessInfo( '49', - DateTime(2019, 3, 9, 20, 13, 00), + DateTime(2019, 3, 9, 20, 13), '/usr/sbin/syslogd', ), ])); diff --git a/dev/integration_tests/android_semantics_testing/lib/src/tests/text_field_page.dart b/dev/integration_tests/android_semantics_testing/lib/src/tests/text_field_page.dart index 71c061f377..20a22449aa 100644 --- a/dev/integration_tests/android_semantics_testing/lib/src/tests/text_field_page.dart +++ b/dev/integration_tests/android_semantics_testing/lib/src/tests/text_field_page.dart @@ -32,14 +32,12 @@ class _TextFieldPageState extends State { TextField( key: normalTextFieldKey, controller: _normalController, - autofocus: false, ), const Spacer(), TextField( key: passwordTextFieldKey, controller: _passwordController, obscureText: true, - autofocus: false, ), ], ), diff --git a/dev/integration_tests/android_views/lib/motion_events_page.dart b/dev/integration_tests/android_views/lib/motion_events_page.dart index 374877739a..e4753e57e8 100644 --- a/dev/integration_tests/android_views/lib/motion_events_page.dart +++ b/dev/integration_tests/android_views/lib/motion_events_page.dart @@ -227,7 +227,7 @@ class MotionEventsBodyState extends State { setState(() {}); break; } - return Future.value(null); + return Future.value(); } Future onViewMethodChannelCall(MethodCall call) { @@ -240,7 +240,7 @@ class MotionEventsBodyState extends State { setState(() {}); break; } - return Future.value(null); + return Future.value(); } Widget buildEventTile(BuildContext context, int index) { diff --git a/dev/integration_tests/channels/lib/src/method_calls.dart b/dev/integration_tests/channels/lib/src/method_calls.dart index 3a412ae8dd..a7fac958a7 100644 --- a/dev/integration_tests/channels/lib/src/method_calls.dart +++ b/dev/integration_tests/channels/lib/src/method_calls.dart @@ -10,8 +10,7 @@ import 'test_step.dart'; Future methodCallJsonSuccessHandshake(dynamic payload) async { const MethodChannel channel = MethodChannel('json-method', JSONMethodCodec()); - return _methodCallSuccessHandshake( - 'JSON success($payload)', channel, payload); + return _methodCallSuccessHandshake('JSON success($payload)', channel, payload); } Future methodCallJsonErrorHandshake(dynamic payload) async { @@ -32,8 +31,7 @@ Future methodCallStandardSuccessHandshake( 'std-method', StandardMethodCodec(ExtendedStandardMessageCodec()), ); - return _methodCallSuccessHandshake( - 'Standard success($payload)', channel, payload); + return _methodCallSuccessHandshake('Standard success($payload)', channel, payload); } Future methodCallStandardErrorHandshake(dynamic payload) async { @@ -41,8 +39,7 @@ Future methodCallStandardErrorHandshake(dynamic payload) async { 'std-method', StandardMethodCodec(ExtendedStandardMessageCodec()), ); - return _methodCallErrorHandshake( - 'Standard error($payload)', channel, payload); + return _methodCallErrorHandshake('Standard error($payload)', channel, payload); } Future methodCallStandardNotImplementedHandshake() async { @@ -50,8 +47,7 @@ Future methodCallStandardNotImplementedHandshake() async { 'std-method', StandardMethodCodec(ExtendedStandardMessageCodec()), ); - return _methodCallNotImplementedHandshake( - 'Standard notImplemented()', channel); + return _methodCallNotImplementedHandshake('Standard notImplemented()', channel); } Future _methodCallSuccessHandshake( @@ -89,8 +85,7 @@ Future _methodCallErrorHandshake( final List received = []; channel.setMethodCallHandler((MethodCall call) async { received.add(call.arguments); - throw PlatformException( - code: 'error', message: null, details: arguments); + throw PlatformException(code: 'error', details: arguments); }); dynamic errorDetails = nothing; dynamic error = nothing; diff --git a/dev/integration_tests/flutter_gallery/lib/demo/animation/widgets.dart b/dev/integration_tests/flutter_gallery/lib/demo/animation/widgets.dart index 13f65ff2b0..2c0ad69db8 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/animation/widgets.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/animation/widgets.dart @@ -23,8 +23,6 @@ class SectionCard extends StatelessWidget { child: DecoratedBox( decoration: BoxDecoration( gradient: LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, colors: [ section.leftColor!, section.rightColor!, @@ -132,7 +130,6 @@ class SectionDetailView extends StatelessWidget { package: detail.imageAssetPackage, ), fit: BoxFit.cover, - alignment: Alignment.center, ), ), ); diff --git a/dev/integration_tests/flutter_gallery/lib/demo/calculator/logic.dart b/dev/integration_tests/flutter_gallery/lib/demo/calculator/logic.dart index e92a765d1c..407eec101d 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/calculator/logic.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/calculator/logic.dart @@ -136,7 +136,7 @@ class CalcExpression { /// in the calculator's display panel. @override String toString() { - final StringBuffer buffer = StringBuffer(''); + final StringBuffer buffer = StringBuffer(); buffer.writeAll(_list); return buffer.toString(); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/colors_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/colors_demo.dart index 04ad7dc1e3..f3fb6c3e62 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/colors_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/colors_demo.dart @@ -67,7 +67,6 @@ class ColorItem extends StatelessWidget { bottom: false, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Text('$prefix$index'), Text(colorString()), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart index e98b1b89af..14559903a9 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart @@ -327,7 +327,6 @@ class Tab1ItemPageState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Row( - mainAxisSize: MainAxisSize.max, children: [ Container( height: 128.0, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart index fdec6b3e4b..8843f39691 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_picker_demo.dart @@ -247,7 +247,6 @@ class _CupertinoPickerDemoState extends State { return _BottomPicker( child: CupertinoDatePicker( backgroundColor: CupertinoColors.systemBackground.resolveFrom(context), - mode: CupertinoDatePickerMode.dateAndTime, initialDateTime: dateTime, onDateTimeChanged: (DateTime newDateTime) { setState(() => dateTime = newDateTime); diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_segmented_control_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_segmented_control_demo.dart index 7abe52675f..351e3b2ad5 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_segmented_control_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_segmented_control_demo.dart @@ -117,13 +117,11 @@ class _CupertinoSegmentedControlDemoState extends State { children: [ CupertinoSlider( value: _value, - min: 0.0, max: 100.0, onChanged: (double value) { setState(() { @@ -58,7 +57,6 @@ class _CupertinoSliderDemoState extends State { children: [ CupertinoSlider( value: _discreteValue, - min: 0.0, max: 100.0, divisions: 5, onChanged: (double value) { diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart index 8710aa0a4a..e299f692a8 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart @@ -27,7 +27,6 @@ class _BottomAppBarDemoState extends State { static const _ChoiceValue kNoFab = _ChoiceValue( title: 'None', label: 'do not show a floating action button', - value: null, ); static const _ChoiceValue kCircularFab = _ChoiceValue( diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart index d19527e9ad..8cd0bcc711 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart @@ -275,7 +275,6 @@ class _ButtonsDemoState extends State { return Padding( padding: const EdgeInsets.all(24.0), child: Column( - mainAxisAlignment: MainAxisAlignment.start, children: [ ListTile( title: const Text('Simple dropdown:'), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart index 5b1723907a..d897f79a8b 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart @@ -344,7 +344,7 @@ class _ChipDemoState extends State { data: _showShapeBorder ? theme.chipTheme.copyWith( shape: BeveledRectangleBorder( - side: const BorderSide(width: 0.66, style: BorderStyle.solid, color: Colors.grey), + side: const BorderSide(width: 0.66, color: Colors.grey), borderRadius: BorderRadius.circular(10.0), )) : theme.chipTheme, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/dialog_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/dialog_demo.dart index b2102adc0b..ecd88b9bb4 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/dialog_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/dialog_demo.dart @@ -33,8 +33,6 @@ class DialogDemoItem extends StatelessWidget { return SimpleDialogOption( onPressed: onPressed, child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Icon(icon, size: 36.0, color: color), Padding( diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/expansion_panels_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/expansion_panels_demo.dart index 289fc85272..fd2592e906 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/expansion_panels_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/expansion_panels_demo.dart @@ -308,7 +308,6 @@ class _ExpansionPanelsDemoState extends State { // Allow room for the value indicator. padding: const EdgeInsets.only(top: 44.0), child: Slider( - min: 0.0, max: 100.0, divisions: 5, activeColor: Colors.orange[100 + (field.value! * 5.0).round()], diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart index eda0cd1d39..30b5477b68 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart @@ -284,7 +284,6 @@ class _SlidersState extends State<_Sliders> { Slider.adaptive( label: _continuousValue.toStringAsFixed(6), value: _continuousValue, - min: 0.0, max: 100.0, onChanged: (double value) { setState(() { @@ -307,7 +306,6 @@ class _SlidersState extends State<_Sliders> { children: [ Slider.adaptive( value: _discreteValue, - min: 0.0, max: 200.0, divisions: 5, label: '${_discreteValue.round()}', @@ -338,7 +336,6 @@ class _SlidersState extends State<_Sliders> { ), child: Slider( value: _discreteCustomValue, - min: 0.0, max: 200.0, divisions: 5, semanticFormatterCallback: (double value) => value.round().toString(), @@ -381,7 +378,6 @@ class _RangeSlidersState extends State<_RangeSliders> { children: [ RangeSlider( values: _continuousValues, - min: 0.0, max: 100.0, onChanged: (RangeValues values) { setState(() { @@ -404,7 +400,6 @@ class _RangeSlidersState extends State<_RangeSliders> { children: [ RangeSlider( values: _discreteValues, - min: 0.0, max: 200.0, divisions: 5, labels: RangeLabels('${_discreteValues.start.round()}', '${_discreteValues.end.round()}'), @@ -433,7 +428,6 @@ class _RangeSlidersState extends State<_RangeSliders> { ), child: RangeSlider( values: _discreteCustomValues, - min: 0.0, max: 200.0, divisions: 5, labels: RangeLabels('${_discreteCustomValues.start.round()}', '${_discreteCustomValues.end.round()}'), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_demo.dart index dd8e59f1cd..3f0df84a74 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_demo.dart @@ -107,7 +107,6 @@ class _CardDataItem extends StatelessWidget { padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.start, children: [ Align( alignment: page!.id == 'H' diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart index 395e81cb5b..3f80761c2d 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart @@ -252,7 +252,6 @@ class TextFormFieldDemoState extends State { suffixText: 'USD', suffixStyle: TextStyle(color: Colors.green), ), - maxLines: 1, ), const SizedBox(height: 24.0), PasswordField( diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart index 0e7d14516e..baf897c356 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart @@ -171,7 +171,7 @@ class ExpandingBottomSheetState extends State with TickerP ).animate( CurvedAnimation( parent: _controller.view, - curve: const Interval(0.434, 1.0, curve: Curves.linear), // not used + curve: const Interval(0.434, 1.0), // not used // only the reverseCurve will be used reverseCurve: Interval(0.434, 1.0, curve: Curves.fastOutSlowIn.flipped), ), @@ -448,7 +448,7 @@ class _ProductThumbnailRowState extends State { ); final Animation opacity = CurvedAnimation( - curve: const Interval(0.33, 1.0, curve: Curves.linear), + curve: const Interval(0.33, 1.0), parent: animation, ); diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/shopping_cart.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/shopping_cart.dart index f5cdf07539..5bce30d033 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/shopping_cart.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/shopping_cart.dart @@ -124,7 +124,6 @@ class ShoppingCartSummary extends StatelessWidget { child: Column( children: [ Row( - crossAxisAlignment: CrossAxisAlignment.center, children: [ const Expanded( child: Text('TOTAL'), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/product_card.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/product_card.dart index 0b1b6b8c89..082d61e73a 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/product_card.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/product_card.dart @@ -45,7 +45,6 @@ class ProductCard extends StatelessWidget { children: [ Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ AspectRatio( aspectRatio: imageAspectRatio, @@ -56,7 +55,6 @@ class ProductCard extends StatelessWidget { width: 121.0, child: Column( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( product == null ? '' : product!.name, diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart b/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart index 260622cf26..0b335bd2c2 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart @@ -253,7 +253,6 @@ class GridLists { // loaded from the web. GridView.count( crossAxisCount: 3, - childAspectRatio: 1.0, padding: const EdgeInsets.all(4.0), mainAxisSpacing: 4.0, crossAxisSpacing: 4.0, diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/home.dart b/dev/integration_tests/flutter_gallery/lib/gallery/home.dart index 2011ce08e6..ffe6b2e9a1 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/home.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/home.dart @@ -58,14 +58,12 @@ class _CategoryItem extends StatelessWidget { // repainted when the button's ink splash animates. return RepaintBoundary( child: RawMaterialButton( - padding: EdgeInsets.zero, hoverColor: theme.primaryColor.withOpacity(0.05), splashColor: theme.primaryColor.withOpacity(0.12), highlightColor: Colors.transparent, onPressed: onTap, child: Column( mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.all(6.0), @@ -184,7 +182,6 @@ class _DemoItem extends StatelessWidget { final bool isDark = theme.brightness == Brightness.dark; final double textScaleFactor = MediaQuery.textScaleFactorOf(context); return RawMaterialButton( - padding: EdgeInsets.zero, splashColor: theme.primaryColor.withOpacity(0.12), highlightColor: Colors.transparent, onPressed: () { diff --git a/dev/integration_tests/flutter_gallery/test/smoke_test.dart b/dev/integration_tests/flutter_gallery/test/smoke_test.dart index 78239ba11d..ee448eabe8 100644 --- a/dev/integration_tests/flutter_gallery/test/smoke_test.dart +++ b/dev/integration_tests/flutter_gallery/test/smoke_test.dart @@ -162,7 +162,7 @@ Future smokeGallery(WidgetTester tester) async { await tester.tap(find.text(category.name)); await tester.pumpAndSettle(); for (final GalleryDemo demo in kGalleryCategoryToDemos[category]!) { - await Scrollable.ensureVisible(tester.element(find.text(demo.title)), alignment: 0.0); + await Scrollable.ensureVisible(tester.element(find.text(demo.title))); await smokeDemo(tester, demo); tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after running $demo'); } diff --git a/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart b/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart index b959ced68f..84eed79d1e 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart @@ -45,7 +45,7 @@ Future runDemos(List demos, WidgetController controller) async { await controller.pumpAndSettle(); // Scroll back to the top await controller.drag(demoList, const Offset(0.0, 10000.0)); - await controller.pumpAndSettle(const Duration(milliseconds: 100)); + await controller.pumpAndSettle(); } currentDemoCategory = demoCategory; diff --git a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart index cb3a81730a..eb9825c2ba 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart @@ -31,7 +31,7 @@ void main([List args = const []]) { await tester.pumpAndSettle(); final int id = tester.getSemantics(find.bySemanticsLabel('Material')).id; expect(id, greaterThan(-1)); - }, skip: !withSemantics, semanticsEnabled: true); + }, skip: !withSemantics); testWidgets( 'all demos', diff --git a/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart b/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart index 67b47692f6..460b3d0ad3 100644 --- a/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart +++ b/dev/integration_tests/flutter_gallery/test_memory/memory_nav.dart @@ -31,7 +31,6 @@ Future main() async { }, behavior: HitTestBehavior.opaque, child: const IgnorePointer( - ignoring: true, child: GalleryApp(testMode: true), ), )); diff --git a/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart b/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart index c9f6150bff..ac136e55cf 100644 --- a/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart +++ b/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart @@ -199,7 +199,7 @@ class MotionEventsBodyState extends State { setState(() {}); break; } - return Future.value(null); + return Future.value(); } Future onViewMethodChannelCall(MethodCall call) { @@ -212,7 +212,7 @@ class MotionEventsBodyState extends State { setState(() {}); break; } - return Future.value(null); + return Future.value(); } Widget buildEventTile(BuildContext context, int index) { diff --git a/dev/integration_tests/web_e2e_tests/lib/scroll_wheel_main.dart b/dev/integration_tests/web_e2e_tests/lib/scroll_wheel_main.dart index 5c223b1b27..cd76389369 100644 --- a/dev/integration_tests/web_e2e_tests/lib/scroll_wheel_main.dart +++ b/dev/integration_tests/web_e2e_tests/lib/scroll_wheel_main.dart @@ -105,6 +105,5 @@ void dispatchMouseWheelEvent(int mouseX, int mouseY, deltaMode: deltaMode, deltaX : deltaX, deltaY : deltaY, - shiftKey: false, )); } diff --git a/dev/manual_tests/lib/drag_and_drop.dart b/dev/manual_tests/lib/drag_and_drop.dart index 234112fdc7..14dc71c725 100644 --- a/dev/manual_tests/lib/drag_and_drop.dart +++ b/dev/manual_tests/lib/drag_and_drop.dart @@ -248,13 +248,10 @@ class DragAndDropAppState extends State { children: [ Expanded( child: Row( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ExampleDragSource( color: Colors.yellow.shade300, - under: true, - heavy: false, child: const Text('under'), ), ExampleDragSource( @@ -266,7 +263,6 @@ class DragAndDropAppState extends State { ExampleDragSource( color: Colors.indigo.shade300, under: false, - heavy: false, child: const Text('above'), ), ], diff --git a/dev/manual_tests/lib/hover.dart b/dev/manual_tests/lib/hover.dart index 788dfdd31d..ec15311a11 100644 --- a/dev/manual_tests/lib/hover.dart +++ b/dev/manual_tests/lib/hover.dart @@ -89,7 +89,6 @@ class _HoverDemoState extends State { const Padding( padding: EdgeInsets.all(8.0), child: TextField( - autofocus: false, decoration: InputDecoration( border: OutlineInputBorder(), labelText: 'Enter Text', diff --git a/dev/manual_tests/lib/text.dart b/dev/manual_tests/lib/text.dart index 6facdf210c..576c93c75f 100644 --- a/dev/manual_tests/lib/text.dart +++ b/dev/manual_tests/lib/text.dart @@ -96,7 +96,6 @@ class _HomeState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 20.0), child: Slider( - min: 0.0, max: 1024.0, value: seed.toDouble(), label: '$seed', diff --git a/dev/tools/dartdoc.dart b/dev/tools/dartdoc.dart index 5cbcaa5eb7..7f63307131 100644 --- a/dev/tools/dartdoc.dart +++ b/dev/tools/dartdoc.dart @@ -250,15 +250,15 @@ ArgParser _createArgsParser() { final ArgParser parser = ArgParser(); parser.addFlag('help', abbr: 'h', negatable: false, help: 'Show command help.'); - parser.addFlag('verbose', negatable: true, defaultsTo: true, + parser.addFlag('verbose', defaultsTo: true, help: 'Whether to report all error messages (on) or attempt to ' 'filter out some known false positives (off). Shut this off ' 'locally if you want to address Flutter-specific issues.'); - parser.addFlag('checked', abbr: 'c', negatable: true, + parser.addFlag('checked', abbr: 'c', help: 'Run dartdoc in checked mode.'); - parser.addFlag('json', negatable: true, + parser.addFlag('json', help: 'Display json-formatted output from dartdoc and skip stdout/stderr prefixing.'); - parser.addFlag('validate-links', negatable: true, + parser.addFlag('validate-links', help: 'Display warnings for broken links generated by dartdoc (slow)'); return parser; } diff --git a/dev/tools/examples_smoke_test.dart b/dev/tools/examples_smoke_test.dart index cf36762f9d..7878b1b002 100644 --- a/dev/tools/examples_smoke_test.dart +++ b/dev/tools/examples_smoke_test.dart @@ -50,7 +50,7 @@ Future cleanUp(File integrationTest) async { try { await integrationTest.delete(); // Delete the integration_test directory if it is empty. - await integrationTest.parent.delete(recursive: false); + await integrationTest.parent.delete(); } on FileSystemException { // Ignore, there might be other files in there preventing it from // being removed, or it might not exist. @@ -205,7 +205,6 @@ Future runCommand( process = await processManager.start( cmd, workingDirectory: workingDirectory.absolute.path, - includeParentEnvironment: true, environment: environment, ); process.stdout.listen( diff --git a/dev/tools/gen_keycodes/bin/gen_keycodes.dart b/dev/tools/gen_keycodes/bin/gen_keycodes.dart index eda611ce1f..27bf0ca2ed 100644 --- a/dev/tools/gen_keycodes/bin/gen_keycodes.dart +++ b/dev/tools/gen_keycodes/bin/gen_keycodes.dart @@ -132,7 +132,6 @@ Future main(List rawArguments) async { ); argParser.addFlag( 'collect', - defaultsTo: false, negatable: false, help: 'If this flag is set, then collect and parse header files from ' 'Chromium and Android instead of reading pre-parsed data from ' @@ -141,7 +140,6 @@ Future main(List rawArguments) async { ); argParser.addFlag( 'help', - defaultsTo: false, negatable: false, help: 'Print help for this command.', ); diff --git a/dev/tools/gen_keycodes/lib/constants.dart b/dev/tools/gen_keycodes/lib/constants.dart index 3fe8b758c0..bb3a18191f 100644 --- a/dev/tools/gen_keycodes/lib/constants.dart +++ b/dev/tools/gen_keycodes/lib/constants.dart @@ -22,7 +22,7 @@ class MaskConstant { return name .split(' ') .map((String word) => lowerCamelToUpperCamel(word.toLowerCase())) - .join(''); + .join(); } String get lowerCamelName { diff --git a/dev/tools/gen_keycodes/lib/ios_code_gen.dart b/dev/tools/gen_keycodes/lib/ios_code_gen.dart index 1cf3d82a57..41bd10ae46 100644 --- a/dev/tools/gen_keycodes/lib/ios_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/ios_code_gen.dart @@ -81,7 +81,7 @@ class IOSCodeGenerator extends PlatformCodeGenerator { buffer.write(wrapString(constant.description, prefix: ' * ')); buffer.writeln(' */'); buffer.writeln('const uint64_t k${constant.upperCamelName} = ${toHex(constant.value, digits: 11)};'); - buffer.writeln(''); + buffer.writeln(); } return buffer.toString().trimRight(); } diff --git a/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart b/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart index 642e061513..70c32d9490 100644 --- a/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart +++ b/dev/tools/gen_keycodes/lib/keyboard_keys_code_gen.dart @@ -61,7 +61,7 @@ class KeyboardKeysCodeGenerator extends BaseCodeGenerator { '[RawKeyEvent.physicalKey] for more information.'); lines.add(entry.usbHidCode, ''' $firstComment /// -$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode, digits: 8)}); +$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode)}); '''); } return lines.sortedJoin().trimRight(); @@ -71,7 +71,7 @@ $otherComments static const PhysicalKeyboardKey ${entry.constantName} = Physica final OutputLines lines = OutputLines('Physical debug names'); for (final PhysicalKeyEntry entry in keyData.entries) { lines.add(entry.usbHidCode, ''' - ${toHex(entry.usbHidCode, digits: 8)}: '${entry.commentName}','''); + ${toHex(entry.usbHidCode)}: '${entry.commentName}','''); } return lines.sortedJoin().trimRight(); } diff --git a/dev/tools/gen_keycodes/lib/testing_key_codes_gen.dart b/dev/tools/gen_keycodes/lib/testing_key_codes_gen.dart index 3f48dd6082..26081e1e58 100644 --- a/dev/tools/gen_keycodes/lib/testing_key_codes_gen.dart +++ b/dev/tools/gen_keycodes/lib/testing_key_codes_gen.dart @@ -23,7 +23,7 @@ class KeyCodesCcGenerator extends BaseCodeGenerator { final OutputLines lines = OutputLines('Physical Key list'); for (final PhysicalKeyEntry entry in keyData.entries) { lines.add(entry.usbHidCode, ''' -constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode, digits: 8)};'''); +constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode)};'''); } return lines.sortedJoin().trimRight(); } diff --git a/dev/tools/localization/bin/gen_subtag_registry.dart b/dev/tools/localization/bin/gen_subtag_registry.dart index b1b2cbea33..c2779bfc71 100644 --- a/dev/tools/localization/bin/gen_subtag_registry.dart +++ b/dev/tools/localization/bin/gen_subtag_registry.dart @@ -15,7 +15,7 @@ Future main() async { final HttpClient client = HttpClient(); final HttpClientRequest request = await client.getUrl(Uri.parse(registry)); final HttpClientResponse response = await request.close(); - final String body = (await response.cast>().transform(utf8.decoder).toList()).join(''); + final String body = (await response.cast>().transform(utf8.decoder).toList()).join(); final File subtagRegistry = File('../language_subtag_registry.dart'); final File subtagRegistryFlutterTools = File('../../../../packages/flutter_tools/lib/src/localizations/language_subtag_registry.dart'); diff --git a/dev/tools/localization/localizations_utils.dart b/dev/tools/localization/localizations_utils.dart index e3373dce2c..e6d29cb8d5 100644 --- a/dev/tools/localization/localizations_utils.dart +++ b/dev/tools/localization/localizations_utils.dart @@ -118,7 +118,7 @@ class LocaleInfo implements Comparable { return originalString .split('_') .map((String part) => part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase()) - .join(''); + .join(); } @override @@ -232,17 +232,14 @@ GeneratorOptions parseArgs(List rawArgs) { ..addFlag( 'overwrite', abbr: 'w', - defaultsTo: false, ) ..addFlag( 'material', help: 'Whether to print the generated classes for the Material package only. Ignored when --overwrite is passed.', - defaultsTo: false, ) ..addFlag( 'cupertino', help: 'Whether to print the generated classes for the Cupertino package only. Ignored when --overwrite is passed.', - defaultsTo: false, ); final argslib.ArgResults args = argParser.parse(rawArgs); final bool writeToFile = args['overwrite'] as bool; diff --git a/dev/tools/mega_gallery.dart b/dev/tools/mega_gallery.dart index fca4fd9ace..cf478beb2c 100644 --- a/dev/tools/mega_gallery.dart +++ b/dev/tools/mega_gallery.dart @@ -165,7 +165,7 @@ class SourceStats { SourceStats getStatsFor(Directory dir, [SourceStats? stats]) { stats ??= SourceStats(); - for (final FileSystemEntity entity in dir.listSync(recursive: false, followLinks: false)) { + for (final FileSystemEntity entity in dir.listSync(followLinks: false)) { final String name = path.basename(entity.path); if (entity is File && name.endsWith('.dart')) { stats.files += 1; diff --git a/dev/tools/update_icons.dart b/dev/tools/update_icons.dart index bfdba6a542..33cb323c49 100644 --- a/dev/tools/update_icons.dart +++ b/dev/tools/update_icons.dart @@ -212,7 +212,7 @@ ArgResults _handleArguments(List args) { ..addOption(_iconsClassPathOption, defaultsTo: _defaultIconsPath, help: 'Location of the material icons file') - ..addFlag(_dryRunOption, defaultsTo: false); + ..addFlag(_dryRunOption); argParser.addFlag('help', abbr: 'h', negatable: false, callback: (bool help) { if (help) { print(argParser.usage); @@ -289,7 +289,7 @@ String _regenerateIconsFile(String iconData, Map tokenPairMap) { // Generate for Icons if (line.contains(_beginGeneratedMark)) { generating = true; - final String iconDeclarationsString = newIcons.map((_Icon icon) => icon.fullDeclaration).join(''); + final String iconDeclarationsString = newIcons.map((_Icon icon) => icon.fullDeclaration).join(); buf.write(iconDeclarationsString); } else if (line.contains(_endGeneratedMark)) { generating = false; diff --git a/examples/api/lib/animation/curves/curve2_d.0.dart b/examples/api/lib/animation/curves/curve2_d.0.dart index 367862b6ac..9aeb10c673 100644 --- a/examples/api/lib/animation/curves/curve2_d.0.dart +++ b/examples/api/lib/animation/curves/curve2_d.0.dart @@ -39,7 +39,6 @@ final CatmullRomSpline path = CatmullRomSpline( ], startHandle: const Offset(0.93, 0.93), endHandle: const Offset(0.18, 0.23), - tension: 0.0, ); class FollowCurve2D extends StatefulWidget { @@ -74,7 +73,7 @@ class _FollowCurve2DState extends State animation = CurvedAnimation(parent: controller, curve: widget.curve); // Have the controller repeat indefinitely. If you want it to "bounce" back // and forth, set the reverse parameter to true. - controller.repeat(reverse: false); + controller.repeat(); controller.addListener(() => setState(() {})); } @@ -107,7 +106,6 @@ class MyStatelessWidget extends StatelessWidget { alignment: Alignment.center, child: FollowCurve2D( path: path, - curve: Curves.easeInOut, duration: const Duration(seconds: 3), child: CircleAvatar( backgroundColor: Colors.yellow, diff --git a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart index 4ba371a63d..ce63503d8b 100644 --- a/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart +++ b/examples/api/lib/cupertino/refresh/cupertino_sliver_refresh_control.0.dart @@ -53,8 +53,6 @@ class _MyStatefulWidgetState extends State { largeTitle: Text('Scroll down'), ), CupertinoSliverRefreshControl( - refreshTriggerPullDistance: 100.0, - refreshIndicatorExtent: 60.0, onRefresh: () async { await Future.delayed( const Duration(milliseconds: 1000), diff --git a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart index 3831047f6a..4cad004fe6 100644 --- a/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart +++ b/examples/api/lib/gestures/pointer_signal_resolver/pointer_signal_resolver.0.dart @@ -116,7 +116,6 @@ class _MyStatefulWidgetState extends State { Align( alignment: Alignment.topLeft, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, children: [ Switch( value: useResolver, diff --git a/examples/api/lib/material/date_picker/show_date_picker.0.dart b/examples/api/lib/material/date_picker/show_date_picker.0.dart index 73cb2c33aa..c524affe2c 100644 --- a/examples/api/lib/material/date_picker/show_date_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_picker.0.dart @@ -64,8 +64,8 @@ class _MyStatefulWidgetState extends State restorationId: 'date_picker_dialog', initialEntryMode: DatePickerEntryMode.calendarOnly, initialDate: DateTime.fromMillisecondsSinceEpoch(arguments! as int), - firstDate: DateTime(2021, 1, 1), - lastDate: DateTime(2022, 1, 1), + firstDate: DateTime(2021), + lastDate: DateTime(2022), ); }, ); diff --git a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart index 62a96eca14..47d77876ce 100644 --- a/examples/api/lib/material/date_picker/show_date_range_picker.0.dart +++ b/examples/api/lib/material/date_picker/show_date_range_picker.0.dart @@ -41,7 +41,7 @@ class _MyStatefulWidgetState extends State String? get restorationId => widget.restorationId; final RestorableDateTimeN _startDate = - RestorableDateTimeN(DateTime(2021, 1, 1)); + RestorableDateTimeN(DateTime(2021)); final RestorableDateTimeN _endDate = RestorableDateTimeN(DateTime(2021, 1, 5)); late final RestorableRouteFuture @@ -85,9 +85,9 @@ class _MyStatefulWidgetState extends State restorationId: 'date_picker_dialog', initialDateRange: _initialDateTimeRange(arguments! as Map), - firstDate: DateTime(2021, 1, 1), + firstDate: DateTime(2021), currentDate: DateTime(2021, 1, 25), - lastDate: DateTime(2022, 1, 1), + lastDate: DateTime(2022), ); }, ); diff --git a/examples/api/lib/material/dropdown/dropdown_button.0.dart b/examples/api/lib/material/dropdown/dropdown_button.0.dart index 3ceb1a1cfa..fcf87e5cbc 100644 --- a/examples/api/lib/material/dropdown/dropdown_button.0.dart +++ b/examples/api/lib/material/dropdown/dropdown_button.0.dart @@ -42,7 +42,6 @@ class _MyStatefulWidgetState extends State { return DropdownButton( value: dropdownValue, icon: const Icon(Icons.arrow_downward), - iconSize: 24, elevation: 16, style: const TextStyle(color: Colors.deepPurple), underline: Container( diff --git a/examples/api/lib/material/list_tile/list_tile.5.dart b/examples/api/lib/material/list_tile/list_tile.5.dart index 6a350ebc66..15fd4b1685 100644 --- a/examples/api/lib/material/list_tile/list_tile.5.dart +++ b/examples/api/lib/material/list_tile/list_tile.5.dart @@ -47,7 +47,6 @@ class _ArticleDescription extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -73,7 +72,6 @@ class _ArticleDescription extends StatelessWidget { ), ), Expanded( - flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.end, diff --git a/examples/api/lib/material/material_state/material_state_border_side.0.dart b/examples/api/lib/material/material_state/material_state_border_side.0.dart index 4130382c94..8a65691742 100644 --- a/examples/api/lib/material/material_state/material_state_border_side.0.dart +++ b/examples/api/lib/material/material_state/material_state_border_side.0.dart @@ -49,7 +49,7 @@ class _MyStatefulWidgetState extends State { }, side: MaterialStateBorderSide.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { - return const BorderSide(width: 1, color: Colors.red); + return const BorderSide(color: Colors.red); } return null; // Defer to default value on the theme or widget. }), diff --git a/examples/api/lib/material/radio/radio.toggleable.0.dart b/examples/api/lib/material/radio/radio.toggleable.0.dart index 6a0c0c18d2..c2263b9ac3 100644 --- a/examples/api/lib/material/radio/radio.toggleable.0.dart +++ b/examples/api/lib/material/radio/radio.toggleable.0.dart @@ -49,7 +49,6 @@ class _MyStatefulWidgetState extends State { itemBuilder: (BuildContext context, int index) { return Row( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Radio( value: index, diff --git a/examples/api/lib/material/range_slider/range_slider.0.dart b/examples/api/lib/material/range_slider/range_slider.0.dart index c4da141b3d..54af89063d 100644 --- a/examples/api/lib/material/range_slider/range_slider.0.dart +++ b/examples/api/lib/material/range_slider/range_slider.0.dart @@ -39,7 +39,6 @@ class _MyStatefulWidgetState extends State { Widget build(BuildContext context) { return RangeSlider( values: _currentRangeValues, - min: 0, max: 100, divisions: 5, labels: RangeLabels( diff --git a/examples/api/lib/material/slider/slider.0.dart b/examples/api/lib/material/slider/slider.0.dart index ea17910346..d963f1c91a 100644 --- a/examples/api/lib/material/slider/slider.0.dart +++ b/examples/api/lib/material/slider/slider.0.dart @@ -39,7 +39,6 @@ class _MyStatefulWidgetState extends State { Widget build(BuildContext context) { return Slider( value: _currentSliderValue, - min: 0, max: 100, divisions: 5, label: _currentSliderValue.round().toString(), diff --git a/examples/api/lib/widgets/actions/action.action_overridable.0.dart b/examples/api/lib/widgets/actions/action.action_overridable.0.dart index d46fda69d1..502b72f17b 100644 --- a/examples/api/lib/widgets/actions/action.action_overridable.0.dart +++ b/examples/api/lib/widgets/actions/action.action_overridable.0.dart @@ -122,42 +122,39 @@ class _SimpleUSPhoneNumberEntryState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Expanded( - child: Text( - '(', - textAlign: TextAlign.center, - ), - flex: 1), + child: Text('(', textAlign: TextAlign.center), + ), Expanded( - child: DigitInput( - focusNode: areaCodeFocusNode, - controller: areaCodeController, - maxLength: 3), - flex: 3), + flex: 3, + child: DigitInput( + focusNode: areaCodeFocusNode, + controller: areaCodeController, + maxLength: 3, + ), + ), const Expanded( - child: Text( - ')', - textAlign: TextAlign.center, - ), - flex: 1), + child: Text(')', textAlign: TextAlign.center), + ), Expanded( - child: DigitInput( - focusNode: prefixFocusNode, - controller: prefixController, - maxLength: 3), - flex: 3), + flex: 3, + child: DigitInput( + focusNode: prefixFocusNode, + controller: prefixController, + maxLength: 3, + ), + ), const Expanded( - child: Text( - '-', - textAlign: TextAlign.center, - ), - flex: 1), + child: Text('-', textAlign: TextAlign.center), + ), Expanded( - child: DigitInput( - focusNode: lineNumberFocusNode, - controller: lineNumberController, - textInputAction: TextInputAction.done, - maxLength: 4), - flex: 4), + flex: 4, + child: DigitInput( + focusNode: lineNumberFocusNode, + controller: lineNumberController, + textInputAction: TextInputAction.done, + maxLength: 4, + ), + ), ], ), ); diff --git a/examples/api/lib/widgets/actions/action_listener.0.dart b/examples/api/lib/widgets/actions/action_listener.0.dart index c481a9cec4..aa5f5ac0f7 100644 --- a/examples/api/lib/widgets/actions/action_listener.0.dart +++ b/examples/api/lib/widgets/actions/action_listener.0.dart @@ -53,7 +53,6 @@ class _ActionListenerExampleState extends State { @override Widget build(BuildContext context) { return Row( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Padding( diff --git a/examples/api/lib/widgets/animated_list/animated_list.0.dart b/examples/api/lib/widgets/animated_list/animated_list.0.dart index 390284a9b7..56f5701509 100644 --- a/examples/api/lib/widgets/animated_list/animated_list.0.dart +++ b/examples/api/lib/widgets/animated_list/animated_list.0.dart @@ -62,7 +62,6 @@ class _AnimatedListSampleState extends State { return CardItem( animation: animation, item: item, - selected: false, // No gesture detector here: we don't want removed items to be interactive. ); } @@ -196,7 +195,6 @@ class CardItem extends StatelessWidget { return Padding( padding: const EdgeInsets.all(2.0), child: SizeTransition( - axis: Axis.vertical, sizeFactor: animation, child: GestureDetector( behavior: HitTestBehavior.opaque, diff --git a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart index 4a07081cb3..65a2535790 100644 --- a/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart +++ b/examples/api/lib/widgets/animated_list/sliver_animated_list.0.dart @@ -65,7 +65,6 @@ class _SliverAnimatedListSampleState extends State { return CardItem( animation: animation, item: item, - selected: false, ); } @@ -213,10 +212,8 @@ class CardItem extends StatelessWidget { left: 2.0, right: 2.0, top: 2.0, - bottom: 0.0, ), child: SizeTransition( - axis: Axis.vertical, sizeFactor: animation, child: GestureDetector( onTap: onTap, diff --git a/examples/api/lib/widgets/async/future_builder.0.dart b/examples/api/lib/widgets/async/future_builder.0.dart index 2570893fab..ab6ea90887 100644 --- a/examples/api/lib/widgets/async/future_builder.0.dart +++ b/examples/api/lib/widgets/async/future_builder.0.dart @@ -84,7 +84,6 @@ class _MyStatefulWidgetState extends State { return Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: children, ), ); diff --git a/examples/api/lib/widgets/async/stream_builder.0.dart b/examples/api/lib/widgets/async/stream_builder.0.dart index 46f4a23125..8c7005a624 100644 --- a/examples/api/lib/widgets/async/stream_builder.0.dart +++ b/examples/api/lib/widgets/async/stream_builder.0.dart @@ -123,7 +123,6 @@ class _MyStatefulWidgetState extends State { return Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: children, ); }, diff --git a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart index 0a358eaf6c..babed5fa0e 100644 --- a/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart +++ b/examples/api/lib/widgets/autocomplete/raw_autocomplete.2.dart @@ -56,7 +56,6 @@ class AutocompleteFormExampleState extends State { value: _dropdownValue, icon: const Icon(Icons.arrow_downward), hint: const Text('This is a regular DropdownButtonFormField'), - iconSize: 24, elevation: 16, style: const TextStyle(color: Colors.deepPurple), onChanged: (String? newValue) { diff --git a/examples/api/lib/widgets/basic/absorb_pointer.0.dart b/examples/api/lib/widgets/basic/absorb_pointer.0.dart index 00e0f9cd84..12936e3e1c 100644 --- a/examples/api/lib/widgets/basic/absorb_pointer.0.dart +++ b/examples/api/lib/widgets/basic/absorb_pointer.0.dart @@ -47,7 +47,6 @@ class MyStatelessWidget extends StatelessWidget { width: 100.0, height: 200.0, child: AbsorbPointer( - absorbing: true, child: ElevatedButton( style: ElevatedButton.styleFrom( primary: Colors.blue.shade200, diff --git a/examples/api/lib/widgets/basic/expanded.1.dart b/examples/api/lib/widgets/basic/expanded.1.dart index 78a8fd75fe..aed0cda8fb 100644 --- a/examples/api/lib/widgets/basic/expanded.1.dart +++ b/examples/api/lib/widgets/basic/expanded.1.dart @@ -47,7 +47,6 @@ class MyStatelessWidget extends StatelessWidget { width: 50, ), Expanded( - flex: 1, child: Container( color: Colors.amber, height: 100, diff --git a/examples/api/lib/widgets/page_view/page_view.0.dart b/examples/api/lib/widgets/page_view/page_view.0.dart index 9a9952c141..e18fe940fa 100644 --- a/examples/api/lib/widgets/page_view/page_view.0.dart +++ b/examples/api/lib/widgets/page_view/page_view.0.dart @@ -30,11 +30,10 @@ class MyStatelessWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final PageController controller = PageController(initialPage: 0); + final PageController controller = PageController(); return PageView( /// [PageView.scrollDirection] defaults to [Axis.horizontal]. /// Use [Axis.vertical] to scroll vertically. - scrollDirection: Axis.horizontal, controller: controller, children: const [ Center( diff --git a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart index 4dad636920..86fac6523a 100644 --- a/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart +++ b/examples/api/lib/widgets/transitions/decorated_box_transition.0.dart @@ -37,7 +37,6 @@ class _MyStatefulWidgetState extends State color: const Color(0xFFFFFFFF), border: Border.all(style: BorderStyle.none), borderRadius: BorderRadius.circular(60.0), - shape: BoxShape.rectangle, boxShadow: const [ BoxShadow( color: Color(0x66666666), @@ -74,7 +73,6 @@ class _MyStatefulWidgetState extends State color: Colors.white, child: Center( child: DecoratedBoxTransition( - position: DecorationPosition.background, decoration: decorationTween.animate(_controller), child: Container( width: 200, diff --git a/examples/layers/rendering/flex_layout.dart b/examples/layers/rendering/flex_layout.dart index e53073159c..43c29509fc 100644 --- a/examples/layers/rendering/flex_layout.dart +++ b/examples/layers/rendering/flex_layout.dart @@ -65,7 +65,7 @@ void main() { textDirection: TextDirection.ltr, ); table.add(RenderPadding(child: paragraph, padding: const EdgeInsets.only(top: 20.0))); - final RenderFlex row = RenderFlex(direction: Axis.horizontal, textDirection: TextDirection.ltr); + final RenderFlex row = RenderFlex(textDirection: TextDirection.ltr); row.add(RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: const Size(80.0, 60.0))); row.add(RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: const Size(64.0, 60.0))); row.add(RenderSolidColorBox(const Color(0xFFCCCCFF), desiredSize: const Size(160.0, 60.0))); diff --git a/examples/layers/rendering/hello_world.dart b/examples/layers/rendering/hello_world.dart index 800e2ccace..03b4801e28 100644 --- a/examples/layers/rendering/hello_world.dart +++ b/examples/layers/rendering/hello_world.dart @@ -13,7 +13,6 @@ void main() { // The root of our render tree is a RenderPositionedBox, which centers its // child both vertically and horizontally. root: RenderPositionedBox( - alignment: Alignment.center, // We use a RenderParagraph to display the text 'Hello, world.' without // any explicit styling. child: RenderParagraph( diff --git a/examples/layers/rendering/spinning_square.dart b/examples/layers/rendering/spinning_square.dart index b1f0027744..68b1359139 100644 --- a/examples/layers/rendering/spinning_square.dart +++ b/examples/layers/rendering/spinning_square.dart @@ -39,7 +39,6 @@ void main() { ); // Finally, we center the spinning green square... final RenderBox root = RenderPositionedBox( - alignment: Alignment.center, child: spin, ); // and attach it to the window. diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart index af96dc7cac..b0dc78b3b5 100644 --- a/examples/layers/widgets/sectors.dart +++ b/examples/layers/widgets/sectors.dart @@ -11,7 +11,7 @@ import '../rendering/src/sector_layout.dart'; RenderBoxToRenderSectorAdapter initCircle() { return RenderBoxToRenderSectorAdapter( innerRadius: 25.0, - child: RenderSectorRing(padding: 0.0), + child: RenderSectorRing(), ); } diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index bc60e90d80..56ecbe9b79 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -33,7 +33,6 @@ enum _AnimationDirection { final SpringDescription _kFlingSpringDescription = SpringDescription.withDampingRatio( mass: 1.0, stiffness: 500.0, - ratio: 1.0, ); const Tolerance _kFlingTolerance = Tolerance( diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index e968c25cb7..5018f58e8e 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -889,7 +889,7 @@ class CatmullRomCurve extends Curve { // and (1, 1), respectively. [Offset.zero, ...controlPoints, const Offset(1.0, 1.0)], tension: tension, - ).generateSamples(start: 0.0, end: 1.0, tolerance: 1e-12).toList(); + ).generateSamples(tolerance: 1e-12).toList(); } /// A static accumulator for assertion failures. Not used in release mode. diff --git a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart index bdfb3be56c..e5ca9a0e3a 100644 --- a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart +++ b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart @@ -62,8 +62,7 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { this.border = const Border( top: BorderSide( color: _kDefaultTabBarBorderColor, - width: 0.0, // One physical pixel. - style: BorderStyle.solid, + width: 0.0, // 0.0 means one physical pixel ), ), }) : assert(items != null), diff --git a/packages/flutter/lib/src/cupertino/context_menu.dart b/packages/flutter/lib/src/cupertino/context_menu.dart index a4bbb96981..788a928b2f 100644 --- a/packages/flutter/lib/src/cupertino/context_menu.dart +++ b/packages/flutter/lib/src/cupertino/context_menu.dart @@ -344,7 +344,6 @@ class _CupertinoContextMenuState extends State with Ticker // it expands. This may be solvable by adding a widget to Scaffold that's // underneath the AppBar. _lastOverlayEntry = OverlayEntry( - opaque: false, builder: (BuildContext context) { return _DecoyChild( beginRect: childRect, @@ -1170,33 +1169,23 @@ class _ContextMenuSheet extends StatelessWidget { case _ContextMenuLocation.center: return _orientation == Orientation.portrait ? [ - const Spacer( - flex: 1, - ), + const Spacer(), menu, - const Spacer( - flex: 1, - ), + const Spacer(), ] : [ menu, - const Spacer( - flex: 1, - ), + const Spacer(), ]; case _ContextMenuLocation.right: return [ - const Spacer( - flex: 1, - ), + const Spacer(), menu, ]; case _ContextMenuLocation.left: return [ menu, - const Spacer( - flex: 1, - ), + const Spacer(), ]; } } diff --git a/packages/flutter/lib/src/cupertino/context_menu_action.dart b/packages/flutter/lib/src/cupertino/context_menu_action.dart index 44813e3dad..3be99045b0 100644 --- a/packages/flutter/lib/src/cupertino/context_menu_action.dart +++ b/packages/flutter/lib/src/cupertino/context_menu_action.dart @@ -116,7 +116,7 @@ class _CupertinoContextMenuActionState extends State decoration: BoxDecoration( color: _isPressed ? _kBackgroundColorPressed : _kBackgroundColor, border: const Border( - bottom: BorderSide(width: 1.0, color: _kBackgroundColorPressed), + bottom: BorderSide(color: _kBackgroundColorPressed), ), ), padding: const EdgeInsets.symmetric( diff --git a/packages/flutter/lib/src/cupertino/date_picker.dart b/packages/flutter/lib/src/cupertino/date_picker.dart index 86ff0f5a8d..f5c1a36227 100644 --- a/packages/flutter/lib/src/cupertino/date_picker.dart +++ b/packages/flutter/lib/src/cupertino/date_picker.dart @@ -583,7 +583,7 @@ class _CupertinoDatePickerDateTimeState extends State { meridiemController = FixedExtentScrollController(initialItem: selectedAmPm); hourController = FixedExtentScrollController(initialItem: initialDateTime.hour); minuteController = FixedExtentScrollController(initialItem: initialDateTime.minute ~/ widget.minuteInterval); - dateController = FixedExtentScrollController(initialItem: 0); + dateController = FixedExtentScrollController(); PaintingBinding.instance!.systemFonts.addListener(_handleSystemFontsChange); } @@ -740,7 +740,6 @@ class _CupertinoDatePickerDateTimeState extends State { initialDateTime.month, initialDateTime.day + selectedDayFromInitial, _selectedHour(meridiemIndex, hourIndex), - 0, ); // The end value of the range is exclusive, i.e. [rangeStart, rangeEnd). diff --git a/packages/flutter/lib/src/cupertino/desktop_text_selection.dart b/packages/flutter/lib/src/cupertino/desktop_text_selection.dart index 694d9a31bf..c0c76c18d8 100644 --- a/packages/flutter/lib/src/cupertino/desktop_text_selection.dart +++ b/packages/flutter/lib/src/cupertino/desktop_text_selection.dart @@ -280,7 +280,6 @@ class _CupertinoDesktopTextSelectionToolbar extends StatelessWidget { ), child: Padding( padding: const EdgeInsets.symmetric( - horizontal: 0.0, // This value was measured from a screenshot of TextEdit on MacOS // 10.15.7 on a Macbook Pro. vertical: 3.0, diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index 5c5fbecbed..32076a4c5f 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -351,7 +351,6 @@ class CupertinoAlertDialog extends StatelessWidget { if (actions.isNotEmpty) { actionSection = _CupertinoAlertActionSection( scrollController: _effectiveActionScrollController, - isActionSheet: false, children: actions, ); } @@ -1517,7 +1516,6 @@ class _CupertinoAlertContentSection extends StatelessWidget { child: SingleChildScrollView( controller: scrollController, child: Column( - mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.stretch, children: titleContentGroup, ), @@ -2234,7 +2232,7 @@ class _RenderCupertinoDialogActions extends RenderBox @override void performLayout() { - size = _performLayout(constraints: constraints, dry: false); + size = _performLayout(constraints: constraints); } Size _performLayout({required BoxConstraints constraints, bool dry = false}) { @@ -2259,8 +2257,6 @@ class _RenderCupertinoDialogActions extends RenderBox final BoxConstraints perButtonConstraints = BoxConstraints( minWidth: (constraints.minWidth - dividerThickness) / 2.0, maxWidth: (constraints.maxWidth - dividerThickness) / 2.0, - minHeight: 0.0, - maxHeight: double.infinity, ); // Layout the 2 buttons. diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index b863680abe..53e4877672 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -43,8 +43,7 @@ const Color _kDefaultNavBarBorderColor = Color(0x4D000000); const Border _kDefaultNavBarBorder = Border( bottom: BorderSide( color: _kDefaultNavBarBorderColor, - width: 0.0, // One physical pixel. - style: BorderStyle.solid, + width: 0.0, // 0.0 means one physical pixel ), ); @@ -153,7 +152,6 @@ Widget _wrapWithBackground({ } result = AnnotatedRegion( value: overlayStyle, - sized: true, child: result, ); } @@ -960,7 +958,6 @@ class _PersistentNavigationBar extends StatelessWidget { leading: leading, middle: middle, trailing: components.trailing, - centerMiddle: true, middleSpacing: 6.0, ); @@ -1356,7 +1353,6 @@ class CupertinoNavigationBarBackButton extends StatelessWidget { constraints: const BoxConstraints(minWidth: _kNavBarBackButtonTapWidth), child: Row( mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, children: [ const Padding(padding: EdgeInsetsDirectional.only(start: 8.0)), _backChevron ?? const _BackChevron(), diff --git a/packages/flutter/lib/src/cupertino/picker.dart b/packages/flutter/lib/src/cupertino/picker.dart index c6516ed1b0..57064f3681 100644 --- a/packages/flutter/lib/src/cupertino/picker.dart +++ b/packages/flutter/lib/src/cupertino/picker.dart @@ -278,6 +278,7 @@ class _CupertinoPickerState extends State { Widget build(BuildContext context) { final Color? resolvedBackgroundColor = CupertinoDynamicColor.maybeResolve(widget.backgroundColor, context); + assert(RenderListWheelViewport.defaultPerspective == _kDefaultPerspective); final Widget result = DefaultTextStyle( style: CupertinoTheme.of(context).textTheme.pickerTextStyle, child: Stack( @@ -289,7 +290,6 @@ class _CupertinoPickerState extends State { controller: widget.scrollController ?? _controller, physics: const FixedExtentScrollPhysics(), diameterRatio: widget.diameterRatio, - perspective: _kDefaultPerspective, offAxisFraction: widget.offAxisFraction, useMagnifier: widget.useMagnifier, magnification: widget.magnification, diff --git a/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart b/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart index 308bea803d..eadbcfcca3 100644 --- a/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart @@ -149,7 +149,6 @@ class _SegmentState extends State<_Segment> with TickerProviderStateMixin< // Expand the hitTest area of this widget. behavior: HitTestBehavior.opaque, child: IndexedStack( - index: 0, alignment: Alignment.center, children: [ AnimatedOpacity( diff --git a/packages/flutter/lib/src/cupertino/text_field.dart b/packages/flutter/lib/src/cupertino/text_field.dart index 75b5de9957..663e5a1acb 100644 --- a/packages/flutter/lib/src/cupertino/text_field.dart +++ b/packages/flutter/lib/src/cupertino/text_field.dart @@ -29,7 +29,6 @@ const BorderSide _kDefaultRoundedBorderSide = BorderSide( color: Color(0x33000000), darkColor: Color(0x33FFFFFF), ), - style: BorderStyle.solid, width: 0.0, ); const Border _kDefaultRoundedBorder = Border( diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index cebd69d6de..827188c2a6 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -228,7 +228,7 @@ abstract class _ErrorDiagnostic extends DiagnosticsProperty> { @override String valueToString({ TextTreeConfiguration? parentConfiguration }) { - return value.join(''); + return value.join(); } } @@ -969,7 +969,6 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti if (isInDebugMode) { debugPrint( TextTreeRenderer( - wrapWidth: wrapWidth, wrapWidthProperties: wrapWidth, maxDescendentsTruncatableNode: 5, ).render(details.toDiagnosticsNode(style: DiagnosticsTreeStyle.error)).trimRight(), @@ -1042,7 +1041,7 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti index -= 1; } } - final List reasons = List.filled(parsedFrames.length, null, growable: false); + final List reasons = List.filled(parsedFrames.length, null); for (final StackFilter filter in _stackFilters) { filter.filter(parsedFrames, reasons); } diff --git a/packages/flutter/lib/src/foundation/constants.dart b/packages/flutter/lib/src/foundation/constants.dart index 563ad477f8..fb60b60e3b 100644 --- a/packages/flutter/lib/src/foundation/constants.dart +++ b/packages/flutter/lib/src/foundation/constants.dart @@ -19,7 +19,7 @@ /// /// * [kDebugMode], which is true in debug builds. /// * [kProfileMode], which is true in profile builds. -const bool kReleaseMode = bool.fromEnvironment('dart.vm.product', defaultValue: false); +const bool kReleaseMode = bool.fromEnvironment('dart.vm.product'); /// A constant that is true if the application was compiled in profile mode. /// @@ -34,7 +34,7 @@ const bool kReleaseMode = bool.fromEnvironment('dart.vm.product', defaultValue: /// /// * [kDebugMode], which is true in debug builds. /// * [kReleaseMode], which is true in release builds. -const bool kProfileMode = bool.fromEnvironment('dart.vm.profile', defaultValue: false); +const bool kProfileMode = bool.fromEnvironment('dart.vm.profile'); /// A constant that is true if the application was compiled in debug mode. /// diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index b40277fa65..928e453bf4 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -643,7 +643,6 @@ final TextTreeConfiguration whitespaceTextConfiguration = TextTreeConfiguration( prefixLastChildLineOne: '', prefixOtherLines: ' ', prefixOtherLinesRootNode: ' ', - bodyIndent: '', propertyPrefixIfChildren: '', propertyPrefixNoChildren: '', linkCharacter: ' ', @@ -678,7 +677,6 @@ final TextTreeConfiguration flatTextConfiguration = TextTreeConfiguration( prefixLastChildLineOne: '', prefixOtherLines: '', prefixOtherLinesRootNode: '', - bodyIndent: '', propertyPrefixIfChildren: '', propertyPrefixNoChildren: '', linkCharacter: '', @@ -733,7 +731,6 @@ final TextTreeConfiguration errorPropertyTextConfiguration = TextTreeConfigurati prefixLineOne: '', prefixOtherLines: '', prefixLastChildLineOne: '', - lineBreak: '\n', lineBreakProperties: false, addBlankLineIfNoChildren: false, showChildren: false, @@ -741,7 +738,6 @@ final TextTreeConfiguration errorPropertyTextConfiguration = TextTreeConfigurati propertyPrefixNoChildren: ' ', linkCharacter: '', prefixOtherLinesRootNode: '', - afterName: ':', isNameOnOwnLine: true, ); @@ -761,7 +757,6 @@ final TextTreeConfiguration shallowTextConfiguration = TextTreeConfiguration( prefixLastChildLineOne: '', prefixOtherLines: ' ', prefixOtherLinesRootNode: ' ', - bodyIndent: '', propertyPrefixIfChildren: '', propertyPrefixNoChildren: '', linkCharacter: ' ', @@ -1310,7 +1305,7 @@ class TextTreeRenderer { if (propertyLines.length == 1 && !config.lineBreakProperties) { builder.write(propertyLines.first); } else { - builder.write(propertyRender, allowWrap: false); + builder.write(propertyRender); if (!propertyRender.endsWith('\n')) builder.write('\n'); } @@ -1740,7 +1735,6 @@ abstract class DiagnosticsNode { result = TextTreeRenderer( minLevel: minLevel, wrapWidth: 65, - wrapWidthProperties: 65, ).render( this, prefixLineOne: prefixLineOne, diff --git a/packages/flutter/lib/src/gestures/binding.dart b/packages/flutter/lib/src/gestures/binding.dart index 3689aef450..241eb10538 100644 --- a/packages/flutter/lib/src/gestures/binding.dart +++ b/packages/flutter/lib/src/gestures/binding.dart @@ -407,7 +407,6 @@ mixin GestureBinding on BindingBase implements HitTestable, HitTestDispatcher, H library: 'gesture library', context: ErrorDescription('while dispatching a non-hit-tested pointer event'), event: event, - hitTestEntry: null, informationCollector: () sync* { yield DiagnosticsProperty('Event', event, style: DiagnosticsTreeStyle.errorProperty); }, diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index 362548b7b7..a3aaeb3bf2 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -474,7 +474,6 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer { }; } else { details = DragEndDetails( - velocity: Velocity.zero, primaryVelocity: 0.0, ); debugReport = () { diff --git a/packages/flutter/lib/src/gestures/scale.dart b/packages/flutter/lib/src/gestures/scale.dart index f3c9d98bf8..1671c81c48 100644 --- a/packages/flutter/lib/src/gestures/scale.dart +++ b/packages/flutter/lib/src/gestures/scale.dart @@ -499,7 +499,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer { velocity = Velocity(pixelsPerSecond: (pixelsPerSecond / pixelsPerSecond.distance) * kMaxFlingVelocity); invokeCallback('onEnd', () => onEnd!(ScaleEndDetails(velocity: velocity, pointerCount: _pointerQueue.length))); } else { - invokeCallback('onEnd', () => onEnd!(ScaleEndDetails(velocity: Velocity.zero, pointerCount: _pointerQueue.length))); + invokeCallback('onEnd', () => onEnd!(ScaleEndDetails(pointerCount: _pointerQueue.length))); } } _state = _ScaleState.accepted; diff --git a/packages/flutter/lib/src/gestures/velocity_tracker.dart b/packages/flutter/lib/src/gestures/velocity_tracker.dart index 78577bccec..3c626b9509 100644 --- a/packages/flutter/lib/src/gestures/velocity_tracker.dart +++ b/packages/flutter/lib/src/gestures/velocity_tracker.dart @@ -163,7 +163,7 @@ class VelocityTracker { final PointerDeviceKind kind; // Circular buffer; current sample at _index. - final List<_PointAtTime?> _samples = List<_PointAtTime?>.filled(_historySize, null, growable: false); + final List<_PointAtTime?> _samples = List<_PointAtTime?>.filled(_historySize, null); int _index = 0; /// Adds a position as the given time to the tracker. @@ -292,7 +292,7 @@ class IOSScrollViewFlingVelocityTracker extends VelocityTracker { /// `VerticalDragGestureRecognizer.isFlingGesture`. static const int _sampleSize = 20; - final List<_PointAtTime?> _touchSamples = List<_PointAtTime?>.filled(_sampleSize, null, growable: false); + final List<_PointAtTime?> _touchSamples = List<_PointAtTime?>.filled(_sampleSize, null); @override void addPosition(Duration time, Offset position) { diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index e16bf7a84d..ef9de75d14 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -570,7 +570,6 @@ class _PackagesViewState extends State<_PackagesView> { return Material( color: Theme.of(context).cardColor, child: Column( - mainAxisAlignment: MainAxisAlignment.start, children: [ widget.about, const Center(child: CircularProgressIndicator()), @@ -1470,7 +1469,6 @@ class _MasterDetailScaffoldState extends State<_MasterDetailScaffold> bottom: PreferredSize( preferredSize: const Size.fromHeight(kToolbarHeight), child: Row( - mainAxisAlignment: MainAxisAlignment.start, children: [ ConstrainedBox( constraints: BoxConstraints.tightFor(width: masterViewWidth), @@ -1576,7 +1574,6 @@ class _DetailView extends StatelessWidget { return DraggableScrollableSheet( initialChildSize: minHeight, minChildSize: minHeight, - maxChildSize: 1, expand: false, builder: (BuildContext context, ScrollController controller) { return MouseRegion( @@ -1587,7 +1584,7 @@ class _DetailView extends StatelessWidget { clipBehavior: Clip.antiAlias, margin: const EdgeInsets.fromLTRB(_kCardElevation, 0.0, _kCardElevation, 0.0), shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical(top: Radius.circular(3.0), bottom: Radius.zero), + borderRadius: BorderRadius.vertical(top: Radius.circular(3.0)), ), child: _builder( context, diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index 1a70eaec39..e26a49a0cd 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -948,7 +948,6 @@ class _MaterialAppState extends State { result = GridPaper( color: const Color(0xE0F9BBE0), interval: 8.0, - divisions: 2, subdivisions: 1, child: result, ); diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index cb3eccc8e0..9d530e7e67 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -1011,7 +1011,6 @@ class _AppBarState extends State { if (widget.primary) { appBar = SafeArea( bottom: false, - top: true, child: appBar, ); } diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index 463c55b3b7..c2214dbd38 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -337,7 +337,6 @@ class _MaterialBannerState extends State { return materialBanner; materialBanner = SafeArea( - top: true, child: materialBanner, ); diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index f657695099..7f0999fd14 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -578,14 +578,12 @@ class _Tile extends StatelessWidget { return Align( heightFactor: 1, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [icon, const SizedBox(width: 8), label], ), ); } return Column( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.min, children: [icon, label], diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 82a5a24255..89a2df9433 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -318,7 +318,6 @@ class _ModalBottomSheetLayout extends SingleChildLayoutDelegate { return BoxConstraints( minWidth: constraints.maxWidth, maxWidth: constraints.maxWidth, - minHeight: 0.0, maxHeight: isScrollControlled ? constraints.maxHeight : constraints.maxHeight * 9.0 / 16.0, diff --git a/packages/flutter/lib/src/material/button_bar_theme.dart b/packages/flutter/lib/src/material/button_bar_theme.dart index e26c9ba36a..d1ea3dc5ac 100644 --- a/packages/flutter/lib/src/material/button_bar_theme.dart +++ b/packages/flutter/lib/src/material/button_bar_theme.dart @@ -205,7 +205,6 @@ class ButtonBarThemeData with Diagnosticable { 'buttonAlignedDropdown', value: buttonAlignedDropdown, ifTrue: 'dropdown width matches button', - defaultValue: null, )); properties.add(DiagnosticsProperty('layoutBehavior', layoutBehavior, defaultValue: null)); properties.add(DiagnosticsProperty('overflowDirection', overflowDirection, defaultValue: null)); diff --git a/packages/flutter/lib/src/material/calendar_date_picker.dart b/packages/flutter/lib/src/material/calendar_date_picker.dart index 829a271b4f..6fac69d0c0 100644 --- a/packages/flutter/lib/src/material/calendar_date_picker.dart +++ b/packages/flutter/lib/src/material/calendar_date_picker.dart @@ -789,7 +789,6 @@ class _MonthPickerState extends State<_MonthPicker> { controller: _pageController, itemBuilder: _buildItems, itemCount: DateUtils.monthDelta(widget.firstDate, widget.lastDate) + 1, - scrollDirection: Axis.horizontal, onPageChanged: _handleMonthPageChanged, ), ), @@ -1000,7 +999,7 @@ class _DayPickerState extends State<_DayPicker> { // border. dayColor = todayColor; decoration = BoxDecoration( - border: Border.all(color: todayColor, width: 1), + border: Border.all(color: todayColor), shape: BoxShape.circle, ); } @@ -1207,16 +1206,13 @@ class _YearPickerState extends State { decoration = BoxDecoration( color: colorScheme.primary, borderRadius: BorderRadius.circular(decorationHeight / 2), - shape: BoxShape.rectangle, ); } else if (isCurrentYear && !isDisabled) { decoration = BoxDecoration( border: Border.all( color: colorScheme.primary, - width: 1, ), borderRadius: BorderRadius.circular(decorationHeight / 2), - shape: BoxShape.rectangle, ); } @@ -1241,7 +1237,7 @@ class _YearPickerState extends State { } else { yearItem = InkWell( key: ValueKey(year), - onTap: () => widget.onChanged(DateTime(year, widget.initialDate.month, 1)), + onTap: () => widget.onChanged(DateTime(year, widget.initialDate.month)), child: yearItem, ); } diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index a622703464..296adb6b26 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -634,7 +634,6 @@ class Chip extends StatelessWidget implements ChipAttributes, DeletableChipAttri materialTapTargetSize: materialTapTargetSize, elevation: elevation, shadowColor: shadowColor, - isEnabled: true, ); } } @@ -827,7 +826,6 @@ class InputChip extends StatelessWidget onPressed: onPressed, pressElevation: pressElevation, selected: selected, - tapEnabled: true, disabledColor: disabledColor, selectedColor: selectedColor, tooltip: tooltip, @@ -1013,7 +1011,6 @@ class ChoiceChip extends StatelessWidget pressElevation: pressElevation, selected: selected, showCheckmark: false, - onDeleted: null, tooltip: tooltip, side: side, shape: shape, @@ -1398,7 +1395,6 @@ class ActionChip extends StatelessWidget implements ChipAttributes, TappableChip padding: padding, visualDensity: visualDensity, labelPadding: labelPadding, - isEnabled: true, materialTapTargetSize: materialTapTargetSize, elevation: elevation, shadowColor: shadowColor, @@ -2447,7 +2443,6 @@ class _RenderChip extends RenderBox { final Size updatedSize = layoutChild( label!, BoxConstraints( - minWidth: 0.0, maxWidth: maxWidth, minHeight: rawSize.height, maxHeight: size.height, @@ -2465,7 +2460,6 @@ class _RenderChip extends RenderBox { BoxConstraints( minHeight: rawSize.height, maxHeight: size.height, - minWidth: 0.0, maxWidth: size.width, ), ); @@ -2937,7 +2931,6 @@ class _UnconstrainedInkSplashFactory extends InteractiveInkFeatureFactory { referenceBox: referenceBox, position: position, color: color, - containedInkWell: false, rectCallback: rectCallback, borderRadius: borderRadius, customBorder: customBorder, diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index ddf85c39ea..c219437ced 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -1310,7 +1310,7 @@ class _DateRangePickerDialogState extends State with Rest ); size = mediaQuery.size; insetPadding = EdgeInsets.zero; - shape = const RoundedRectangleBorder(borderRadius: BorderRadius.zero); + shape = const RoundedRectangleBorder(); elevation = 0; break; @@ -2271,7 +2271,7 @@ class _MonthItemState extends State<_MonthItem> { // border. itemStyle = textTheme.bodyText2?.apply(color: colorScheme.primary); decoration = BoxDecoration( - border: Border.all(color: colorScheme.primary, width: 1), + border: Border.all(color: colorScheme.primary), shape: BoxShape.circle, ); } diff --git a/packages/flutter/lib/src/material/date_picker_deprecated.dart b/packages/flutter/lib/src/material/date_picker_deprecated.dart index 488c4d3c3f..09c3b6ffb7 100644 --- a/packages/flutter/lib/src/material/date_picker_deprecated.dart +++ b/packages/flutter/lib/src/material/date_picker_deprecated.dart @@ -547,7 +547,6 @@ class _MonthPickerState extends State with SingleTickerProviderStat dragStartBehavior: widget.dragStartBehavior, key: ValueKey(widget.selectedDate), controller: _dayPickerController, - scrollDirection: Axis.horizontal, itemCount: _monthDelta(widget.firstDate, widget.lastDate) + 1, itemBuilder: _buildItems, onPageChanged: _handleMonthPageChanged, diff --git a/packages/flutter/lib/src/material/drawer.dart b/packages/flutter/lib/src/material/drawer.dart index 727221bed1..98f7bea15c 100644 --- a/packages/flutter/lib/src/material/drawer.dart +++ b/packages/flutter/lib/src/material/drawer.dart @@ -506,7 +506,7 @@ class DrawerControllerState extends State with SingleTickerPro /// /// Typically called by [ScaffoldState.openDrawer]. void open() { - _controller.fling(velocity: 1.0); + _controller.fling(); widget.drawerCallback?.call(true); } @@ -619,7 +619,6 @@ class DrawerControllerState extends State with SingleTickerPro child: Semantics( label: MaterialLocalizations.of(context).modalBarrierDismissLabel, child: MouseRegion( - opaque: true, child: Container( // The drawer's "scrim" color: _scrimColorTween.evaluate(_controller), ), diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index 974ed765a8..b26a5257da 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -360,7 +360,6 @@ class _DropdownMenuRouteLayout extends SingleChildLayoutDelegate { return BoxConstraints( minWidth: width, maxWidth: width, - minHeight: 0.0, maxHeight: maxHeight, ); } @@ -870,7 +869,7 @@ class DropdownButton extends StatefulWidget { this.value, this.hint, this.disabledHint, - this.onChanged, + required this.onChanged, this.onTap, this.elevation = 8, this.style, @@ -1518,7 +1517,7 @@ class DropdownButtonFormField extends FormField { T? value, Widget? hint, Widget? disabledHint, - this.onChanged, + required this.onChanged, VoidCallback? onTap, int elevation = 8, TextStyle? style, diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index cd9b2b6f54..7afb26a158 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -298,7 +298,6 @@ class ElevatedButton extends ButtonStyleButton { padding: scaledPadding, minimumSize: const Size(64, 36), maximumSize: Size.infinite, - side: null, shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))), enabledMouseCursor: SystemMouseCursors.click, disabledMouseCursor: SystemMouseCursors.forbidden, diff --git a/packages/flutter/lib/src/material/grid_tile_bar.dart b/packages/flutter/lib/src/material/grid_tile_bar.dart index 58ddb19766..7df46a5cc8 100644 --- a/packages/flutter/lib/src/material/grid_tile_bar.dart +++ b/packages/flutter/lib/src/material/grid_tile_bar.dart @@ -77,7 +77,6 @@ class GridTileBar extends StatelessWidget { child: IconTheme.merge( data: const IconThemeData(color: Colors.white), child: Row( - crossAxisAlignment: CrossAxisAlignment.center, children: [ if (leading != null) Padding(padding: const EdgeInsetsDirectional.only(end: 8.0), child: leading), diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index a32419928e..2054e2630f 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -405,7 +405,6 @@ class _MaterialState extends State with TickerProviderStateMixin { duration: widget.animationDuration, shape: BoxShape.rectangle, clipBehavior: widget.clipBehavior, - borderRadius: BorderRadius.zero, elevation: widget.elevation, color: ElevationOverlay.applyOverlay(context, backgroundColor!, widget.elevation), shadowColor: widget.shadowColor ?? Theme.of(context).shadowColor, diff --git a/packages/flutter/lib/src/material/mergeable_material.dart b/packages/flutter/lib/src/material/mergeable_material.dart index 6efe962845..0e32e8e694 100644 --- a/packages/flutter/lib/src/material/mergeable_material.dart +++ b/packages/flutter/lib/src/material/mergeable_material.dart @@ -592,7 +592,6 @@ class _MergeableMaterialState extends State with TickerProvid decoration: BoxDecoration( color: (_children[i] as MaterialSlice).color ?? Theme.of(context).cardColor, borderRadius: _borderRadius(i, i == 0, i == _children.length - 1), - shape: BoxShape.rectangle, ), child: Material( type: MaterialType.transparency, diff --git a/packages/flutter/lib/src/material/navigation_rail.dart b/packages/flutter/lib/src/material/navigation_rail.dart index 21031365c0..99ae67dc8d 100644 --- a/packages/flutter/lib/src/material/navigation_rail.dart +++ b/packages/flutter/lib/src/material/navigation_rail.dart @@ -549,7 +549,6 @@ class _RailDestination extends StatelessWidget { width: minWidth, height: minWidth, child: Align( - alignment: Alignment.center, child: themedIcon, ), ); @@ -663,7 +662,6 @@ class _RailDestination extends StatelessWidget { children: [ Material( type: MaterialType.transparency, - clipBehavior: Clip.none, child: InkResponse( onTap: onTap, onHover: (_) {}, diff --git a/packages/flutter/lib/src/material/outlined_button.dart b/packages/flutter/lib/src/material/outlined_button.dart index 5e7b8f3a2d..8fe0db4c3a 100644 --- a/packages/flutter/lib/src/material/outlined_button.dart +++ b/packages/flutter/lib/src/material/outlined_button.dart @@ -272,7 +272,6 @@ class OutlinedButton extends ButtonStyleButton { maximumSize: Size.infinite, side: BorderSide( color: Theme.of(context).colorScheme.onSurface.withOpacity(0.12), - width: 1, ), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))), enabledMouseCursor: SystemMouseCursors.click, diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart index 42dd4b9a57..c0b36e25f1 100644 --- a/packages/flutter/lib/src/material/paginated_data_table.dart +++ b/packages/flutter/lib/src/material/paginated_data_table.dart @@ -416,7 +416,6 @@ class PaginatedDataTableState extends State { value: widget.rowsPerPage, onChanged: widget.onRowsPerPageChanged, style: footerTextStyle, - iconSize: 24.0, ), ), ), diff --git a/packages/flutter/lib/src/material/range_slider.dart b/packages/flutter/lib/src/material/range_slider.dart index 2dcf4d3371..660d7615b0 100644 --- a/packages/flutter/lib/src/material/range_slider.dart +++ b/packages/flutter/lib/src/material/range_slider.dart @@ -814,7 +814,6 @@ class _RenderRangeSlider extends RenderBox with RelayoutWhenSystemFontsChangeMix // (0,0). Rect get _trackRect => _sliderTheme.rangeTrackShape!.getPreferredRect( parentBox: this, - offset: Offset.zero, sliderTheme: _sliderTheme, isDiscrete: false, ); diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart index d661125b8a..6c7d9f66d8 100644 --- a/packages/flutter/lib/src/material/scaffold.dart +++ b/packages/flutter/lib/src/material/scaffold.dart @@ -279,7 +279,7 @@ class ScaffoldMessengerState extends State with TickerProvide Completer(), () { assert(_snackBars.first == controller); - hideCurrentSnackBar(reason: SnackBarClosedReason.hide); + hideCurrentSnackBar(); }, null, // SnackBar doesn't use a builder function so setState() wouldn't rebuild it ); @@ -405,7 +405,7 @@ class ScaffoldMessengerState extends State with TickerProvide Completer(), () { assert(_materialBanners.first == controller); - hideCurrentMaterialBanner(reason: MaterialBannerClosedReason.hide); + hideCurrentMaterialBanner(); }, null, // MaterialBanner doesn't use a builder function so setState() wouldn't rebuild it ); @@ -2067,7 +2067,7 @@ class ScaffoldState extends State with TickerProviderStateMixin, Resto Completer(), () { assert(_snackBars.first == controller); - hideCurrentSnackBar(reason: SnackBarClosedReason.hide); + hideCurrentSnackBar(); }, null, // SnackBar doesn't use a builder function so setState() wouldn't rebuild it ); @@ -2577,8 +2577,6 @@ class ScaffoldState extends State with TickerProviderStateMixin, Resto _previousFloatingActionButtonLocation = _floatingActionButtonLocation; _floatingActionButtonMoveController = AnimationController( vsync: this, - lowerBound: 0.0, - upperBound: 1.0, value: 1.0, duration: kFloatingActionButtonSegue * 2, ); diff --git a/packages/flutter/lib/src/material/shadows.dart b/packages/flutter/lib/src/material/shadows.dart index 8825968704..523dfb6eb6 100644 --- a/packages/flutter/lib/src/material/shadows.dart +++ b/packages/flutter/lib/src/material/shadows.dart @@ -34,32 +34,32 @@ const Map> _elevationToShadow = >{ 1: [ BoxShadow(offset: Offset(0.0, 2.0), blurRadius: 1.0, spreadRadius: -1.0, color: _kKeyUmbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 1.0, spreadRadius: 0.0, color: _kKeyPenumbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 3.0, spreadRadius: 0.0, color: _kAmbientShadowOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 1.0, color: _kKeyPenumbraOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 3.0, color: _kAmbientShadowOpacity), ], 2: [ BoxShadow(offset: Offset(0.0, 3.0), blurRadius: 1.0, spreadRadius: -2.0, color: _kKeyUmbraOpacity), - BoxShadow(offset: Offset(0.0, 2.0), blurRadius: 2.0, spreadRadius: 0.0, color: _kKeyPenumbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 5.0, spreadRadius: 0.0, color: _kAmbientShadowOpacity), + BoxShadow(offset: Offset(0.0, 2.0), blurRadius: 2.0, color: _kKeyPenumbraOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 5.0, color: _kAmbientShadowOpacity), ], 3: [ BoxShadow(offset: Offset(0.0, 3.0), blurRadius: 3.0, spreadRadius: -2.0, color: _kKeyUmbraOpacity), - BoxShadow(offset: Offset(0.0, 3.0), blurRadius: 4.0, spreadRadius: 0.0, color: _kKeyPenumbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 8.0, spreadRadius: 0.0, color: _kAmbientShadowOpacity), + BoxShadow(offset: Offset(0.0, 3.0), blurRadius: 4.0, color: _kKeyPenumbraOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 8.0, color: _kAmbientShadowOpacity), ], 4: [ BoxShadow(offset: Offset(0.0, 2.0), blurRadius: 4.0, spreadRadius: -1.0, color: _kKeyUmbraOpacity), - BoxShadow(offset: Offset(0.0, 4.0), blurRadius: 5.0, spreadRadius: 0.0, color: _kKeyPenumbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 10.0, spreadRadius: 0.0, color: _kAmbientShadowOpacity), + BoxShadow(offset: Offset(0.0, 4.0), blurRadius: 5.0, color: _kKeyPenumbraOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 10.0, color: _kAmbientShadowOpacity), ], 6: [ BoxShadow(offset: Offset(0.0, 3.0), blurRadius: 5.0, spreadRadius: -1.0, color: _kKeyUmbraOpacity), - BoxShadow(offset: Offset(0.0, 6.0), blurRadius: 10.0, spreadRadius: 0.0, color: _kKeyPenumbraOpacity), - BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 18.0, spreadRadius: 0.0, color: _kAmbientShadowOpacity), + BoxShadow(offset: Offset(0.0, 6.0), blurRadius: 10.0, color: _kKeyPenumbraOpacity), + BoxShadow(offset: Offset(0.0, 1.0), blurRadius: 18.0, color: _kAmbientShadowOpacity), ], 8: [ diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index 5c19812dfb..515cc49d3c 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -947,7 +947,6 @@ class _RenderSlider extends RenderBox with RelayoutWhenSystemFontsChangeMixin { // (0,0). Rect get _trackRect => _sliderTheme.trackShape!.getPreferredRect( parentBox: this, - offset: Offset.zero, sliderTheme: _sliderTheme, isDiscrete: false, ); diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index a88ee9d8bc..8b860e766b 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -489,7 +489,6 @@ class _SnackBarState extends State { Widget snackBar = Padding( padding: padding, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Container( diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 7ff22a687e..34023dfd53 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -124,7 +124,6 @@ class Tab extends StatelessWidget implements PreferredSizeWidget { calculatedHeight = _kTextAndIconTabHeight; label = Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( margin: iconMargin, diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 8b5cdab64e..fb3aa74024 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -286,7 +286,6 @@ class TextButton extends ButtonStyleButton { padding: scaledPadding, minimumSize: const Size(64, 36), maximumSize: Size.infinite, - side: null, shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(4))), enabledMouseCursor: SystemMouseCursors.click, disabledMouseCursor: SystemMouseCursors.forbidden, diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index e755bda89a..a7839c0cac 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -284,12 +284,12 @@ class Tooltip extends StatefulWidget { properties.add(DiagnosticsProperty('padding', padding, defaultValue: null)); properties.add(DiagnosticsProperty('margin', margin, defaultValue: null)); properties.add(DoubleProperty('vertical offset', verticalOffset, defaultValue: null)); - properties.add(FlagProperty('position', value: preferBelow, ifTrue: 'below', ifFalse: 'above', showName: true, defaultValue: null)); - properties.add(FlagProperty('semantics', value: excludeFromSemantics, ifTrue: 'excluded', showName: true, defaultValue: null)); + properties.add(FlagProperty('position', value: preferBelow, ifTrue: 'below', ifFalse: 'above', showName: true)); + properties.add(FlagProperty('semantics', value: excludeFromSemantics, ifTrue: 'excluded', showName: true)); properties.add(DiagnosticsProperty('wait duration', waitDuration, defaultValue: null)); properties.add(DiagnosticsProperty('show duration', showDuration, defaultValue: null)); properties.add(DiagnosticsProperty('triggerMode', triggerMode, defaultValue: null)); - properties.add(FlagProperty('enableFeedback', value: enableFeedback, ifTrue: 'true', showName: true, defaultValue: null)); + properties.add(FlagProperty('enableFeedback', value: enableFeedback, ifTrue: 'true', showName: true)); } } diff --git a/packages/flutter/lib/src/material/tooltip_theme.dart b/packages/flutter/lib/src/material/tooltip_theme.dart index 5fb34ea8a6..dfb5a61a8b 100644 --- a/packages/flutter/lib/src/material/tooltip_theme.dart +++ b/packages/flutter/lib/src/material/tooltip_theme.dart @@ -201,14 +201,14 @@ class TooltipThemeData with Diagnosticable { properties.add(DiagnosticsProperty('padding', padding, defaultValue: null)); properties.add(DiagnosticsProperty('margin', margin, defaultValue: null)); properties.add(DoubleProperty('vertical offset', verticalOffset, defaultValue: null)); - properties.add(FlagProperty('position', value: preferBelow, ifTrue: 'below', ifFalse: 'above', showName: true, defaultValue: null)); - properties.add(FlagProperty('semantics', value: excludeFromSemantics, ifTrue: 'excluded', showName: true, defaultValue: null)); + properties.add(FlagProperty('position', value: preferBelow, ifTrue: 'below', ifFalse: 'above', showName: true)); + properties.add(FlagProperty('semantics', value: excludeFromSemantics, ifTrue: 'excluded', showName: true)); properties.add(DiagnosticsProperty('decoration', decoration, defaultValue: null)); properties.add(DiagnosticsProperty('textStyle', textStyle, defaultValue: null)); properties.add(DiagnosticsProperty('wait duration', waitDuration, defaultValue: null)); properties.add(DiagnosticsProperty('show duration', showDuration, defaultValue: null)); properties.add(DiagnosticsProperty('triggerMode', triggerMode, defaultValue: null)); - properties.add(FlagProperty('enableFeedback', value: enableFeedback, ifTrue: 'true', showName: true, defaultValue: null)); + properties.add(FlagProperty('enableFeedback', value: enableFeedback, ifTrue: 'true', showName: true)); } } diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart index f3dd903dab..cf44598e70 100644 --- a/packages/flutter/lib/src/material/typography.dart +++ b/packages/flutter/lib/src/material/typography.dart @@ -332,76 +332,76 @@ class Typography with Diagnosticable { /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme blackMountainView = TextTheme( - headline1 : TextStyle(debugLabel: 'blackMountainView headline1', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'blackMountainView headline2', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'blackMountainView headline3', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'blackMountainView headline4', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'blackMountainView headline5', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'blackMountainView headline6', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'blackMountainView bodyText1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'blackMountainView bodyText2', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'blackMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'blackMountainView subtitle2', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'blackMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'blackMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'blackMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'blackMountainView headline1', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'blackMountainView headline2', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'blackMountainView headline3', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'blackMountainView headline4', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'blackMountainView headline5', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'blackMountainView headline6', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'blackMountainView bodyText1', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'blackMountainView bodyText2', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'blackMountainView subtitle1', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackMountainView subtitle2', fontFamily: 'Roboto', color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackMountainView caption', fontFamily: 'Roboto', color: Colors.black54, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'blackMountainView button', fontFamily: 'Roboto', color: Colors.black87, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'blackMountainView overline', fontFamily: 'Roboto', color: Colors.black, decoration: TextDecoration.none), ); /// A material design text theme with light glyphs based on Roboto. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme whiteMountainView = TextTheme( - headline1 : TextStyle(debugLabel: 'whiteMountainView headline1', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'whiteMountainView headline2', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'whiteMountainView headline3', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'whiteMountainView headline4', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'whiteMountainView headline5', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'whiteMountainView headline6', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'whiteMountainView bodyText1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'whiteMountainView bodyText2', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'whiteMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'whiteMountainView subtitle2', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'whiteMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'whiteMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'whiteMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteMountainView headline1', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'whiteMountainView headline2', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'whiteMountainView headline3', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'whiteMountainView headline4', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'whiteMountainView headline5', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'whiteMountainView headline6', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'whiteMountainView bodyText1', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'whiteMountainView bodyText2', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'whiteMountainView subtitle1', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteMountainView subtitle2', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'whiteMountainView caption', fontFamily: 'Roboto', color: Colors.white70, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'whiteMountainView button', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'whiteMountainView overline', fontFamily: 'Roboto', color: Colors.white, decoration: TextDecoration.none), ); /// A material design text theme with dark glyphs based on Segoe UI. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme blackRedmond = TextTheme( - headline1 : TextStyle(debugLabel: 'blackRedmond headline1', fontFamily: 'Segoe UI', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'blackRedmond headline2', fontFamily: 'Segoe UI', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'blackRedmond headline3', fontFamily: 'Segoe UI', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'blackRedmond headline4', fontFamily: 'Segoe UI', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'blackRedmond headline5', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'blackRedmond headline6', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'blackRedmond bodyText1', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'blackRedmond bodyText2', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'blackRedmond subtitle1', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'blackRedmond subtitle2', fontFamily: 'Segoe UI', inherit: true, color: Colors.black, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'blackRedmond caption', fontFamily: 'Segoe UI', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'blackRedmond button', fontFamily: 'Segoe UI', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'blackRedmond overline', fontFamily: 'Segoe UI', inherit: true, color: Colors.black, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'blackRedmond headline1', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'blackRedmond headline2', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'blackRedmond headline3', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'blackRedmond headline4', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'blackRedmond headline5', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'blackRedmond headline6', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'blackRedmond bodyText1', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'blackRedmond bodyText2', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'blackRedmond subtitle1', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackRedmond subtitle2', fontFamily: 'Segoe UI', color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackRedmond caption', fontFamily: 'Segoe UI', color: Colors.black54, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'blackRedmond button', fontFamily: 'Segoe UI', color: Colors.black87, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'blackRedmond overline', fontFamily: 'Segoe UI', color: Colors.black, decoration: TextDecoration.none), ); /// A material design text theme with light glyphs based on Segoe UI. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme whiteRedmond = TextTheme( - headline1 : TextStyle(debugLabel: 'whiteRedmond headline1', fontFamily: 'Segoe UI', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'whiteRedmond headline2', fontFamily: 'Segoe UI', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'whiteRedmond headline3', fontFamily: 'Segoe UI', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'whiteRedmond headline4', fontFamily: 'Segoe UI', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'whiteRedmond headline5', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'whiteRedmond headline6', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'whiteRedmond bodyText1', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'whiteRedmond bodyText2', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'whiteRedmond subtitle1', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'whiteRedmond subtitle2', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'whiteRedmond caption', fontFamily: 'Segoe UI', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'whiteRedmond button', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'whiteRedmond overline', fontFamily: 'Segoe UI', inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteRedmond headline1', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'whiteRedmond headline2', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'whiteRedmond headline3', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'whiteRedmond headline4', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'whiteRedmond headline5', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'whiteRedmond headline6', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'whiteRedmond bodyText1', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'whiteRedmond bodyText2', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'whiteRedmond subtitle1', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteRedmond subtitle2', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'whiteRedmond caption', fontFamily: 'Segoe UI', color: Colors.white70, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'whiteRedmond button', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'whiteRedmond overline', fontFamily: 'Segoe UI', color: Colors.white, decoration: TextDecoration.none), ); static const List _helsinkiFontFallbacks = ['Ubuntu', 'Cantarell', 'DejaVu Sans', 'Liberation Sans', 'Arial']; @@ -411,38 +411,38 @@ class Typography with Diagnosticable { /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme blackHelsinki = TextTheme( - headline1 : TextStyle(debugLabel: 'blackHelsinki headline1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'blackHelsinki headline2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'blackHelsinki headline3', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'blackHelsinki headline4', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'blackHelsinki headline5', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'blackHelsinki headline6', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'blackHelsinki bodyText1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'blackHelsinki bodyText2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'blackHelsinki subtitle1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'blackHelsinki subtitle2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'blackHelsinki caption', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black54, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'blackHelsinki button', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black87, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'blackHelsinki overline', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.black, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'blackHelsinki headline1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'blackHelsinki headline2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'blackHelsinki headline3', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'blackHelsinki headline4', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'blackHelsinki headline5', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'blackHelsinki headline6', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'blackHelsinki bodyText1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'blackHelsinki bodyText2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'blackHelsinki subtitle1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackHelsinki subtitle2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackHelsinki caption', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black54, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'blackHelsinki button', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black87, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'blackHelsinki overline', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.black, decoration: TextDecoration.none), ); /// A material design text theme with light glyphs based on Roboto, with fallbacks of DejaVu Sans, Liberation Sans and Arial. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme whiteHelsinki = TextTheme( - headline1 : TextStyle(debugLabel: 'whiteHelsinki headline1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'whiteHelsinki headline2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'whiteHelsinki headline3', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'whiteHelsinki headline4', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'whiteHelsinki headline5', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'whiteHelsinki headline6', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'whiteHelsinki bodyText1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'whiteHelsinki bodyText2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'whiteHelsinki subtitle1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'whiteHelsinki subtitle2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'whiteHelsinki caption', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white70, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'whiteHelsinki button', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'whiteHelsinki overline', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteHelsinki headline1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'whiteHelsinki headline2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'whiteHelsinki headline3', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'whiteHelsinki headline4', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'whiteHelsinki headline5', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'whiteHelsinki headline6', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'whiteHelsinki bodyText1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'whiteHelsinki bodyText2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'whiteHelsinki subtitle1', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteHelsinki subtitle2', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'whiteHelsinki caption', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white70, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'whiteHelsinki button', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'whiteHelsinki overline', fontFamily: 'Roboto', fontFamilyFallback: _helsinkiFontFallbacks, color: Colors.white, decoration: TextDecoration.none), ); /// A material design text theme with dark glyphs based on San Francisco. @@ -451,19 +451,19 @@ class Typography with Diagnosticable { /// /// This theme uses the iOS version of the font names. static const TextTheme blackCupertino = TextTheme( - headline1 : TextStyle(debugLabel: 'blackCupertino headline1', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'blackCupertino headline2', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'blackCupertino headline3', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'blackCupertino headline4', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'blackCupertino headline5', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'blackCupertino headline6', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'blackCupertino bodyText1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'blackCupertino bodyText2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'blackCupertino subtitle1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'blackCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'blackCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'blackCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'blackCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'blackCupertino headline1', fontFamily: '.SF UI Display', color: Colors.black54, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'blackCupertino headline2', fontFamily: '.SF UI Display', color: Colors.black54, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'blackCupertino headline3', fontFamily: '.SF UI Display', color: Colors.black54, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'blackCupertino headline4', fontFamily: '.SF UI Display', color: Colors.black54, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'blackCupertino headline5', fontFamily: '.SF UI Display', color: Colors.black87, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'blackCupertino headline6', fontFamily: '.SF UI Display', color: Colors.black87, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'blackCupertino bodyText1', fontFamily: '.SF UI Text', color: Colors.black87, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'blackCupertino bodyText2', fontFamily: '.SF UI Text', color: Colors.black87, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'blackCupertino subtitle1', fontFamily: '.SF UI Text', color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackCupertino subtitle2', fontFamily: '.SF UI Text', color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackCupertino caption', fontFamily: '.SF UI Text', color: Colors.black54, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'blackCupertino button', fontFamily: '.SF UI Text', color: Colors.black87, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'blackCupertino overline', fontFamily: '.SF UI Text', color: Colors.black, decoration: TextDecoration.none), ); /// A material design text theme with light glyphs based on San Francisco. @@ -472,19 +472,19 @@ class Typography with Diagnosticable { /// /// This theme uses the iOS version of the font names. static const TextTheme whiteCupertino = TextTheme( - headline1 : TextStyle(debugLabel: 'whiteCupertino headline1', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'whiteCupertino headline2', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'whiteCupertino headline3', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'whiteCupertino headline4', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'whiteCupertino headline5', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'whiteCupertino headline6', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'whiteCupertino subtitle1', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'whiteCupertino bodyText1', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'whiteCupertino bodyText2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'whiteCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'whiteCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'whiteCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteCupertino headline1', fontFamily: '.SF UI Display', color: Colors.white70, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'whiteCupertino headline2', fontFamily: '.SF UI Display', color: Colors.white70, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'whiteCupertino headline3', fontFamily: '.SF UI Display', color: Colors.white70, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'whiteCupertino headline4', fontFamily: '.SF UI Display', color: Colors.white70, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'whiteCupertino headline5', fontFamily: '.SF UI Display', color: Colors.white, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'whiteCupertino headline6', fontFamily: '.SF UI Display', color: Colors.white, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'whiteCupertino subtitle1', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'whiteCupertino bodyText1', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'whiteCupertino bodyText2', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'whiteCupertino caption', fontFamily: '.SF UI Text', color: Colors.white70, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'whiteCupertino button', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteCupertino subtitle2', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', color: Colors.white, decoration: TextDecoration.none), ); /// A material design text theme with dark glyphs based on San Francisco. @@ -493,19 +493,19 @@ class Typography with Diagnosticable { /// /// This theme uses the macOS version of the font names. static const TextTheme blackRedwoodCity = TextTheme( - headline1 : TextStyle(debugLabel: 'blackRedwoodCity headline1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'blackRedwoodCity headline2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'blackRedwoodCity headline3', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'blackRedwoodCity headline4', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'blackRedwoodCity headline5', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'blackRedwoodCity headline6', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'blackRedwoodCity bodyText1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'blackRedwoodCity bodyText2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'blackRedwoodCity subtitle1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'blackRedwoodCity subtitle2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'blackRedwoodCity caption', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black54, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'blackRedwoodCity button', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'blackRedwoodCity overline', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.black, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'blackRedwoodCity headline1', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'blackRedwoodCity headline2', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'blackRedwoodCity headline3', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'blackRedwoodCity headline4', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'blackRedwoodCity headline5', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'blackRedwoodCity headline6', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'blackRedwoodCity bodyText1', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'blackRedwoodCity bodyText2', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'blackRedwoodCity subtitle1', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackRedwoodCity subtitle2', fontFamily: '.AppleSystemUIFont', color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackRedwoodCity caption', fontFamily: '.AppleSystemUIFont', color: Colors.black54, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'blackRedwoodCity button', fontFamily: '.AppleSystemUIFont', color: Colors.black87, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'blackRedwoodCity overline', fontFamily: '.AppleSystemUIFont', color: Colors.black, decoration: TextDecoration.none), ); /// A material design text theme with light glyphs based on San Francisco. @@ -514,19 +514,19 @@ class Typography with Diagnosticable { /// /// This theme uses the macOS version of the font names. static const TextTheme whiteRedwoodCity = TextTheme( - headline1 : TextStyle(debugLabel: 'whiteRedwoodCity headline1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline2 : TextStyle(debugLabel: 'whiteRedwoodCity headline2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline3 : TextStyle(debugLabel: 'whiteRedwoodCity headline3', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline4 : TextStyle(debugLabel: 'whiteRedwoodCity headline4', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - headline5 : TextStyle(debugLabel: 'whiteRedwoodCity headline5', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - headline6 : TextStyle(debugLabel: 'whiteRedwoodCity headline6', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle1 : TextStyle(debugLabel: 'whiteRedwoodCity subtitle1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText1 : TextStyle(debugLabel: 'whiteRedwoodCity bodyText1', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - bodyText2 : TextStyle(debugLabel: 'whiteRedwoodCity bodyText2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - caption : TextStyle(debugLabel: 'whiteRedwoodCity caption', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white70, decoration: TextDecoration.none), - button : TextStyle(debugLabel: 'whiteRedwoodCity button', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle2 : TextStyle(debugLabel: 'whiteRedwoodCity subtitle2', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), - overline : TextStyle(debugLabel: 'whiteRedwoodCity overline', fontFamily: '.AppleSystemUIFont', inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteRedwoodCity headline1', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), + headline2 : TextStyle(debugLabel: 'whiteRedwoodCity headline2', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), + headline3 : TextStyle(debugLabel: 'whiteRedwoodCity headline3', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), + headline4 : TextStyle(debugLabel: 'whiteRedwoodCity headline4', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), + headline5 : TextStyle(debugLabel: 'whiteRedwoodCity headline5', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + headline6 : TextStyle(debugLabel: 'whiteRedwoodCity headline6', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + subtitle1 : TextStyle(debugLabel: 'whiteRedwoodCity subtitle1', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + bodyText1 : TextStyle(debugLabel: 'whiteRedwoodCity bodyText1', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + bodyText2 : TextStyle(debugLabel: 'whiteRedwoodCity bodyText2', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'whiteRedwoodCity caption', fontFamily: '.AppleSystemUIFont', color: Colors.white70, decoration: TextDecoration.none), + button : TextStyle(debugLabel: 'whiteRedwoodCity button', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteRedwoodCity subtitle2', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), + overline : TextStyle(debugLabel: 'whiteRedwoodCity overline', fontFamily: '.AppleSystemUIFont', color: Colors.white, decoration: TextDecoration.none), ); /// Defines text geometry for [ScriptCategory.englishLike] scripts, such as diff --git a/packages/flutter/lib/src/painting/borders.dart b/packages/flutter/lib/src/painting/borders.dart index df016a24d9..a51ebda0f3 100644 --- a/packages/flutter/lib/src/painting/borders.dart +++ b/packages/flutter/lib/src/painting/borders.dart @@ -246,7 +246,6 @@ class BorderSide { return BorderSide( color: Color.lerp(colorA, colorB, t)!, width: width, - style: BorderStyle.solid, ); } diff --git a/packages/flutter/lib/src/painting/notched_shapes.dart b/packages/flutter/lib/src/painting/notched_shapes.dart index 3f17c7f76e..e70c898e31 100644 --- a/packages/flutter/lib/src/painting/notched_shapes.dart +++ b/packages/flutter/lib/src/painting/notched_shapes.dart @@ -85,7 +85,7 @@ class CircularNotchedRectangle extends NotchedShape { final double p2yA = math.sqrt(r * r - p2xA * p2xA); final double p2yB = math.sqrt(r * r - p2xB * p2xB); - final List p = List.filled(6, null, growable: false); + final List p = List.filled(6, null); // p0, p1, and p2 are the control points for segment A. p[0] = Offset(a - s1, b); diff --git a/packages/flutter/lib/src/painting/strut_style.dart b/packages/flutter/lib/src/painting/strut_style.dart index 72233480ae..df675ba046 100644 --- a/packages/flutter/lib/src/painting/strut_style.dart +++ b/packages/flutter/lib/src/painting/strut_style.dart @@ -616,7 +616,7 @@ class StrutStyle with Diagnosticable { )); styles.add(EnumProperty('${prefix}style', fontStyle, defaultValue: null)); styles.add(DoubleProperty('${prefix}height', height, unit: 'x', defaultValue: null)); - styles.add(FlagProperty('${prefix}forceStrutHeight', value: forceStrutHeight, defaultValue: null, ifTrue: '$prefix', ifFalse: '$prefix')); + styles.add(FlagProperty('${prefix}forceStrutHeight', value: forceStrutHeight, ifTrue: '$prefix', ifFalse: '$prefix')); final bool styleSpecified = styles.any((DiagnosticsNode n) => !n.isFiltered(DiagnosticLevel.info)); styles.forEach(properties.add); diff --git a/packages/flutter/lib/src/rendering/binding.dart b/packages/flutter/lib/src/rendering/binding.dart index f627960b84..347f25a5f9 100644 --- a/packages/flutter/lib/src/rendering/binding.dart +++ b/packages/flutter/lib/src/rendering/binding.dart @@ -128,7 +128,7 @@ mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, Gesture name: 'debugDumpSemanticsTreeInTraversalOrder', callback: (Map parameters) async { final String data = RendererBinding.instance?.renderView.debugSemantics - ?.toStringDeep(childOrder: DebugSemanticsDumpOrder.traversalOrder) ?? 'Semantics not collected.'; + ?.toStringDeep() ?? 'Semantics not collected.'; return { 'data': data, }; diff --git a/packages/flutter/lib/src/rendering/box.dart b/packages/flutter/lib/src/rendering/box.dart index 84c6dcf6ba..6b82436270 100644 --- a/packages/flutter/lib/src/rendering/box.dart +++ b/packages/flutter/lib/src/rendering/box.dart @@ -202,9 +202,7 @@ class BoxConstraints extends Constraints { BoxConstraints loosen() { assert(debugAssertIsValid()); return BoxConstraints( - minWidth: 0.0, maxWidth: maxWidth, - minHeight: 0.0, maxHeight: maxHeight, ); } diff --git a/packages/flutter/lib/src/rendering/custom_layout.dart b/packages/flutter/lib/src/rendering/custom_layout.dart index 2cec520e98..a8ee908128 100644 --- a/packages/flutter/lib/src/rendering/custom_layout.dart +++ b/packages/flutter/lib/src/rendering/custom_layout.dart @@ -248,7 +248,6 @@ abstract class MultiChildLayoutDelegate { 'to lay out the following ' '${_debugChildrenNeedingLayout!.length > 1 ? 'children' : 'child'}', properties: _debugChildrenNeedingLayout!.map(_debugDescribeChild).toList(), - style: DiagnosticsTreeStyle.whitespace, ), ]); } diff --git a/packages/flutter/lib/src/rendering/custom_paint.dart b/packages/flutter/lib/src/rendering/custom_paint.dart index 9eb1b71cf3..0339fc2585 100644 --- a/packages/flutter/lib/src/rendering/custom_paint.dart +++ b/packages/flutter/lib/src/rendering/custom_paint.dart @@ -739,7 +739,7 @@ class RenderCustomPaint extends RenderProxyBox { int newChildrenBottom = newChildSemantics.length - 1; int oldChildrenBottom = oldSemantics.length - 1; - final List newChildren = List.filled(newChildSemantics.length, null, growable: false); + final List newChildren = List.filled(newChildSemantics.length, null); // Update the top of the list. while ((oldChildrenTop <= oldChildrenBottom) && (newChildrenTop <= newChildrenBottom)) { diff --git a/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart b/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart index 1ba09530d1..e6fbde2012 100644 --- a/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart +++ b/packages/flutter/lib/src/rendering/debug_overflow_indicator.dart @@ -176,7 +176,6 @@ mixin DebugOverflowIndicatorMixin on RenderObject { rect: markerRect, label: 'TOP OVERFLOWED BY ${_formatPixels(overflow.top)} PIXELS', labelOffset: markerRect.topCenter + const Offset(0.0, _indicatorLabelPaddingPixels), - rotation: 0.0, side: _OverflowSide.top, )); } @@ -192,7 +191,6 @@ mixin DebugOverflowIndicatorMixin on RenderObject { label: 'BOTTOM OVERFLOWED BY ${_formatPixels(overflow.bottom)} PIXELS', labelOffset: markerRect.bottomCenter - const Offset(0.0, _indicatorFontSizePixels + _indicatorLabelPaddingPixels), - rotation: 0.0, side: _OverflowSide.bottom, )); } diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index 99ab8ab07d..17d7414894 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -1598,13 +1598,13 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, @override double computeMinIntrinsicWidth(double height) { - _layoutText(maxWidth: double.infinity); + _layoutText(); return _textPainter.minIntrinsicWidth; } @override double computeMaxIntrinsicWidth(double height) { - _layoutText(maxWidth: double.infinity); + _layoutText(); return _textPainter.maxIntrinsicWidth + _caretMargin; } @@ -1881,7 +1881,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, final TextRange word = _textPainter.getWordBoundary(position); late TextSelection newSelection; if (position.offset - word.start <= 1) { - newSelection = TextSelection.collapsed(offset: word.start, affinity: TextAffinity.downstream); + newSelection = TextSelection.collapsed(offset: word.start); } else { newSelection = TextSelection.collapsed(offset: word.end, affinity: TextAffinity.upstream); } @@ -1966,7 +1966,7 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin, return []; } RenderBox? child = firstChild; - final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty, growable: false); + final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty); int childIndex = 0; // Only constrain the width to the maximum width of the paragraph. // Leave height unconstrained, which will overflow if expanded past. diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index d60c8b684c..da3929a197 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -207,10 +207,7 @@ class PaintingContext extends ClipContext { } else { assert(() { // register the call for RepaintBoundary metrics - child.debugRegisterRepaintBoundaryPaint( - includedParent: true, - includedChild: false, - ); + child.debugRegisterRepaintBoundaryPaint(); child._layerHandle.layer!.debugCreator = child.debugCreator ?? child; return true; }()); diff --git a/packages/flutter/lib/src/rendering/paragraph.dart b/packages/flutter/lib/src/rendering/paragraph.dart index 69a519bb77..493b397630 100644 --- a/packages/flutter/lib/src/rendering/paragraph.dart +++ b/packages/flutter/lib/src/rendering/paragraph.dart @@ -380,7 +380,7 @@ class RenderParagraph extends RenderBox void _computeChildrenWidthWithMaxIntrinsics(double height) { RenderBox? child = firstChild; - final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty, growable: false); + final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty); int childIndex = 0; while (child != null) { // Height and baseline is irrelevant as all text will be laid @@ -398,7 +398,7 @@ class RenderParagraph extends RenderBox void _computeChildrenWidthWithMinIntrinsics(double height) { RenderBox? child = firstChild; - final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty, growable: false); + final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty); int childIndex = 0; while (child != null) { // Height and baseline is irrelevant; only looking for the widest word or @@ -416,7 +416,7 @@ class RenderParagraph extends RenderBox void _computeChildrenHeightWithMinIntrinsics(double width) { RenderBox? child = firstChild; - final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty, growable: false); + final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty); int childIndex = 0; // Takes textScaleFactor into account because the content of the placeholder // span will be scaled up when it paints. @@ -530,7 +530,7 @@ class RenderParagraph extends RenderBox return []; } RenderBox? child = firstChild; - final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty, growable: false); + final List placeholderDimensions = List.filled(childCount, PlaceholderDimensions.empty); int childIndex = 0; // Only constrain the width to the maximum width of the paragraph. // Leave height unconstrained, which will overflow if expanded past. diff --git a/packages/flutter/lib/src/rendering/sliver_list.dart b/packages/flutter/lib/src/rendering/sliver_list.dart index 9c0533e03c..921c436b50 100644 --- a/packages/flutter/lib/src/rendering/sliver_list.dart +++ b/packages/flutter/lib/src/rendering/sliver_list.dart @@ -270,7 +270,6 @@ class RenderSliverList extends RenderSliverMultiBoxAdaptor { final double extent = childScrollOffset(lastChild!)! + paintExtentOf(lastChild!); geometry = SliverGeometry( scrollExtent: extent, - paintExtent: 0.0, maxPaintExtent: extent, ); return; diff --git a/packages/flutter/lib/src/rendering/table.dart b/packages/flutter/lib/src/rendering/table.dart index ec6f148999..7104a82602 100644 --- a/packages/flutter/lib/src/rendering/table.dart +++ b/packages/flutter/lib/src/rendering/table.dart @@ -369,7 +369,7 @@ class RenderTable extends RenderBox { int? columns, int? rows, Map? columnWidths, - TableColumnWidth defaultColumnWidth = const FlexColumnWidth(1.0), + TableColumnWidth defaultColumnWidth = const FlexColumnWidth(), required TextDirection textDirection, TableBorder? border, List? rowDecorations, @@ -418,7 +418,7 @@ class RenderTable extends RenderBox { final int oldColumns = columns; final List oldChildren = _children; _columns = value; - _children = List.filled(columns * rows, null, growable: false); + _children = List.filled(columns * rows, null); final int columnsToCopy = math.min(columns, oldColumns); for (int y = 0; y < rows; y += 1) { for (int x = 0; x < columnsToCopy; x += 1) @@ -543,7 +543,7 @@ class RenderTable extends RenderBox { for (final BoxPainter? painter in _rowDecorationPainters!) painter?.dispose(); } - _rowDecorationPainters = _rowDecorations != null ? List.filled(_rowDecorations!.length, null, growable: false) : null; + _rowDecorationPainters = _rowDecorations != null ? List.filled(_rowDecorations!.length, null) : null; } /// The settings to pass to the [rowDecorations] when painting, so that they @@ -719,7 +719,7 @@ class RenderTable extends RenderBox { if (_rowDecorationPainters != null) { for (final BoxPainter? painter in _rowDecorationPainters!) painter?.dispose(); - _rowDecorationPainters = List.filled(_rowDecorations!.length, null, growable: false); + _rowDecorationPainters = List.filled(_rowDecorations!.length, null); } for (final RenderBox? child in _children) child?.detach(); @@ -832,9 +832,9 @@ class RenderTable extends RenderBox { // necessary, applying minimum column widths as we go // 1. apply ideal widths, and collect information we'll need later - final List widths = List.filled(columns, 0.0, growable: false); - final List minWidths = List.filled(columns, 0.0, growable: false); - final List flexes = List.filled(columns, null, growable: false); + final List widths = List.filled(columns, 0.0); + final List minWidths = List.filled(columns, 0.0); + final List flexes = List.filled(columns, null); double tableWidth = 0.0; // running tally of the sum of widths[x] for all x double unflexedTableWidth = 0.0; // sum of the maxIntrinsicWidths of any column that has null flex double totalFlex = 0.0; @@ -1050,7 +1050,7 @@ class RenderTable extends RenderBox { return; } final List widths = _computeColumnWidths(constraints); - final List positions = List.filled(columns, 0.0, growable: false); + final List positions = List.filled(columns, 0.0); final double tableWidth; switch (textDirection) { case TextDirection.rtl: @@ -1078,7 +1078,7 @@ class RenderTable extends RenderBox { bool haveBaseline = false; double beforeBaselineDistance = 0.0; double afterBaselineDistance = 0.0; - final List baselines = List.filled(columns, 0.0, growable: false); + final List baselines = List.filled(columns, 0.0); for (int x = 0; x < columns; x += 1) { final int xy = x + y * columns; final RenderBox? child = _children[xy]; diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index 006b5acb86..c95e997cc4 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -254,9 +254,9 @@ class LogicalKeyboardKey extends KeyboardKey { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.add(StringProperty('keyId', '0x${keyId.toRadixString(16).padLeft(8, '0')}', showName: true)); - properties.add(StringProperty('keyLabel', keyLabel, showName: true)); - properties.add(StringProperty('debugName', debugName, showName: true, defaultValue: null)); + properties.add(StringProperty('keyId', '0x${keyId.toRadixString(16).padLeft(8, '0')}')); + properties.add(StringProperty('keyLabel', keyLabel)); + properties.add(StringProperty('debugName', debugName, defaultValue: null)); } /// Mask for the 32-bit value portion of the key code. @@ -3552,8 +3552,8 @@ class PhysicalKeyboardKey extends KeyboardKey { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.add(StringProperty('usbHidUsage', '0x${usbHidUsage.toRadixString(16).padLeft(8, '0')}', showName: true)); - properties.add(StringProperty('debugName', debugName, showName: true, defaultValue: null)); + properties.add(StringProperty('usbHidUsage', '0x${usbHidUsage.toRadixString(16).padLeft(8, '0')}')); + properties.add(StringProperty('debugName', debugName, defaultValue: null)); } // Key constants for all keyboard keys in the USB HID specification at the diff --git a/packages/flutter/lib/src/services/message_codecs.dart b/packages/flutter/lib/src/services/message_codecs.dart index df5cab241b..41a8dabb72 100644 --- a/packages/flutter/lib/src/services/message_codecs.dart +++ b/packages/flutter/lib/src/services/message_codecs.dart @@ -478,7 +478,7 @@ class StandardMessageCodec implements MessageCodec { return buffer.getFloat64List(length); case _valueList: final int length = readSize(buffer); - final List result = List.filled(length, null, growable: false); + final List result = List.filled(length, null); for (int i = 0; i < length; i++) result[i] = readValue(buffer); return result; diff --git a/packages/flutter/lib/src/services/platform_channel.dart b/packages/flutter/lib/src/services/platform_channel.dart index f6a4d792b5..9176c31df3 100644 --- a/packages/flutter/lib/src/services/platform_channel.dart +++ b/packages/flutter/lib/src/services/platform_channel.dart @@ -411,7 +411,7 @@ class MethodChannel { } on MissingPluginException { return null; } catch (e) { - return codec.encodeErrorEnvelope(code: 'error', message: e.toString(), details: null); + return codec.encodeErrorEnvelope(code: 'error', message: e.toString()); } } diff --git a/packages/flutter/lib/src/services/raw_keyboard.dart b/packages/flutter/lib/src/services/raw_keyboard.dart index e99f28b464..d04e592dd4 100644 --- a/packages/flutter/lib/src/services/raw_keyboard.dart +++ b/packages/flutter/lib/src/services/raw_keyboard.dart @@ -142,25 +142,25 @@ abstract class RawKeyEventData with Diagnosticable { /// regardless of which side of the keyboard it is on. /// /// Use [isModifierPressed] if you need to know which control key was pressed. - bool get isControlPressed => isModifierPressed(ModifierKey.controlModifier, side: KeyboardSide.any); + bool get isControlPressed => isModifierPressed(ModifierKey.controlModifier); /// Returns true if a SHIFT modifier key was pressed at the time of this /// event, regardless of which side of the keyboard it is on. /// /// Use [isModifierPressed] if you need to know which shift key was pressed. - bool get isShiftPressed => isModifierPressed(ModifierKey.shiftModifier, side: KeyboardSide.any); + bool get isShiftPressed => isModifierPressed(ModifierKey.shiftModifier); /// Returns true if a ALT modifier key was pressed at the time of this event, /// regardless of which side of the keyboard it is on. /// /// Use [isModifierPressed] if you need to know which alt key was pressed. - bool get isAltPressed => isModifierPressed(ModifierKey.altModifier, side: KeyboardSide.any); + bool get isAltPressed => isModifierPressed(ModifierKey.altModifier); /// Returns true if a META modifier key was pressed at the time of this event, /// regardless of which side of the keyboard it is on. /// /// Use [isModifierPressed] if you need to know which meta key was pressed. - bool get isMetaPressed => isModifierPressed(ModifierKey.metaModifier, side: KeyboardSide.any); + bool get isMetaPressed => isModifierPressed(ModifierKey.metaModifier); /// Returns a map of modifier keys that were pressed at the time of this /// event, and the keyboard side or sides that the key was on. diff --git a/packages/flutter/lib/src/services/system_channels.dart b/packages/flutter/lib/src/services/system_channels.dart index 2e25ebfba1..49af63f230 100644 --- a/packages/flutter/lib/src/services/system_channels.dart +++ b/packages/flutter/lib/src/services/system_channels.dart @@ -295,7 +295,6 @@ class SystemChannels { /// * [PlatformViewsService] for the available operations on this channel. static const MethodChannel platform_views = MethodChannel( 'flutter/platform_views', - StandardMethodCodec(), ); /// A [MethodChannel] for configuring the Skia graphics library. @@ -321,7 +320,6 @@ class SystemChannels { /// integer `device`, and string `kind`. static const MethodChannel mouseCursor = OptionalMethodChannel( 'flutter/mousecursor', - StandardMethodCodec(), ); /// A [MethodChannel] for synchronizing restoration data with the engine. @@ -352,7 +350,6 @@ class SystemChannels { /// restoration data is used in Flutter. static const MethodChannel restoration = OptionalMethodChannel( 'flutter/restoration', - StandardMethodCodec(), ); /// A [MethodChannel] for installing and managing deferred components. @@ -378,7 +375,6 @@ class SystemChannels { /// `installDeferredComponent` or `loadLibrary` is called again. static const MethodChannel deferredComponent = OptionalMethodChannel( 'flutter/deferredcomponent', - StandardMethodCodec(), ); /// A JSON [MethodChannel] for localization. diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index ba684b2839..8a16af5021 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -266,8 +266,6 @@ class SystemUiOverlayStyle { /// applications with a dark background. static const SystemUiOverlayStyle light = SystemUiOverlayStyle( systemNavigationBarColor: Color(0xFF000000), - systemNavigationBarDividerColor: null, - statusBarColor: null, systemNavigationBarIconBrightness: Brightness.light, statusBarIconBrightness: Brightness.light, statusBarBrightness: Brightness.dark, @@ -277,8 +275,6 @@ class SystemUiOverlayStyle { /// applications with a light background. static const SystemUiOverlayStyle dark = SystemUiOverlayStyle( systemNavigationBarColor: Color(0xFF000000), - systemNavigationBarDividerColor: null, - statusBarColor: null, systemNavigationBarIconBrightness: Brightness.light, statusBarIconBrightness: Brightness.dark, statusBarBrightness: Brightness.light, diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index 8561ffb5dd..c999be4d38 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -342,8 +342,7 @@ class _AnimatedCrossFadeState extends State with TickerProvid bottomChild = TickerMode( key: bottomKey, enabled: _isTransitioning, - child: ExcludeSemantics( - excluding: true, // Always exclude the semantics of the widget that's fading out. + child: ExcludeSemantics( // Always exclude the semantics of the widget that's fading out. child: ExcludeFocus( child: FadeTransition( opacity: bottomAnimation, diff --git a/packages/flutter/lib/src/widgets/autofill.dart b/packages/flutter/lib/src/widgets/autofill.dart index 107502e47f..035a8a0938 100644 --- a/packages/flutter/lib/src/widgets/autofill.dart +++ b/packages/flutter/lib/src/widgets/autofill.dart @@ -195,7 +195,7 @@ class AutofillGroupState extends State with AutofillScopeMixin { TextInput.finishAutofillContext(shouldSave: false); break; case AutofillContextAction.commit: - TextInput.finishAutofillContext(shouldSave: true); + TextInput.finishAutofillContext(); break; } } diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 3104e4eb9e..df2e9875ff 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -5607,7 +5607,7 @@ abstract class RenderObjectElement extends Element { int oldChildrenBottom = oldChildren.length - 1; final List newChildren = oldChildren.length == newWidgets.length ? - oldChildren : List.filled(newWidgets.length, _NullElement.instance, growable: false); + oldChildren : List.filled(newWidgets.length, _NullElement.instance); Element? previousChild; @@ -6259,7 +6259,7 @@ class MultiChildRenderObjectElement extends RenderObjectElement { @override void mount(Element? parent, Object? newSlot) { super.mount(parent, newSlot); - final List children = List.filled(widget.children.length, _NullElement.instance, growable: false); + final List children = List.filled(widget.children.length, _NullElement.instance); Element? previousChild; for (int i = 0; i < children.length; i += 1) { final Element newChild = inflateWidget(widget.children[i], IndexedSlot(i, previousChild)); diff --git a/packages/flutter/lib/src/widgets/image_icon.dart b/packages/flutter/lib/src/widgets/image_icon.dart index 3eb9746124..80e8ba57d2 100644 --- a/packages/flutter/lib/src/widgets/image_icon.dart +++ b/packages/flutter/lib/src/widgets/image_icon.dart @@ -89,7 +89,6 @@ class ImageIcon extends StatelessWidget { height: iconSize, color: iconColor, fit: BoxFit.scaleDown, - alignment: Alignment.center, excludeFromSemantics: true, ), ); diff --git a/packages/flutter/lib/src/widgets/interactive_viewer.dart b/packages/flutter/lib/src/widgets/interactive_viewer.dart index fa7ed17db9..02bda6fa7c 100644 --- a/packages/flutter/lib/src/widgets/interactive_viewer.dart +++ b/packages/flutter/lib/src/widgets/interactive_viewer.dart @@ -892,10 +892,7 @@ class _InteractiveViewerState extends State with TickerProvid widget.onInteractionUpdate?.call(ScaleUpdateDetails( focalPoint: event.position, localFocalPoint: event.localPosition, - rotation: 0.0, scale: scaleChange, - horizontalScale: 1.0, - verticalScale: 1.0, )); widget.onInteractionEnd?.call(ScaleEndDetails()); return; @@ -923,10 +920,7 @@ class _InteractiveViewerState extends State with TickerProvid widget.onInteractionUpdate?.call(ScaleUpdateDetails( focalPoint: event.position, localFocalPoint: event.localPosition, - rotation: 0.0, scale: scaleChange, - horizontalScale: 1.0, - verticalScale: 1.0, )); widget.onInteractionEnd?.call(ScaleEndDetails()); } @@ -1048,7 +1042,6 @@ class _InteractiveViewerState extends State with TickerProvid onPointerSignal: _receivedPointerSignal, child: GestureDetector( behavior: HitTestBehavior.opaque, // Necessary when panning off screen. - dragStartBehavior: DragStartBehavior.start, onScaleEnd: _onScaleEnd, onScaleStart: _onScaleStart, onScaleUpdate: _onScaleUpdate, diff --git a/packages/flutter/lib/src/widgets/modal_barrier.dart b/packages/flutter/lib/src/widgets/modal_barrier.dart index fea4a7c760..7e77ef95ae 100644 --- a/packages/flutter/lib/src/widgets/modal_barrier.dart +++ b/packages/flutter/lib/src/widgets/modal_barrier.dart @@ -115,7 +115,6 @@ class ModalBarrier extends StatelessWidget { textDirection: semanticsDismissible && semanticsLabel != null ? Directionality.of(context) : null, child: MouseRegion( cursor: SystemMouseCursors.basic, - opaque: true, child: ConstrainedBox( constraints: const BoxConstraints.expand(), child: color == null ? null : ColoredBox( diff --git a/packages/flutter/lib/src/widgets/navigation_toolbar.dart b/packages/flutter/lib/src/widgets/navigation_toolbar.dart index e2b398a5b8..e6a0a19306 100644 --- a/packages/flutter/lib/src/widgets/navigation_toolbar.dart +++ b/packages/flutter/lib/src/widgets/navigation_toolbar.dart @@ -107,7 +107,6 @@ class _ToolbarLayout extends MultiChildLayoutDelegate { if (hasChild(_ToolbarSlot.leading)) { final BoxConstraints constraints = BoxConstraints( - minWidth: 0.0, maxWidth: size.width / 3.0, // The leading widget shouldn't take up more than 1/3 of the space. minHeight: size.height, // The height should be exactly the height of the bar. maxHeight: size.height, diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index 6aaed4959a..d608197a4d 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -5398,7 +5398,7 @@ class _HistoryProperty extends RestorableProperty>?> { final Map casted = data! as Map; return casted.map>((dynamic key, dynamic value) => MapEntry>( key as String?, - List.from(value as List, growable: true), + List.from(value as List), )); } diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index 2c0b5cf2eb..f951b6c47c 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -583,7 +583,6 @@ class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldCont ); _innerController = _NestedScrollController( this, - initialScrollOffset: 0.0, debugLabel: 'inner', ); } diff --git a/packages/flutter/lib/src/widgets/page_view.dart b/packages/flutter/lib/src/widgets/page_view.dart index e6bbe784f7..c804607902 100644 --- a/packages/flutter/lib/src/widgets/page_view.dart +++ b/packages/flutter/lib/src/widgets/page_view.dart @@ -359,7 +359,6 @@ class _PagePosition extends ScrollPositionWithSingleContext implements PageMetri duration: duration, curve: curve, alignmentPolicy: alignmentPolicy, - targetRenderObject: null, ); } diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 69ba3f6ea4..f019d29b17 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -2190,6 +2190,6 @@ class _RenderFocusTrap extends RenderProxyBoxWithHitTestBehavior { } } if (!hitCurrentFocus) - focusNode.unfocus(disposition: UnfocusDisposition.scope); + focusNode.unfocus(); } } diff --git a/packages/flutter/lib/src/widgets/table.dart b/packages/flutter/lib/src/widgets/table.dart index 19199973de..642049f51b 100644 --- a/packages/flutter/lib/src/widgets/table.dart +++ b/packages/flutter/lib/src/widgets/table.dart @@ -118,7 +118,7 @@ class Table extends RenderObjectWidget { Key? key, this.children = const [], this.columnWidths, - this.defaultColumnWidth = const FlexColumnWidth(1.0), + this.defaultColumnWidth = const FlexColumnWidth(), this.textDirection, this.border, this.defaultVerticalAlignment = TableCellVerticalAlignment.top, diff --git a/packages/flutter/lib/src/widgets/text_editing_action_target.dart b/packages/flutter/lib/src/widgets/text_editing_action_target.dart index 67a790d7fb..e08f959b86 100644 --- a/packages/flutter/lib/src/widgets/text_editing_action_target.dart +++ b/packages/flutter/lib/src/widgets/text_editing_action_target.dart @@ -620,7 +620,6 @@ abstract class TextEditingActionTarget { final TextPosition nextPosition = TextPosition( offset: textEditingValue.text.length, - affinity: TextAffinity.downstream, ); setSelection(textEditingValue.selection.expandTo(nextPosition, true), cause); } @@ -884,7 +883,6 @@ abstract class TextEditingActionTarget { } else { nextSelection = textEditingValue.selection.extendTo(TextPosition( offset: selectedLine.baseOffset, - affinity: TextAffinity.downstream, )); } @@ -1168,7 +1166,6 @@ abstract class TextEditingActionTarget { ); final TextSelection nextSelection = TextSelection.fromPosition(TextPosition( offset: selectedLine.baseOffset, - affinity: TextAffinity.downstream, )); setSelection(nextSelection, cause); @@ -1429,7 +1426,6 @@ abstract class TextEditingActionTarget { void moveSelectionToEnd(SelectionChangedCause cause) { final TextPosition nextPosition = TextPosition( offset: textEditingValue.text.length, - affinity: TextAffinity.downstream, ); setSelection(TextSelection.fromPosition(nextPosition), cause); } diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index 503e09e9e0..9155c1c282 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -707,7 +707,7 @@ class _WidgetInspectorService = Object with WidgetInspectorService; mixin WidgetInspectorService { /// Ring of cached JSON values to prevent JSON from being garbage /// collected before it can be requested over the Observatory protocol. - final List _serializeRing = List.filled(20, null, growable: false); + final List _serializeRing = List.filled(20, null); int _serializeRingIndex = 0; /// The current [WidgetInspectorService]. @@ -925,7 +925,6 @@ mixin WidgetInspectorService { groupName: _consoleObjectGroup, subtreeDepth: 5, includeProperties: true, - expandPropertyValues: true, maxDescendentsTruncatableNode: 5, service: this, ), @@ -934,7 +933,6 @@ mixin WidgetInspectorService { errorJson['errorsSinceReload'] = _errorsSinceReload; if (_errorsSinceReload == 0) { errorJson['renderedErrorText'] = TextTreeRenderer( - wrapWidth: FlutterError.wrapWidth, wrapWidthProperties: FlutterError.wrapWidth, maxDescendentsTruncatableNode: 5, ).render(details.toDiagnosticsNode(style: DiagnosticsTreeStyle.error)).trimRight(); @@ -965,7 +963,7 @@ mixin WidgetInspectorService { bool enabled = false; assert(() { // TODO(kenz): add support for structured errors on the web. - enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb); + enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb); // ignore: avoid_redundant_argument_values return true; }()); return enabled; @@ -1639,7 +1637,7 @@ mixin WidgetInspectorService { List _getChildrenDetailsSubtree(String? diagnosticsNodeId, String groupName) { final DiagnosticsNode? node = toObject(diagnosticsNodeId) as DiagnosticsNode?; // With this value of minDepth we only expand one extra level of important nodes. - final InspectorSerializationDelegate delegate = InspectorSerializationDelegate(groupName: groupName, subtreeDepth: 1, includeProperties: true, service: this); + final InspectorSerializationDelegate delegate = InspectorSerializationDelegate(groupName: groupName, includeProperties: true, service: this); return _nodesToJson(node == null ? const [] : _getChildrenFiltered(node, delegate), delegate, parent: node); } @@ -1747,7 +1745,6 @@ mixin WidgetInspectorService { root, InspectorSerializationDelegate( groupName: groupName, - summaryTree: false, subtreeDepth: subtreeDepth, includeProperties: true, service: this, diff --git a/packages/flutter/test/animation/animation_controller_test.dart b/packages/flutter/test/animation/animation_controller_test.dart index 265aee9d81..3efa93f2c8 100644 --- a/packages/flutter/test/animation/animation_controller_test.dart +++ b/packages/flutter/test/animation/animation_controller_test.dart @@ -412,7 +412,7 @@ void main() { vsync: const TestVSync(), ); expect(() { controller.repeat(); }, throwsFlutterError); - expect(() { controller.repeat(period: null); }, throwsFlutterError); + expect(() { controller.repeat(); }, throwsFlutterError); controller.dispose(); }); @@ -436,8 +436,6 @@ void main() { final AnimationController controller = AnimationController( value: 1.0, - upperBound: 1.0, - lowerBound: 0.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -453,8 +451,6 @@ void main() { final AnimationController controller = AnimationController( value: 0.0, - upperBound: 1.0, - lowerBound: 0.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -530,8 +526,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -582,8 +576,6 @@ void main() { test('setting value directly sets correct status', () { final AnimationController controller = AnimationController( value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), ); @@ -613,8 +605,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -660,8 +650,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 1.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -689,8 +677,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), )..addStatusListener(statusLog.add); @@ -720,8 +706,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), ); @@ -772,8 +756,6 @@ void main() { final AnimationController controller = AnimationController( duration: const Duration(milliseconds: 100), value: 0.0, - lowerBound: 0.0, - upperBound: 1.0, vsync: const TestVSync(), ); @@ -849,7 +831,6 @@ void main() { debugSemanticsDisableAnimations = true; final AnimationController controller = AnimationController( vsync: const TestVSync(), - animationBehavior: AnimationBehavior.normal, ); expect(controller.value, 0.0); @@ -880,8 +861,8 @@ void main() { vsync: const TestVSync(), ); - controller.fling(velocity: 1.0, animationBehavior: AnimationBehavior.preserve); - fastController.fling(velocity: 1.0, animationBehavior: AnimationBehavior.normal); + controller.fling(animationBehavior: AnimationBehavior.preserve); + fastController.fling(animationBehavior: AnimationBehavior.normal); tick(Duration.zero); tick(const Duration(milliseconds: 50)); diff --git a/packages/flutter/test/animation/animation_sheet_test.dart b/packages/flutter/test/animation/animation_sheet_test.dart index 59e119a36a..6550f3d375 100644 --- a/packages/flutter/test/animation/animation_sheet_test.dart +++ b/packages/flutter/test/animation/animation_sheet_test.dart @@ -38,7 +38,6 @@ void main() { await tester.pumpFrames( builder.record( const _DecuplePixels(Duration(seconds: 1)), - recording: true, ), const Duration(milliseconds: 400), const Duration(milliseconds: 100), @@ -93,7 +92,6 @@ void main() { await tester.pumpFrames( builder.record( const _DecuplePixels(Duration(seconds: 1)), - recording: true, ), const Duration(milliseconds: 400), const Duration(milliseconds: 100), diff --git a/packages/flutter/test/animation/curves_test.dart b/packages/flutter/test/animation/curves_test.dart index e9374f6a8f..b00047af73 100644 --- a/packages/flutter/test/animation/curves_test.dart +++ b/packages/flutter/test/animation/curves_test.dart @@ -270,7 +270,6 @@ void main() { Offset(0.66, 0.75), Offset(1.0, 1.0), ], - tension: 0.0, startHandle: const Offset(0.0, -0.3), endHandle: const Offset(1.3, 1.3), ); @@ -319,7 +318,6 @@ void main() { Offset(0.66, 0.75), Offset(1.0, 1.0), ], - tension: 0.0, startHandle: const Offset(0.0, -0.3), endHandle: const Offset(1.3, 1.3), ); @@ -419,7 +417,6 @@ void main() { Offset(0.2, 0.25), Offset(0.01, 0.25), ], - tension: 0.0, ), isFalse, ); @@ -429,7 +426,6 @@ void main() { Offset(0.2, 0.25), Offset(0.01, 0.25), ], - tension: 0.0, ); }, throwsAssertionError); @@ -440,7 +436,6 @@ void main() { Offset(0.2, 0.25), Offset(1.01, 0.25), ], - tension: 0.0, ), isFalse, ); @@ -450,7 +445,6 @@ void main() { Offset(0.2, 0.25), Offset(1.01, 0.25), ], - tension: 0.0, ); }, throwsAssertionError); @@ -462,7 +456,6 @@ void main() { Offset(0.50, 0.50), Offset(0.75, 0.75), ], - tension: 0.0, ), isFalse, ); @@ -473,7 +466,6 @@ void main() { Offset(0.50, 0.50), Offset(0.75, 0.75), ], - tension: 0.0, ); }, throwsAssertionError); @@ -485,7 +477,6 @@ void main() { Offset(0.50, 0.50), Offset(0.95, 0.51), ], - tension: 0.0, ), isFalse, ); @@ -496,7 +487,6 @@ void main() { Offset(0.50, 0.50), Offset(0.95, 0.51), ], - tension: 0.0, ); }, throwsAssertionError); @@ -507,7 +497,6 @@ void main() { Offset(0.5, 0.05), Offset(0.5, 0.95), ], - tension: 0.0, ), isFalse, ); @@ -517,7 +506,6 @@ void main() { Offset(0.5, 0.05), Offset(0.5, 0.95), ], - tension: 0.0, ); }, throwsAssertionError); }); @@ -540,7 +528,6 @@ void main() { Offset(0.2, 0.25), Offset(0.01, 0.25), ], - tension: 0.0, ); }, throwsAssertionError); @@ -551,7 +538,6 @@ void main() { Offset(0.2, 0.25), Offset(1.01, 0.25), ], - tension: 0.0, ); }, throwsAssertionError); @@ -563,7 +549,6 @@ void main() { Offset(0.50, 0.50), Offset(0.75, 0.75), ], - tension: 0.0, ); }, throwsAssertionError); @@ -575,7 +560,6 @@ void main() { Offset(0.50, 0.50), Offset(0.95, 0.51), ], - tension: 0.0, ); }, throwsAssertionError); @@ -586,7 +570,6 @@ void main() { Offset(0.5, 0.05), Offset(0.5, 0.95), ], - tension: 0.0, ); }, throwsAssertionError); }); diff --git a/packages/flutter/test/animation/live_binding_test.dart b/packages/flutter/test/animation/live_binding_test.dart index 6fbafb99ad..e698f2d56a 100644 --- a/packages/flutter/test/animation/live_binding_test.dart +++ b/packages/flutter/test/animation/live_binding_test.dart @@ -27,7 +27,7 @@ void main() { home: Container( decoration: BoxDecoration( color: const Color.fromARGB(255, 128, 128, 128), - border: Border.all(color: const Color.fromARGB(255, 0, 0, 0)), + border: Border.all(), ), child: Center( child: Container( @@ -85,7 +85,7 @@ void main() { home: Container( decoration: BoxDecoration( color: const Color.fromARGB(255, 128, 128, 128), - border: Border.all(color: const Color.fromARGB(255, 0, 0, 0)), + border: Border.all(), ), child: Center( child: Container( diff --git a/packages/flutter/test/animation/tween_test.dart b/packages/flutter/test/animation/tween_test.dart index 333b4a867f..7d62a06080 100644 --- a/packages/flutter/test/animation/tween_test.dart +++ b/packages/flutter/test/animation/tween_test.dart @@ -125,13 +125,13 @@ void main() { test('BorderTween nullable test', () { BorderTween tween = BorderTween(); - expect(tween.lerp(0.0), null); - expect(tween.lerp(1.0), null); + expect(tween.lerp(0.0), null); + expect(tween.lerp(1.0), null); - tween = BorderTween(begin: null, end: const Border(top: BorderSide())); - expect(tween.lerp(0.0), const Border()); - expect(tween.lerp(0.5), const Border(top: BorderSide(width: 0.5))); - expect(tween.lerp(1.0), const Border(top: BorderSide())); + tween = BorderTween(end: const Border(top: BorderSide())); + expect(tween.lerp(0.0), const Border()); + expect(tween.lerp(0.5), const Border(top: BorderSide(width: 0.5))); + expect(tween.lerp(1.0), const Border(top: BorderSide())); }); test('SizeTween', () { @@ -156,13 +156,13 @@ void main() { test('Matrix4Tween', () { final Matrix4 a = Matrix4.identity(); - final Matrix4 b = a.clone()..translate(6.0, -8.0, 0.0)..scale(0.5, 1.0, 5.0); + final Matrix4 b = a.clone()..translate(6.0, -8.0)..scale(0.5, 1.0, 5.0); final Matrix4Tween tween = Matrix4Tween(begin: a, end: b); expect(tween.lerp(0.0), equals(a)); expect(tween.lerp(1.0), equals(b)); expect( tween.lerp(0.5), - equals(a.clone()..translate(3.0, -4.0, 0.0)..scale(0.75, 1.0, 3.0)), + equals(a.clone()..translate(3.0, -4.0)..scale(0.75, 1.0, 3.0)), ); final Matrix4 c = a.clone()..rotateZ(1.0); final Matrix4Tween rotationTween = Matrix4Tween(begin: a, end: c); @@ -214,7 +214,7 @@ void main() { }); test('BorderRadiusTween nullable test', () { - final BorderRadiusTween tween = BorderRadiusTween(begin: null, end: null); + final BorderRadiusTween tween = BorderRadiusTween(); expect(tween.transform(0.0), null); expect(tween.transform(1.0), null); expect(tween.lerp(0.0), null); diff --git a/packages/flutter/test/cupertino/activity_indicator_test.dart b/packages/flutter/test/cupertino/activity_indicator_test.dart index fbcde0b102..4ea3902cad 100644 --- a/packages/flutter/test/cupertino/activity_indicator_test.dart +++ b/packages/flutter/test/cupertino/activity_indicator_test.dart @@ -34,7 +34,7 @@ void main() { await tester.pumpWidget( Center( child: MediaQuery( - data: const MediaQueryData(platformBrightness: Brightness.light), + data: const MediaQueryData(), child: RepaintBoundary( key: key, child: Container( @@ -86,8 +86,9 @@ void main() { key: key, child: Container( color: CupertinoColors.white, - child: - const CupertinoActivityIndicator.partiallyRevealed(progress: 0), + child: const CupertinoActivityIndicator.partiallyRevealed( + progress: 0, + ), ), ), ), @@ -129,8 +130,7 @@ void main() { key: key, child: Container( color: CupertinoColors.white, - child: - const CupertinoActivityIndicator.partiallyRevealed(progress: 1), + child: const CupertinoActivityIndicator.partiallyRevealed(), ), ), ), @@ -162,7 +162,7 @@ void main() { Widget buildCupertinoActivityIndicator([bool? animating]) { return MediaQuery( - data: const MediaQueryData(platformBrightness: Brightness.light), + data: const MediaQueryData(), child: CupertinoActivityIndicator( animating: animating ?? true, ), diff --git a/packages/flutter/test/cupertino/button_test.dart b/packages/flutter/test/cupertino/button_test.dart index 5e39bb9734..6ef4f98a90 100644 --- a/packages/flutter/test/cupertino/button_test.dart +++ b/packages/flutter/test/cupertino/button_test.dart @@ -360,7 +360,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(platformBrightness: Brightness.light), + data: const MediaQueryData(), child: boilerplate(child: const CupertinoButton( color: bgColor, disabledColor: inactive, diff --git a/packages/flutter/test/cupertino/colors_test.dart b/packages/flutter/test/cupertino/colors_test.dart index 20fe20ac97..5f76c10514 100644 --- a/packages/flutter/test/cupertino/colors_test.dart +++ b/packages/flutter/test/cupertino/colors_test.dart @@ -218,7 +218,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.light), + data: MediaQueryData(), child: DependentWidget(color: vibrancyDependentColor1), ), ); @@ -262,7 +262,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(highContrast: false), + data: MediaQueryData(), child: DependentWidget(color: contrastDependentColor1), ), ); @@ -328,7 +328,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.light, highContrast: false), + data: MediaQueryData(), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.base, child: DependentWidget(color: dynamicRainbowColor1), @@ -339,7 +339,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.dark, highContrast: false), + data: MediaQueryData(platformBrightness: Brightness.dark), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.base, child: DependentWidget(color: dynamicRainbowColor1), @@ -350,7 +350,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.light, highContrast: true), + data: MediaQueryData(highContrast: true), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.base, child: DependentWidget(color: dynamicRainbowColor1), @@ -372,7 +372,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.dark, highContrast: false), + data: MediaQueryData(platformBrightness: Brightness.dark), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.elevated, child: DependentWidget(color: dynamicRainbowColor1), @@ -383,7 +383,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.light, highContrast: true), + data: MediaQueryData(highContrast: true), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.elevated, child: DependentWidget(color: dynamicRainbowColor1), @@ -405,7 +405,7 @@ void main() { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(platformBrightness: Brightness.light, highContrast: false), + data: MediaQueryData(), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.elevated, child: DependentWidget(color: dynamicRainbowColor1), @@ -457,7 +457,7 @@ void main() { CupertinoApp( theme: const CupertinoThemeData(primaryColor: dynamicColor), home: MediaQuery( - data: const MediaQueryData(platformBrightness: Brightness.light, highContrast: false), + data: const MediaQueryData(), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.base, child: Builder( @@ -512,7 +512,7 @@ void main() { ), ), home: MediaQuery( - data: const MediaQueryData(platformBrightness: Brightness.light, highContrast: false), + data: const MediaQueryData(), child: CupertinoUserInterfaceLevel( data: CupertinoUserInterfaceLevelData.base, child: Builder( diff --git a/packages/flutter/test/cupertino/context_menu_test.dart b/packages/flutter/test/cupertino/context_menu_test.dart index bd08891e63..dc5ed1de57 100644 --- a/packages/flutter/test/cupertino/context_menu_test.dart +++ b/packages/flutter/test/cupertino/context_menu_test.dart @@ -138,7 +138,6 @@ void main() { onGenerateRoute: (RouteSettings settings) { return CupertinoPageRoute( builder: (BuildContext context) => Align( - alignment: Alignment.center, child: CupertinoContextMenu( actions: const [ CupertinoContextMenuAction( @@ -300,7 +299,6 @@ void main() { // Pump a CupertinoContextMenu in the center of the screen and open it. final Widget child = _getChild(); await tester.pumpWidget(_getContextMenu( - alignment: Alignment.center, screenSize: portraitScreenSize, child: child, )); @@ -370,7 +368,6 @@ void main() { // Pump a CupertinoContextMenu in the center of the screen and open it. final Widget child = _getChild(); await tester.pumpWidget(_getContextMenu( - alignment: Alignment.center, child: child, )); expect(find.byType(CupertinoContextMenuAction), findsNothing); diff --git a/packages/flutter/test/cupertino/date_picker_test.dart b/packages/flutter/test/cupertino/date_picker_test.dart index c9bc0457e9..2822e7d575 100644 --- a/packages/flutter/test/cupertino/date_picker_test.dart +++ b/packages/flutter/test/cupertino/date_picker_test.dart @@ -127,7 +127,6 @@ void main() { CupertinoApp( home: CupertinoTimerPicker( onTimerDurationChanged: (_) { }, - backgroundColor: null, ), ), ); @@ -255,7 +254,6 @@ void main() { minuteInterval: 10, secondInterval: 12, initialTimerDuration: const Duration(hours: 10, minutes: 40, seconds: 48), - mode: CupertinoTimerPickerMode.hms, onTimerDurationChanged: (Duration d) { duration = d; }, @@ -301,7 +299,6 @@ void main() { CupertinoApp( home: CupertinoDatePicker( onDateTimeChanged: (_) { }, - backgroundColor: null, ), ), ); @@ -381,7 +378,6 @@ void main() { height: 400.0, width: 400.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, onDateTimeChanged: (DateTime dateTime) => selectedDateTime = dateTime, initialDateTime: DateTime(2018, 1, 1, 10, 30), ), @@ -403,10 +399,9 @@ void main() { height: 400.0, width: 400.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, onDateTimeChanged: (DateTime dateTime) => selectedDateTime = dateTime, // Change the initial date, but it shouldn't affect the present state. - initialDateTime: DateTime(2016, 4, 5, 15, 00), + initialDateTime: DateTime(2016, 4, 5, 15), ), ), ), @@ -431,7 +426,7 @@ void main() { child: CupertinoDatePicker( mode: CupertinoDatePickerMode.date, onDateTimeChanged: (_) { }, - initialDateTime: DateTime(2018, 9, 15, 0, 0), + initialDateTime: DateTime(2018, 9, 15), ), ), ), @@ -451,7 +446,6 @@ void main() { height: 400.0, width: 400.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, onDateTimeChanged: (_) { }, initialDateTime: DateTime(2018, 9, 15, 3, 14), ), @@ -472,7 +466,6 @@ void main() { home: Directionality( textDirection: TextDirection.ltr, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, onDateTimeChanged: (_) { }, initialDateTime: DateTime(2018, 1, 1, 10, 30), ), @@ -491,7 +484,6 @@ void main() { height: 400.0, width: 800.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, onDateTimeChanged: (_) { }, initialDateTime: DateTime(2018, 1, 1, 10, 30), ), @@ -718,7 +710,6 @@ void main() { height: 400.0, width: 400.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, minimumDate: minimum, maximumDate: maximum, onDateTimeChanged: (DateTime newDate) { @@ -957,7 +948,6 @@ void main() { height: 400.0, width: 400.0, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, minimumDate: minDate, onDateTimeChanged: (DateTime newDate) { }, initialDateTime: minDate.add(const Duration(days: 1)), @@ -1166,7 +1156,6 @@ void main() { // This is too small to draw the picker out fully. width: 100, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, initialDateTime: DateTime(2019, 1, 1, 4), onDateTimeChanged: (_) {}, ), @@ -1270,7 +1259,6 @@ void main() { width: 500, height: 400, child: CupertinoDatePicker( - mode: CupertinoDatePickerMode.dateAndTime, initialDateTime: DateTime(2019, 1, 1, 4), onDateTimeChanged: (_) {}, ), @@ -1401,7 +1389,6 @@ void main() { CupertinoApp( home: CupertinoTimerPicker( key: key, - mode: CupertinoTimerPickerMode.hms, initialTimerDuration: const Duration(hours: 5, minutes: 17, seconds: 19), onTimerDurationChanged: (Duration d) {}, ), @@ -1503,7 +1490,6 @@ void main() { children: [ matchesSemantics( hasIncreaseAction: true, - hasDecreaseAction: false, increasedValue: '1', value: '0', textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 84ccbb8ce3..da5c538227 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -1128,7 +1128,7 @@ void main() { await tester.pumpWidget( const MaterialApp( home: MediaQuery( - data: MediaQueryData(viewInsets: EdgeInsets.zero), + data: MediaQueryData(), child: CupertinoAlertDialog(content: Placeholder(fallbackHeight: 200.0)), ), ), @@ -1297,7 +1297,7 @@ void main() { await tester.pumpWidget( const MaterialApp( home: MediaQuery( - data: MediaQueryData(viewInsets: EdgeInsets.zero), + data: MediaQueryData(), child: CupertinoAlertDialog( actions: [ CupertinoDialogAction(child: Text('OK')), diff --git a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart index bb924a4881..ed211846d6 100644 --- a/packages/flutter/test/cupertino/material/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/material/tab_scaffold_test.dart @@ -234,9 +234,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - viewInsets: EdgeInsets.zero, - ), + data: const MediaQueryData(), child: MaterialApp( home: Material( child: CupertinoTabScaffold( diff --git a/packages/flutter/test/cupertino/nav_bar_test.dart b/packages/flutter/test/cupertino/nav_bar_test.dart index 2d2820f231..12ea7cb47d 100644 --- a/packages/flutter/test/cupertino/nav_bar_test.dart +++ b/packages/flutter/test/cupertino/nav_bar_test.dart @@ -142,7 +142,6 @@ void main() { // the nav bar position it horizontally. middle: Align( key: middleBox, - alignment: Alignment.center, widthFactor: 1.0, child: const Text('Title'), ), @@ -1189,8 +1188,6 @@ void main() { child: CustomScrollView( slivers: [ CupertinoSliverNavigationBar( - automaticallyImplyLeading: true, - automaticallyImplyTitle: true, previousPageTitle: 'previous title', ), ], @@ -1283,7 +1280,6 @@ void main() { const CupertinoSliverNavigationBar( trailing: trailingText, largeTitle: titleText, - stretch: false, ), SliverToBoxAdapter( child: Container( diff --git a/packages/flutter/test/cupertino/route_test.dart b/packages/flutter/test/cupertino/route_test.dart index ec0373ead6..1ec00c3a2c 100644 --- a/packages/flutter/test/cupertino/route_test.dart +++ b/packages/flutter/test/cupertino/route_test.dart @@ -1595,7 +1595,7 @@ void main() { expect(find.text('second'), findsOneWidget); myPages = >[ - CupertinoPage(key: pageKeyOne, maintainState: true, child: const Text('first')), + CupertinoPage(key: pageKeyOne, child: const Text('first')), CupertinoPage(key: pageKeyTwo, child: const Text('second')), ]; @@ -1670,7 +1670,7 @@ void main() { await tester.pumpAndSettle(); - await gesture.down(const Offset(3, 300), timeStamp: Duration.zero); + await gesture.down(const Offset(3, 300)); // Need 2 events to form a valid drag await tester.pump(const Duration(milliseconds: 100)); diff --git a/packages/flutter/test/cupertino/scaffold_test.dart b/packages/flutter/test/cupertino/scaffold_test.dart index e649edec06..5a8f91c96d 100644 --- a/packages/flutter/test/cupertino/scaffold_test.dart +++ b/packages/flutter/test/cupertino/scaffold_test.dart @@ -188,7 +188,6 @@ void main() { textDirection: TextDirection.ltr, child: MediaQuery( data: MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -490,12 +489,10 @@ void main() { return CupertinoApp( home: MediaQuery( data: MediaQueryData( - padding: EdgeInsets.zero, viewPadding: const EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: showKeyboard ? 300 : 20), ), child: CupertinoPageScaffold( - resizeToAvoidBottomInset: true, navigationBar: showNavigationBar ? const CupertinoNavigationBar( middle: Text('Title'), ) : null, diff --git a/packages/flutter/test/cupertino/scrollbar_test.dart b/packages/flutter/test/cupertino/scrollbar_test.dart index cd5ae8d67d..cd7711f495 100644 --- a/packages/flutter/test/cupertino/scrollbar_test.dart +++ b/packages/flutter/test/cupertino/scrollbar_test.dart @@ -482,7 +482,6 @@ void main() { child: PrimaryScrollController( controller: controller, child: CupertinoScrollbar( - isAlwaysShown: false, controller: controller, child: const SingleChildScrollView( child: SizedBox( diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index 5527822156..05115c9159 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -687,7 +687,7 @@ void main() { expect(childWidth, 200.0); - expect(childWidth, getSurroundingRect(tester, child: 0).width); + expect(childWidth, getSurroundingRect(tester).width); expect(childWidth, getSurroundingRect(tester, child: 1).width); expect(childWidth, getSurroundingRect(tester, child: 2).width); }); @@ -914,7 +914,7 @@ void main() { expect(sharedValue, 1); - final double childWidth = getChildSize(tester, child: 0).width; + final double childWidth = getChildSize(tester).width; final Offset centerOfSegmentedControl = tester.getCenter(find.text('Child 1')); // Tap just inside segment bounds diff --git a/packages/flutter/test/cupertino/switch_test.dart b/packages/flutter/test/cupertino/switch_test.dart index 5eb2a424f0..dd3d5492a6 100644 --- a/packages/flutter/test/cupertino/switch_test.dart +++ b/packages/flutter/test/cupertino/switch_test.dart @@ -331,7 +331,6 @@ void main() { return Center( child: CupertinoSwitch( value: value, - dragStartBehavior: DragStartBehavior.start, onChanged: (bool newValue) { setState(() { value = newValue; diff --git a/packages/flutter/test/cupertino/tab_scaffold_test.dart b/packages/flutter/test/cupertino/tab_scaffold_test.dart index fd961cf638..faa35c19ec 100644 --- a/packages/flutter/test/cupertino/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/tab_scaffold_test.dart @@ -472,7 +472,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -619,7 +618,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/33455 testWidgets('Adding new tabs does not crash the app', (WidgetTester tester) async { final List tabsPainted = []; - final CupertinoTabController controller = CupertinoTabController(initialIndex: 0); + final CupertinoTabController controller = CupertinoTabController(); await tester.pumpWidget( CupertinoApp( @@ -677,7 +676,7 @@ void main() { "while preserving the previous controller's tab index", (WidgetTester tester) async { final List tabsPainted = []; - final CupertinoTabController oldController = CupertinoTabController(initialIndex: 0); + final CupertinoTabController oldController = CupertinoTabController(); await tester.pumpWidget( CupertinoApp( @@ -706,7 +705,6 @@ void main() { tabBar: CupertinoTabBar( items: List.generate(10, tabGenerator), ), - controller: null, tabBuilder: (BuildContext context, int index) { return CustomPaint( @@ -763,7 +761,6 @@ void main() { tabBar: CupertinoTabBar( items: List.generate(2, tabGenerator), ), - controller: null, tabBuilder: (BuildContext context, int index) => const Placeholder(), ), ), @@ -793,7 +790,7 @@ void main() { expect(find.text('Tab 3'), findsOneWidget); controller.dispose(); - controller = CupertinoTabController(initialIndex: 0); + controller = CupertinoTabController(); await tester.pumpWidget( CupertinoApp( home: CupertinoTabScaffold( @@ -1036,9 +1033,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - viewInsets: EdgeInsets.zero, - ), + data: const MediaQueryData(), child: CupertinoApp( home: CupertinoTabScaffold( tabBar: _buildTabBar(), diff --git a/packages/flutter/test/cupertino/tab_test.dart b/packages/flutter/test/cupertino/tab_test.dart index 8621c7db12..63001a64f3 100644 --- a/packages/flutter/test/cupertino/tab_test.dart +++ b/packages/flutter/test/cupertino/tab_test.dart @@ -179,7 +179,6 @@ void main() { home: CupertinoTabView( navigatorKey: key, builder: (BuildContext context) => const Text('first route'), - onUnknownRoute: null, ), ), ); diff --git a/packages/flutter/test/cupertino/text_field_restoration_test.dart b/packages/flutter/test/cupertino/text_field_restoration_test.dart index a1a223ccfc..ead396fba2 100644 --- a/packages/flutter/test/cupertino/text_field_restoration_test.dart +++ b/packages/flutter/test/cupertino/text_field_restoration_test.dart @@ -100,7 +100,6 @@ class TestWidgetState extends State with RestorationMixin { Widget build(BuildContext context) { return Material( child: Align( - alignment: Alignment.center, child: SizedBox( width: 50, child: CupertinoTextField( diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart index 53eac3411f..e37e33d582 100644 --- a/packages/flutter/test/cupertino/text_field_test.dart +++ b/packages/flutter/test/cupertino/text_field_test.dart @@ -1764,7 +1764,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textFieldStart + const Offset(150.0, 5.0)); await tester.pumpAndSettle(); @@ -1848,7 +1848,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textFieldStart + const Offset(150.0, 5.0)); await tester.pump(const Duration(milliseconds: 500)); @@ -2337,7 +2337,6 @@ void main() { home: Center( child: CupertinoTextField( controller: controller, - maxLines: 1, ), ), ), @@ -2440,7 +2439,7 @@ void main() { // First tap moved the cursor to the beginning of the second word. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textFieldStart + const Offset(150.0, 5.0)); await tester.pump(const Duration(milliseconds: 500)); @@ -2485,7 +2484,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textFieldStart + const Offset(150.0, 5.0)); await tester.pumpAndSettle(); @@ -2553,7 +2552,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textFieldStart + const Offset(150.0, 5.0)); await tester.pumpAndSettle(); @@ -3573,7 +3572,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: 200, height: 200, @@ -3639,7 +3637,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: 200, height: 200, @@ -3710,7 +3707,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: 200, height: 200, @@ -3829,7 +3825,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -3876,7 +3871,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -3924,7 +3918,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -3972,7 +3965,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -4022,7 +4014,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -4074,7 +4065,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -4128,7 +4118,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -4182,7 +4171,6 @@ void main() { debugShowCheckedModeBanner: false, home: CupertinoPageScaffold( child: Align( - alignment: Alignment.center, child: SizedBox( width: size.width, height: size.height, @@ -4424,9 +4412,7 @@ void main() { ).first, ), matchesSemantics( - isEnabled: false, hasEnabledState: true, - hasTapAction: false, ), ); }); @@ -4500,7 +4486,6 @@ void main() { style: const TextStyle(height: 4, color: ui.Color.fromARGB(100, 0, 0, 0)), toolbarOptions: const ToolbarOptions(selectAll: true), selectionHeightStyle: ui.BoxHeightStyle.includeLineSpacingBottom, - selectionWidthStyle: ui.BoxWidthStyle.tight, maxLines: 3, ), ], diff --git a/packages/flutter/test/cupertino/text_selection_test.dart b/packages/flutter/test/cupertino/text_selection_test.dart index 84a801d3b1..3805055615 100644 --- a/packages/flutter/test/cupertino/text_selection_test.dart +++ b/packages/flutter/test/cupertino/text_selection_test.dart @@ -173,7 +173,6 @@ void main() { context, TextSelectionHandleType.right, 10.0, - null, ), ), ), diff --git a/packages/flutter/test/foundation/diagnostics_test.dart b/packages/flutter/test/foundation/diagnostics_test.dart index 69e3365c44..ebc3672e8b 100644 --- a/packages/flutter/test/foundation/diagnostics_test.dart +++ b/packages/flutter/test/foundation/diagnostics_test.dart @@ -959,7 +959,6 @@ void main() { final StringProperty quoted = StringProperty( 'name', 'value', - quoted: true, ); expect(quoted.toString(), equals('name: "value"')); validateStringPropertyJsonSerialization(quoted); @@ -974,7 +973,6 @@ void main() { 'name', null, showName: false, - quoted: true, ).toString(), equals('null'), ); diff --git a/packages/flutter/test/foundation/stack_frame_test.dart b/packages/flutter/test/foundation/stack_frame_test.dart index dbfa8554ec..63138c7352 100644 --- a/packages/flutter/test/foundation/stack_frame_test.dart +++ b/packages/flutter/test/foundation/stack_frame_test.dart @@ -118,20 +118,20 @@ const String stackString = ''' #13 main (package:hello_flutter/main.dart:10:4)'''; const List stackFrames = [ - StackFrame(number: 0, className: '_AssertionError', method: '_doThrowNew', packageScheme: 'dart', package: 'core-patch', packagePath: 'errors_patch.dart', line: 42, column: 39, source: '#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)'), - StackFrame(number: 1, className: '_AssertionError', method: '_throwNew', packageScheme: 'dart', package: 'core-patch', packagePath: 'errors_patch.dart', line: 38, column: 5, source: '#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)'), + StackFrame(number: 0, className: '_AssertionError', method: '_doThrowNew', packageScheme: 'dart', package: 'core-patch', packagePath: 'errors_patch.dart', line: 42, column: 39, source: '#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)'), + StackFrame(number: 1, className: '_AssertionError', method: '_throwNew', packageScheme: 'dart', package: 'core-patch', packagePath: 'errors_patch.dart', line: 38, column: 5, source: '#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)'), StackFrame(number: 2, className: 'Text', method: '', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/text.dart', line: 287, column: 10, isConstructor: true, source: '#2 new Text (package:flutter/src/widgets/text.dart:287:10)'), - StackFrame(number: 3, className: '_MyHomePageState', method: 'build', packageScheme: 'package', package: 'hello_flutter', packagePath: 'main.dart', line: 72, column: 16, source: '#3 _MyHomePageState.build (package:hello_flutter/main.dart:72:16)'), - StackFrame(number: 4, className: 'StatefulElement', method: 'build', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4414, column: 27, source: '#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4414:27)'), - StackFrame(number: 5, className: 'ComponentElement', method: 'performRebuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4303, column: 15, source: '#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4303:15)'), - StackFrame(number: 6, className: 'Element', method: 'rebuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4027, column: 5, source: '#6 Element.rebuild (package:flutter/src/widgets/framework.dart:4027:5)'), - StackFrame(number: 7, className: 'ComponentElement', method: '_firstBuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4286, column: 5, source: '#7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4286:5)'), - StackFrame(number: 8, className: 'StatefulElement', method: '_firstBuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4461, column: 11, source: '#8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4461:11)'), - StackFrame(number: 9, className: 'ComponentElement', method: 'mount', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4281, column: 5, source: '#9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4281:5)'), - StackFrame(number: 10, className: 'Element', method: 'inflateWidget', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 3276, column: 14, source: '#10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3276:14)'), - StackFrame(number: 11, className: 'Element', method: 'updateChild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: -1, column: -1, source: '#11 Element.updateChild (package:flutter/src/widgets/framework.dart)'), - StackFrame(number: 12, className: 'SingleChildRenderObjectElement', method: 'mount', packageScheme: 'package', package: 'flutter', packagePath: 'blah.dart', line: 999, column: 9, source: '#12 SingleChildRenderObjectElement.mount (package:flutter/blah.dart:999:9)'), - StackFrame(number: 13, className: '', method: 'main', packageScheme: 'package', package: 'hello_flutter', packagePath: 'main.dart', line: 10, column: 4, source: '#13 main (package:hello_flutter/main.dart:10:4)'), + StackFrame(number: 3, className: '_MyHomePageState', method: 'build', packageScheme: 'package', package: 'hello_flutter', packagePath: 'main.dart', line: 72, column: 16, source: '#3 _MyHomePageState.build (package:hello_flutter/main.dart:72:16)'), + StackFrame(number: 4, className: 'StatefulElement', method: 'build', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4414, column: 27, source: '#4 StatefulElement.build (package:flutter/src/widgets/framework.dart:4414:27)'), + StackFrame(number: 5, className: 'ComponentElement', method: 'performRebuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4303, column: 15, source: '#5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4303:15)'), + StackFrame(number: 6, className: 'Element', method: 'rebuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4027, column: 5, source: '#6 Element.rebuild (package:flutter/src/widgets/framework.dart:4027:5)'), + StackFrame(number: 7, className: 'ComponentElement', method: '_firstBuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4286, column: 5, source: '#7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4286:5)'), + StackFrame(number: 8, className: 'StatefulElement', method: '_firstBuild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4461, column: 11, source: '#8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4461:11)'), + StackFrame(number: 9, className: 'ComponentElement', method: 'mount', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 4281, column: 5, source: '#9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4281:5)'), + StackFrame(number: 10, className: 'Element', method: 'inflateWidget', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: 3276, column: 14, source: '#10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3276:14)'), + StackFrame(number: 11, className: 'Element', method: 'updateChild', packageScheme: 'package', package: 'flutter', packagePath: 'src/widgets/framework.dart', line: -1, column: -1, source: '#11 Element.updateChild (package:flutter/src/widgets/framework.dart)'), + StackFrame(number: 12, className: 'SingleChildRenderObjectElement', method: 'mount', packageScheme: 'package', package: 'flutter', packagePath: 'blah.dart', line: 999, column: 9, source: '#12 SingleChildRenderObjectElement.mount (package:flutter/blah.dart:999:9)'), + StackFrame(number: 13, method: 'main', packageScheme: 'package', package: 'hello_flutter', packagePath: 'main.dart', line: 10, column: 4, source: '#13 main (package:hello_flutter/main.dart:10:4)'), ]; @@ -194,47 +194,47 @@ dart:async/zone.dart 1190:13 _rootRun '''; const List asyncStackFrames = [ - StackFrame(number: 0, className: '', method: 'getSampleStack', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart', line: 40, column: 57, source: '#0 getSampleStack. (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:40:57)'), + StackFrame(number: 0, method: 'getSampleStack', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart', line: 40, column: 57, source: '#0 getSampleStack. (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:40:57)'), StackFrame(number: 1, className: 'Future', method: 'sync', packageScheme: 'dart', package: 'async', packagePath: 'future.dart', line: 224, column: 31, isConstructor: true, source: '#1 new Future.sync (dart:async/future.dart:224:31)'), - StackFrame(number: 2, className: '', method: 'getSampleStack', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart', line: 40, column: 10, source: '#2 getSampleStack (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:40:10)'), - StackFrame(number: 3, className: '', method: 'main', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/foundation/error_reporting_test.dart', line: 46, column: 40, source: '#3 main (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:46:40)'), - StackFrame(number: 4, className: '', method: 'main', packageScheme: 'package', package: 'flutter_goldens', packagePath: 'flutter_goldens.dart', line: 43, column: 17, source: '#4 main (package:flutter_goldens/flutter_goldens.dart:43:17)'), + StackFrame(number: 2, method: 'getSampleStack', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart', line: 40, column: 10, source: '#2 getSampleStack (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:40:10)'), + StackFrame(number: 3, method: 'main', packageScheme: 'file', package: '', packagePath: '/path/to/flutter/packages/flutter/foundation/error_reporting_test.dart', line: 46, column: 40, source: '#3 main (file:///path/to/flutter/packages/flutter/test/foundation/error_reporting_test.dart:46:40)'), + StackFrame(number: 4, method: 'main', packageScheme: 'package', package: 'flutter_goldens', packagePath: 'flutter_goldens.dart', line: 43, column: 17, source: '#4 main (package:flutter_goldens/flutter_goldens.dart:43:17)'), StackFrame.asynchronousSuspension, - StackFrame(number: 5, className: '', method: 'main', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 47, column: 18, source: '#5 main.. (file:///temp/path.whatever/listener.dart:47:18)'), - StackFrame(number: 6, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#6 _rootRun (dart:async/zone.dart:1126:13)'), - StackFrame(number: 7, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#7 _CustomZone.run (dart:async/zone.dart:1023:19)'), - StackFrame(number: 8, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#8 _runZoned (dart:async/zone.dart:1518:10)'), - StackFrame(number: 9, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#9 runZoned (dart:async/zone.dart:1465:12)'), - StackFrame(number: 10, className: 'Declarer', method: 'declare', packageScheme: 'package', package: 'test_api', packagePath: 'src/backend/declarer.dart', line: 130, column: 22, source: '#10 Declarer.declare (package:test_api/src/backend/declarer.dart:130:22)'), - StackFrame(number: 11, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 124, column: 26, source: '#11 RemoteListener.start... (package:test_api/src/remote_listener.dart:124:26)'), + StackFrame(number: 5, method: 'main', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 47, column: 18, source: '#5 main.. (file:///temp/path.whatever/listener.dart:47:18)'), + StackFrame(number: 6, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#6 _rootRun (dart:async/zone.dart:1126:13)'), + StackFrame(number: 7, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#7 _CustomZone.run (dart:async/zone.dart:1023:19)'), + StackFrame(number: 8, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#8 _runZoned (dart:async/zone.dart:1518:10)'), + StackFrame(number: 9, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#9 runZoned (dart:async/zone.dart:1465:12)'), + StackFrame(number: 10, className: 'Declarer', method: 'declare', packageScheme: 'package', package: 'test_api', packagePath: 'src/backend/declarer.dart', line: 130, column: 22, source: '#10 Declarer.declare (package:test_api/src/backend/declarer.dart:130:22)'), + StackFrame(number: 11, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 124, column: 26, source: '#11 RemoteListener.start... (package:test_api/src/remote_listener.dart:124:26)'), StackFrame.asynchronousSuspension, - StackFrame(number: 12, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#12 _rootRun (dart:async/zone.dart:1126:13)'), - StackFrame(number: 13, className: '_CustomZone', method: 'run' , packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#13 _CustomZone.run (dart:async/zone.dart:1023:19)'), - StackFrame(number: 14, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#14 _runZoned (dart:async/zone.dart:1518:10)'), - StackFrame(number: 15, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: 12, source: '#15 runZoned (dart:async/zone.dart:1502:12)'), - StackFrame(number: 16, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 70, column: 9, source: '#16 RemoteListener.start.. (package:test_api/src/remote_listener.dart:70:9)'), - StackFrame(number: 17, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#17 _rootRun (dart:async/zone.dart:1126:13)'), - StackFrame(number: 18, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#18 _CustomZone.run (dart:async/zone.dart:1023:19)'), - StackFrame(number: 19, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#19 _runZoned (dart:async/zone.dart:1518:10)'), - StackFrame(number: 20, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#20 runZoned (dart:async/zone.dart:1465:12)'), - StackFrame(number: 21, className: 'StackTraceFormatter', method: 'asCurrent', packageScheme: 'package', package: 'test_api', packagePath: 'src/backend/stack_trace_formatter.dart', line: 41, column: 31, source: '#21 StackTraceFormatter.asCurrent (package:test_api/src/backend/stack_trace_formatter.dart:41:31)'), - StackFrame(number: 22, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 69, column: 29, source: '#22 RemoteListener.start. (package:test_api/src/remote_listener.dart:69:29)'), - StackFrame(number: 23, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#23 _rootRun (dart:async/zone.dart:1126:13)'), - StackFrame(number: 24, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#24 _CustomZone.run (dart:async/zone.dart:1023:19)'), - StackFrame(number: 25, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#25 _runZoned (dart:async/zone.dart:1518:10)'), - StackFrame(number: 26, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#26 runZoned (dart:async/zone.dart:1465:12)'), - StackFrame(number: 27, className: 'SuiteChannelManager', method: 'asCurrent', packageScheme: 'package', package: 'test_api', packagePath: 'src/suite_channel_manager.dart', line: 34, column: 31, source: '#27 SuiteChannelManager.asCurrent (package:test_api/src/suite_channel_manager.dart:34:31)'), - StackFrame(number: 28, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 68, column: 27, source: '#28 RemoteListener.start (package:test_api/src/remote_listener.dart:68:27)'), - StackFrame(number: 29, className: '', method: 'serializeSuite', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 17, column: 25, source: '#29 serializeSuite (file:///temp/path.whatever/listener.dart:17:25)'), - StackFrame(number: 30, className: '', method: 'main', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 43, column: 36, source: '#30 main (file:///temp/path.whatever/listener.dart:43:36)'), - StackFrame(number: 31, className: '', method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line:239, column: 25, source: '#31 _runMainZoned.. (dart:ui/hooks.dart:239:25)'), - StackFrame(number: 32, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#32 _rootRun (dart:async/zone.dart:1126:13)'), - StackFrame(number: 33, className: '_CustomZone', method: 'run' , packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#33 _CustomZone.run (dart:async/zone.dart:1023:19)'), - StackFrame(number: 34, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#34 _runZoned (dart:async/zone.dart:1518:10)'), - StackFrame(number: 35, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: 12, source: '#35 runZoned (dart:async/zone.dart:1502:12)'), - StackFrame(number: 36, className: '', method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 231, column: 5, source: '#36 _runMainZoned. (dart:ui/hooks.dart:231:5)'), - StackFrame(number: 37, className: '', method: '_startIsolate', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate_patch.dart', line: 307, column: 19, source: '#37 _startIsolate. (dart:isolate-patch/isolate_patch.dart:307:19)'), - StackFrame(number: 38, className: '_RawReceivePortImpl', method: '_handleMessage', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate_patch.dart', line: 174, column: 12, source: '#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)'), + StackFrame(number: 12, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#12 _rootRun (dart:async/zone.dart:1126:13)'), + StackFrame(number: 13, className: '_CustomZone', method: 'run' , packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#13 _CustomZone.run (dart:async/zone.dart:1023:19)'), + StackFrame(number: 14, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#14 _runZoned (dart:async/zone.dart:1518:10)'), + StackFrame(number: 15, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: 12, source: '#15 runZoned (dart:async/zone.dart:1502:12)'), + StackFrame(number: 16, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 70, column: 9, source: '#16 RemoteListener.start.. (package:test_api/src/remote_listener.dart:70:9)'), + StackFrame(number: 17, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#17 _rootRun (dart:async/zone.dart:1126:13)'), + StackFrame(number: 18, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#18 _CustomZone.run (dart:async/zone.dart:1023:19)'), + StackFrame(number: 19, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#19 _runZoned (dart:async/zone.dart:1518:10)'), + StackFrame(number: 20, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#20 runZoned (dart:async/zone.dart:1465:12)'), + StackFrame(number: 21, className: 'StackTraceFormatter', method: 'asCurrent', packageScheme: 'package', package: 'test_api', packagePath: 'src/backend/stack_trace_formatter.dart', line: 41, column: 31, source: '#21 StackTraceFormatter.asCurrent (package:test_api/src/backend/stack_trace_formatter.dart:41:31)'), + StackFrame(number: 22, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 69, column: 29, source: '#22 RemoteListener.start. (package:test_api/src/remote_listener.dart:69:29)'), + StackFrame(number: 23, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#23 _rootRun (dart:async/zone.dart:1126:13)'), + StackFrame(number: 24, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#24 _CustomZone.run (dart:async/zone.dart:1023:19)'), + StackFrame(number: 25, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#25 _runZoned (dart:async/zone.dart:1518:10)'), + StackFrame(number: 26, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1465, column: 12, source: '#26 runZoned (dart:async/zone.dart:1465:12)'), + StackFrame(number: 27, className: 'SuiteChannelManager', method: 'asCurrent', packageScheme: 'package', package: 'test_api', packagePath: 'src/suite_channel_manager.dart', line: 34, column: 31, source: '#27 SuiteChannelManager.asCurrent (package:test_api/src/suite_channel_manager.dart:34:31)'), + StackFrame(number: 28, className: 'RemoteListener', method: 'start', packageScheme: 'package', package: 'test_api', packagePath: 'src/remote_listener.dart', line: 68, column: 27, source: '#28 RemoteListener.start (package:test_api/src/remote_listener.dart:68:27)'), + StackFrame(number: 29, method: 'serializeSuite', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 17, column: 25, source: '#29 serializeSuite (file:///temp/path.whatever/listener.dart:17:25)'), + StackFrame(number: 30, method: 'main', packageScheme: 'file', package: '', packagePath: '/temp/path.whatever/listener.dart', line: 43, column: 36, source: '#30 main (file:///temp/path.whatever/listener.dart:43:36)'), + StackFrame(number: 31, method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line:239, column: 25, source: '#31 _runMainZoned.. (dart:ui/hooks.dart:239:25)'), + StackFrame(number: 32, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: 13, source: '#32 _rootRun (dart:async/zone.dart:1126:13)'), + StackFrame(number: 33, className: '_CustomZone', method: 'run' , packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: 19, source: '#33 _CustomZone.run (dart:async/zone.dart:1023:19)'), + StackFrame(number: 34, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: 10, source: '#34 _runZoned (dart:async/zone.dart:1518:10)'), + StackFrame(number: 35, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: 12, source: '#35 runZoned (dart:async/zone.dart:1502:12)'), + StackFrame(number: 36, method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 231, column: 5, source: '#36 _runMainZoned. (dart:ui/hooks.dart:231:5)'), + StackFrame(number: 37, method: '_startIsolate', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate_patch.dart', line: 307, column: 19, source: '#37 _startIsolate. (dart:isolate-patch/isolate_patch.dart:307:19)'), + StackFrame(number: 38, className: '_RawReceivePortImpl', method: '_handleMessage', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate_patch.dart', line: 174, column: 12, source: '#38 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)'), ]; const String stackFrameNoCols = ''' @@ -250,15 +250,15 @@ const String stackFrameNoCols = ''' #9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)'''; const List stackFrameNoColsFrames = [ - StackFrame(number: 0, className: '', method: 'blah', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 4, column: -1, source: '#0 blah (package:assertions/main.dart:4)'), - StackFrame(number: 1, className: '', method: 'main', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 8, column: -1, source: '#1 main (package:assertions/main.dart:8)'), - StackFrame(number: 2, className: '', method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 239, column: -1, source: '#2 _runMainZoned.. (dart:ui/hooks.dart:239)'), - StackFrame(number: 3, className: '', method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: -1, source: '#3 _rootRun (dart:async/zone.dart:1126)'), + StackFrame(number: 0, method: 'blah', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 4, column: -1, source: '#0 blah (package:assertions/main.dart:4)'), + StackFrame(number: 1, method: 'main', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 8, column: -1, source: '#1 main (package:assertions/main.dart:8)'), + StackFrame(number: 2, method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 239, column: -1, source: '#2 _runMainZoned.. (dart:ui/hooks.dart:239)'), + StackFrame(number: 3, method: '_rootRun', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1126, column: -1, source: '#3 _rootRun (dart:async/zone.dart:1126)'), StackFrame(number: 4, className: '_CustomZone', method: 'run', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1023, column: -1, source: '#4 _CustomZone.run (dart:async/zone.dart:1023)'), - StackFrame(number: 5, className: '', method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: -1, source: '#5 _runZoned (dart:async/zone.dart:1518)'), - StackFrame(number: 6, className: '', method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: -1, source: '#6 runZoned (dart:async/zone.dart:1502)'), - StackFrame(number: 7, className: '', method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 231, column: -1, source: '#7 _runMainZoned. (dart:ui/hooks.dart:231)'), - StackFrame(number: 8, className: '', method: '_startIsolate', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate-patch.dart', line: 307, column: -1, source: '#8 _startIsolate. (dart:isolate-patch/isolate_patch.dart:307)'), + StackFrame(number: 5, method: '_runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1518, column: -1, source: '#5 _runZoned (dart:async/zone.dart:1518)'), + StackFrame(number: 6, method: 'runZoned', packageScheme: 'dart', package: 'async', packagePath: 'zone.dart', line: 1502, column: -1, source: '#6 runZoned (dart:async/zone.dart:1502)'), + StackFrame(number: 7, method: '_runMainZoned', packageScheme: 'dart', package: 'ui', packagePath: 'hooks.dart', line: 231, column: -1, source: '#7 _runMainZoned. (dart:ui/hooks.dart:231)'), + StackFrame(number: 8, method: '_startIsolate', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate-patch.dart', line: 307, column: -1, source: '#8 _startIsolate. (dart:isolate-patch/isolate_patch.dart:307)'), StackFrame(number: 9, className: '_RawReceivePortImpl', method: '_handleMessage', packageScheme: 'dart', package: 'isolate-patch', packagePath: 'isolate-patch.dart', line: 174, column: -1, source: '#9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)'), ]; @@ -280,17 +280,17 @@ package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 168:15 const List webStackTraceFrames = [ StackFrame(number: -1, className: '', method: 'throw_', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart', line: 196, column: 49, source: 'package:dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 196:49 throw_'), - StackFrame(number: -1, className: '', method: 'blah', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 4, column: 3, source: 'package:assertions/main.dart 4:3 blah'), - StackFrame(number: -1, className: '', method: r'main$', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 8, column: 5, source: r'package:assertions/main.dart 8:5 main$'), - StackFrame(number: -1, className: '', method: r'main$', packageScheme: 'package', package: 'assertions', packagePath: 'main_web_entrypoint.dart', line: 9, column: 3, source: r'package:assertions/main_web_entrypoint.dart 9:3 main$'), + StackFrame(number: -1, className: '', method: 'blah', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 4, column: 3, source: 'package:assertions/main.dart 4:3 blah'), + StackFrame(number: -1, className: '', method: r'main$', packageScheme: 'package', package: 'assertions', packagePath: 'main.dart', line: 8, column: 5, source: r'package:assertions/main.dart 8:5 main$'), + StackFrame(number: -1, className: '', method: r'main$', packageScheme: 'package', package: 'assertions', packagePath: 'main_web_entrypoint.dart', line: 9, column: 3, source: r'package:assertions/main_web_entrypoint.dart 9:3 main$'), StackFrame(number: -1, className: '', method: 'onValue', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/_internal/js_dev_runtime/patch/async_patch.dart', line: 47, column: 50, source: 'package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 47:50 onValue'), StackFrame(number: -1, className: '', method: 'runUnary', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/zone.dart', line: 1381, column: 54, source: 'package:dart-sdk/lib/async/zone.dart 1381:54 runUnary'), - StackFrame(number: -1, className: '', method: 'performLayout', packageScheme: '', package: '', packagePath: '', line: 210, column: 5, source: 'object_test.dart 210:5 performLayout'), + StackFrame(number: -1, className: '', method: 'performLayout', packageScheme: '', package: '', packagePath: '', line: 210, column: 5, source: 'object_test.dart 210:5 performLayout'), StackFrame(number: -1, className: '', method: 'handleValue', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/future_impl.dart', line: 140, column: 18, source: 'package:dart-sdk/lib/async/future_impl.dart 140:18 handleValue'), StackFrame(number: -1, className: '', method: 'handleValueCallback', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/future_impl.dart', line: 682, column: 44, source: 'package:dart-sdk/lib/async/future_impl.dart 682:44 handleValueCallback'), StackFrame(number: -1, className: '', method: '_propagateToListeners', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/future_impl.dart', line: 711, column: 32, source: 'package:dart-sdk/lib/async/future_impl.dart 711:32 _propagateToListeners'), - StackFrame(number: -1, className: '', method: 'callback', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/future_impl.dart', line: 391, column: 9, source: 'package:dart-sdk/lib/async/future_impl.dart 391:9 callback'), + StackFrame(number: -1, className: '', method: 'callback', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/future_impl.dart', line: 391, column: 9, source: 'package:dart-sdk/lib/async/future_impl.dart 391:9 callback'), StackFrame(number: -1, className: '', method: '_microtaskLoop', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/schedule_microtask.dart', line: 43, column: 11, source: 'package:dart-sdk/lib/async/schedule_microtask.dart 43:11 _microtaskLoop'), - StackFrame(number: -1, className: '', method: '_startMicrotaskLoop', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/schedule_microtask.dart', line: 52, column: 5, source: 'package:dart-sdk/lib/async/schedule_microtask.dart 52:5 _startMicrotaskLoop'), + StackFrame(number: -1, className: '', method: '_startMicrotaskLoop', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/async/schedule_microtask.dart', line: 52, column: 5, source: 'package:dart-sdk/lib/async/schedule_microtask.dart 52:5 _startMicrotaskLoop'), StackFrame(number: -1, className: '', method: '', packageScheme: 'package', package: 'dart-sdk', packagePath: 'lib/_internal/js_dev_runtime/patch/async_patch.dart', line: 168, column: 15, source: 'package:dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 168:15 '), ]; diff --git a/packages/flutter/test/gestures/drag_test.dart b/packages/flutter/test/gestures/drag_test.dart index f97e1b495d..73ab1ea9b8 100644 --- a/packages/flutter/test/gestures/drag_test.dart +++ b/packages/flutter/test/gestures/drag_test.dart @@ -578,7 +578,7 @@ void main() { velocity = details.velocity; }; - final TestPointer pointer = TestPointer(1); + final TestPointer pointer = TestPointer(); final PointerDownEvent down = pointer.down(const Offset(10.0, 25.0), timeStamp: const Duration(milliseconds: 10)); drag.addPointer(down); tester.closeArena(1); @@ -611,7 +611,7 @@ void main() { velocity = details.velocity; }; - final TestPointer pointer = TestPointer(1); + final TestPointer pointer = TestPointer(); final PointerDownEvent down = pointer.down(const Offset(10.0, 25.0), timeStamp: const Duration(milliseconds: 10)); drag.addPointer(down); tester.closeArena(1); @@ -751,7 +751,7 @@ void main() { }; // Using a touch pointer to drag shouldn't be recognized. - final TestPointer touchPointer = TestPointer(5, PointerDeviceKind.touch); + final TestPointer touchPointer = TestPointer(5); final PointerDownEvent touchDown = touchPointer.down(const Offset(10.0, 10.0)); drag.addPointer(touchDown); tester.closeArena(5); @@ -1114,8 +1114,8 @@ void main() { addTearDown(hori.dispose); addTearDown(vert.dispose); - final TestPointer pointer1 = TestPointer(4, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(5, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(4); + final TestPointer pointer2 = TestPointer(5); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 10.0)); @@ -1167,8 +1167,8 @@ void main() { addTearDown(hori.dispose); addTearDown(vert.dispose); - final TestPointer pointer1 = TestPointer(4, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(5, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(4); + final TestPointer pointer2 = TestPointer(5); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 10.0)); @@ -1221,8 +1221,8 @@ void main() { addTearDown(hori.dispose); addTearDown(vert.dispose); - final TestPointer pointer1 = TestPointer(4, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(5, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(4); + final TestPointer pointer2 = TestPointer(5); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 10.0)); @@ -1278,8 +1278,8 @@ void main() { addTearDown(hori.dispose); addTearDown(vert.dispose); - final TestPointer pointer1 = TestPointer(4, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(5, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(4); + final TestPointer pointer2 = TestPointer(5); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 10.0)); @@ -1335,8 +1335,8 @@ void main() { addTearDown(hori.dispose); addTearDown(vert.dispose); - final TestPointer pointer1 = TestPointer(1, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(2, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(); + final TestPointer pointer2 = TestPointer(2); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 10.0)); @@ -1390,10 +1390,10 @@ void main() { addTearDown(tap.dispose); addTearDown(drag.dispose); - final TestPointer pointer1 = TestPointer(1, PointerDeviceKind.touch); - final TestPointer pointer2 = TestPointer(2, PointerDeviceKind.touch); - final TestPointer pointer3 = TestPointer(3, PointerDeviceKind.touch); - final TestPointer pointer4 = TestPointer(4, PointerDeviceKind.touch); + final TestPointer pointer1 = TestPointer(); + final TestPointer pointer2 = TestPointer(2); + final TestPointer pointer3 = TestPointer(3); + final TestPointer pointer4 = TestPointer(4); final PointerDownEvent down1 = pointer1.down(const Offset(10.0, 10.0)); final PointerDownEvent down2 = pointer2.down(const Offset(11.0, 11.0)); diff --git a/packages/flutter/test/gestures/events_test.dart b/packages/flutter/test/gestures/events_test.dart index 9c59703458..81d5a02220 100644 --- a/packages/flutter/test/gestures/events_test.dart +++ b/packages/flutter/test/gestures/events_test.dart @@ -496,7 +496,6 @@ void main() { const PointerScrollEvent scroll = PointerScrollEvent( timeStamp: Duration(seconds: 2), - kind: PointerDeviceKind.mouse, device: 1, position: Offset(20, 30), ); diff --git a/packages/flutter/test/gestures/force_press_test.dart b/packages/flutter/test/gestures/force_press_test.dart index d3f5a19c46..191dbe07bb 100644 --- a/packages/flutter/test/gestures/force_press_test.dart +++ b/packages/flutter/test/gestures/force_press_test.dart @@ -17,10 +17,6 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; @@ -33,7 +29,7 @@ void main() { started += 1; } - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = onStart; force.onPeak = (ForcePressDetails details) => peaked += 1; @@ -41,7 +37,7 @@ void main() { force.onEnd = (ForcePressDetails details) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 0, pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); @@ -72,7 +68,7 @@ void main() { tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 3.3, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 4.0, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 5.0, pressureMin: pressureMin, pressureMax: pressureMax)); - tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax)); + tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax)); // We have exceeded the start pressure so update should be greater than 0. expect(started, 1); @@ -92,7 +88,7 @@ void main() { tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 3.3, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 4.0, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 5.0, pressureMin: pressureMin, pressureMax: pressureMax)); - tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax)); + tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax)); // Update is still called. expect(started, 1); @@ -124,7 +120,7 @@ void main() { force.onEnd = (ForcePressDetails details) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); final PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: const Offset(10.0, 10.0), pressure: 0, pressureMin: 0, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); @@ -165,16 +161,12 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -182,7 +174,7 @@ void main() { force.onEnd = (_) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 0, pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); @@ -217,16 +209,12 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -237,8 +225,8 @@ void main() { drag.onStart = (_) => didStartPan += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); - const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax); + final TestPointer pointer = TestPointer(); + const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); drag.addPointer(down); @@ -289,10 +277,6 @@ void main() { testGesture('Should not call ended on pointer up if the gesture was never accepted', (GestureTester tester) { final PanGestureRecognizer drag = PanGestureRecognizer(); - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - // Device specific constants that represent those from the iPhone X const double pressureMin = 0; const double pressureMax = 6.66; @@ -302,7 +286,7 @@ void main() { int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -313,8 +297,8 @@ void main() { drag.onStart = (_) => didStartPan += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); - const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax); + final TestPointer pointer = TestPointer(); + const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); drag.addPointer(down); @@ -338,10 +322,6 @@ void main() { testGesture('Should call start only once if there is a competing gesture recognizer', (GestureTester tester) { final PanGestureRecognizer drag = PanGestureRecognizer(); - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - // Device specific constants that represent those from the iPhone X const double pressureMin = 0; const double pressureMax = 6.66; @@ -351,7 +331,7 @@ void main() { int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -362,8 +342,8 @@ void main() { drag.onStart = (_) => didStartPan += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); - const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax); + final TestPointer pointer = TestPointer(); + const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); drag.addPointer(down); @@ -400,10 +380,6 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; @@ -421,7 +397,7 @@ void main() { return Curves.easeIn.transform(lerp); } - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure, interpolation: interpolateWithEasing); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(interpolation: interpolateWithEasing); force.onStart = onStart; force.onPeak = (ForcePressDetails details) => peaked += 1; @@ -429,7 +405,7 @@ void main() { force.onEnd = (ForcePressDetails details) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 0, pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); @@ -464,7 +440,7 @@ void main() { expect(started, 1); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 5.0, pressureMin: pressureMin, pressureMax: pressureMax)); - tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax)); + tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax)); // We have exceeded the start pressure so update should be greater than 0. expect(started, 1); @@ -484,7 +460,7 @@ void main() { tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 3.3, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 4.0, pressureMin: pressureMin, pressureMax: pressureMax)); tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 6.5, pressureMin: pressureMin, pressureMax: pressureMax)); - tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 1.0, pressureMin: pressureMin, pressureMax: pressureMax)); + tester.route(const PointerMoveEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressureMin: pressureMin, pressureMax: pressureMax)); // Update is still called. expect(started, 1); @@ -506,16 +482,12 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -523,7 +495,7 @@ void main() { force.onEnd = (_) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 0, pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); @@ -558,16 +530,12 @@ void main() { const double pressureMin = 0; const double pressureMax = 6.66; - // Interpolated Flutter pressure values. - const double startPressure = 0.4; // = Device pressure of 2.66. - const double peakPressure = 0.85; // = Device pressure of 5.66. - int started = 0; int peaked = 0; int updated = 0; int ended = 0; - final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(startPressure: startPressure, peakPressure: peakPressure); + final ForcePressGestureRecognizer force = ForcePressGestureRecognizer(); force.onStart = (_) => started += 1; force.onPeak = (_) => peaked += 1; @@ -575,7 +543,7 @@ void main() { force.onEnd = (_) => ended += 1; const int pointerValue = 1; - final TestPointer pointer = TestPointer(pointerValue); + final TestPointer pointer = TestPointer(); const PointerDownEvent down = PointerDownEvent(pointer: pointerValue, position: Offset(10.0, 10.0), pressure: 0, pressureMin: pressureMin, pressureMax: pressureMax); pointer.setDownInfo(down, const Offset(10.0, 10.0)); force.addPointer(down); diff --git a/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart b/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart index 0ea6d959bc..a5e272bdd2 100644 --- a/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart +++ b/packages/flutter/test/gestures/gesture_binding_resample_event_on_widget_test.dart @@ -38,12 +38,10 @@ void main() { data: [ ui.PointerData( change: ui.PointerChange.add, - physicalX: 0.0, timeStamp: epoch, ), ui.PointerData( change: ui.PointerChange.down, - physicalX: 0.0, timeStamp: epoch, ), ui.PointerData( diff --git a/packages/flutter/test/gestures/gesture_binding_resample_event_test.dart b/packages/flutter/test/gestures/gesture_binding_resample_event_test.dart index ce708f4dfa..eb3a990ab4 100644 --- a/packages/flutter/test/gestures/gesture_binding_resample_event_test.dart +++ b/packages/flutter/test/gestures/gesture_binding_resample_event_test.dart @@ -55,7 +55,7 @@ void testResampleEvent(String description, ResampleEventTest callback) { test(description, () { fakeAsync((FakeAsync async) { callback(async); - }, initialTime: DateTime.utc(2015, 1, 1)); + }, initialTime: DateTime.utc(2015)); }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87067 // Fake clock is not working with the web platform. } @@ -69,12 +69,10 @@ void main() { data: [ ui.PointerData( change: ui.PointerChange.add, - physicalX: 0.0, timeStamp: epoch, ), ui.PointerData( change: ui.PointerChange.down, - physicalX: 0.0, timeStamp: epoch + const Duration(milliseconds: 10), ), ui.PointerData( diff --git a/packages/flutter/test/gestures/gesture_binding_test.dart b/packages/flutter/test/gestures/gesture_binding_test.dart index fb2ea9a3de..94616962e3 100644 --- a/packages/flutter/test/gestures/gesture_binding_test.dart +++ b/packages/flutter/test/gestures/gesture_binding_test.dart @@ -105,7 +105,7 @@ void main() { const ui.PointerDataPacket packet = ui.PointerDataPacket( data: [ ui.PointerData(change: ui.PointerChange.down), - ui.PointerData(change: ui.PointerChange.cancel), + ui.PointerData(), ], ); @@ -177,14 +177,13 @@ void main() { test('Should synthesize kPrimaryButton for touch when no button is set', () { final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio; - const PointerDeviceKind kind = PointerDeviceKind.touch; final ui.PointerDataPacket packet = ui.PointerDataPacket( data: [ - ui.PointerData(change: ui.PointerChange.add, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.hover, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.down, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.move, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.up, kind: kind, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.add, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.hover, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.down, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.move, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.up, physicalX: location.dx, physicalY: location.dy), ], ); @@ -205,14 +204,13 @@ void main() { test('Should not synthesize kPrimaryButton for touch when a button is set', () { final Offset location = const Offset(10.0, 10.0) * ui.window.devicePixelRatio; - const PointerDeviceKind kind = PointerDeviceKind.touch; final ui.PointerDataPacket packet = ui.PointerDataPacket( data: [ - ui.PointerData(change: ui.PointerChange.add, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.hover, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.down, buttons: kSecondaryButton, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.move, buttons: kSecondaryButton, kind: kind, physicalX: location.dx, physicalY: location.dy), - ui.PointerData(change: ui.PointerChange.up, kind: kind, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.add, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.hover, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.down, buttons: kSecondaryButton, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.move, buttons: kSecondaryButton, physicalX: location.dx, physicalY: location.dy), + ui.PointerData(change: ui.PointerChange.up, physicalX: location.dx, physicalY: location.dy), ], ); diff --git a/packages/flutter/test/gestures/long_press_test.dart b/packages/flutter/test/gestures/long_press_test.dart index 9dae18658e..5264dda2af 100644 --- a/packages/flutter/test/gestures/long_press_test.dart +++ b/packages/flutter/test/gestures/long_press_test.dart @@ -527,7 +527,6 @@ void main() { const PointerDownEvent touchDown = PointerDownEvent( pointer: 5, position: Offset(10, 10), - kind: PointerDeviceKind.touch, ); // Touch events shouldn't be recognized. diff --git a/packages/flutter/test/gestures/multitap_test.dart b/packages/flutter/test/gestures/multitap_test.dart index 7d0a0449e5..643308cc2c 100644 --- a/packages/flutter/test/gestures/multitap_test.dart +++ b/packages/flutter/test/gestures/multitap_test.dart @@ -86,7 +86,7 @@ void main() { tap.onTapCancel = (int pointer) { log.add('tap-cancel $pointer'); }; - final TestPointer touchPointer5 = TestPointer(5, PointerDeviceKind.touch); + final TestPointer touchPointer5 = TestPointer(5); final PointerDownEvent down5 = touchPointer5.down(const Offset(10.0, 10.0)); tap.addPointer(down5); tester.closeArena(5); @@ -102,7 +102,7 @@ void main() { // Mouse down should be ignored by the recognizer. expect(log, isEmpty); - final TestPointer touchPointer7 = TestPointer(7, PointerDeviceKind.touch); + final TestPointer touchPointer7 = TestPointer(7); final PointerDownEvent down7 = touchPointer7.down(const Offset(15.0, 15.0)); tap.addPointer(down7); tester.closeArena(7); diff --git a/packages/flutter/test/gestures/pointer_router_test.dart b/packages/flutter/test/gestures/pointer_router_test.dart index 7e52e6e660..130b35b358 100644 --- a/packages/flutter/test/gestures/pointer_router_test.dart +++ b/packages/flutter/test/gestures/pointer_router_test.dart @@ -176,7 +176,7 @@ void main() { globalEvents.add(event); }, transform); - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); const Offset firstPosition = Offset(16, 36); router.route(pointer1.down(firstPosition)); diff --git a/packages/flutter/test/gestures/scale_test.dart b/packages/flutter/test/gestures/scale_test.dart index 9a64b003de..2fa31992be 100644 --- a/packages/flutter/test/gestures/scale_test.dart +++ b/packages/flutter/test/gestures/scale_test.dart @@ -45,7 +45,7 @@ void main() { didTap = true; }; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(Offset.zero); scale.addPointer(down); @@ -302,7 +302,7 @@ void main() { didEndScale = true; }; - final TestPointer touchPointer = TestPointer(1, PointerDeviceKind.touch); + final TestPointer touchPointer = TestPointer(); final PointerDownEvent down = touchPointer.down(Offset.zero); scale.addPointer(down); @@ -357,7 +357,7 @@ void main() { drag.onStart = (DragStartDetails details) { log.add('drag-start'); }; drag.onEnd = (DragEndDetails details) { log.add('drag-end'); }; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(const Offset(10.0, 10.0)); scale.addPointer(down); @@ -455,7 +455,7 @@ void main() { didTap = true; }; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(Offset.zero); scale.addPointer(down); @@ -633,7 +633,7 @@ void main() { updatedRotation = details.rotation; }; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(Offset.zero); scale.addPointer(down); tester.closeArena(1); @@ -664,7 +664,7 @@ void main() { int pointerCountOfEnd = 0; scale.onEnd = (ScaleEndDetails details) => pointerCountOfEnd = details.pointerCount; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(Offset.zero); scale.addPointer(down); tester.closeArena(1); diff --git a/packages/flutter/test/gestures/tap_test.dart b/packages/flutter/test/gestures/tap_test.dart index a2e4612142..89ab65eb48 100644 --- a/packages/flutter/test/gestures/tap_test.dart +++ b/packages/flutter/test/gestures/tap_test.dart @@ -1020,7 +1020,7 @@ void main() { final HorizontalDragGestureRecognizer drag = HorizontalDragGestureRecognizer() ..onStart = (_) {}; - final TestPointer pointer1 = TestPointer(1); + final TestPointer pointer1 = TestPointer(); final PointerDownEvent down = pointer1.down(Offset.zero); drag.addPointer(down); diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index 4010148873..0795865379 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -52,7 +52,7 @@ void main() { expect(find.text('About box'), findsNothing); await tester.tap(find.byType(IconButton)); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('About Pirate app'), findsOneWidget); expect(find.text('0.1.2'), findsNothing); @@ -64,7 +64,7 @@ void main() { expect(find.text('About box'), findsNothing); await tester.tap(find.text('About Pirate app')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('About Pirate app'), findsOneWidget); expect(find.text('0.1.2'), findsOneWidget); @@ -82,7 +82,7 @@ void main() { }); await tester.tap(find.text('VIEW LICENSES')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Pirate app'), findsOneWidget); expect(find.text('0.1.2'), findsOneWidget); @@ -92,7 +92,7 @@ void main() { findsOneWidget, ); await tester.tap(find.text('Pirate package ')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Pirate license'), findsOneWidget); }); @@ -143,7 +143,7 @@ void main() { // Check license is displayed after entering into license page for 'AAA'. await tester.tap(find.text('AAA')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('BBB'), findsOneWidget); /// Go back to list of packages. @@ -153,7 +153,7 @@ void main() { /// Check license is displayed after entering into license page for /// 'Another package'. await tester.tap(find.text('Another package')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Another license'), findsOneWidget); }); @@ -219,7 +219,7 @@ void main() { // Check license is displayed after entering into license page for 'AAA'. await tester.tap(find.text('AAA')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('BBB'), findsOneWidget); /// Go back to list of packages. @@ -229,7 +229,7 @@ void main() { /// Check license is displayed after entering into license page for /// 'Another package'. await tester.tap(find.text('Another package')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Another license'), findsOneWidget); }); @@ -271,7 +271,7 @@ void main() { // Check license is displayed after entering into license page for 'AAA'. await tester.tap(find.text('AAA')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); // Check for titles style. final Text title = tester.widget(find.text('AAA')); @@ -329,7 +329,7 @@ void main() { // Check license is displayed after entering into license page for 'AAA'. await tester.tap(find.text('AAA')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); // Check for titles style. final Text title = tester.widget(find.text('AAA')); @@ -728,7 +728,7 @@ void main() { expect(find.text('AAA'), findsOneWidget); // Check license is displayed after entering into license page for 'AAA'. await tester.tap(find.text('AAA')); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); // The inherited ScrollBehavior should not apply Scrollbars since they are // already built in to the widget. diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index 53009493d4..b1ee467560 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -654,11 +654,7 @@ void main() { }); testWidgets('SliverAppBar default configuration', (WidgetTester tester) async { - await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, - expandedHeight: null, - )); + await tester.pumpWidget(buildSliverAppBarApp()); final ScrollController controller = primaryScrollController(tester); expect(controller.offset, 0.0); @@ -692,7 +688,6 @@ void main() { testWidgets('SliverAppBar expandedHeight, pinned', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( - floating: false, pinned: true, expandedHeight: 128.0, )); @@ -758,7 +753,6 @@ void main() { testWidgets('SliverAppBar expandedHeight, floating with snap:true', (WidgetTester tester) async { await tester.pumpWidget(buildSliverAppBarApp( floating: true, - pinned: false, snap: true, expandedHeight: 128.0, )); @@ -927,8 +921,6 @@ void main() { const double collapsedAppBarHeight = 200.0; await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, collapsedHeight: collapsedAppBarHeight, expandedHeight: expandedAppBarHeight, )); @@ -1073,7 +1065,6 @@ void main() { child: MediaQuery( data: topPadding100, child: Scaffold( - primary: true, appBar: AppBar( title: const Text('title'), ), @@ -1125,7 +1116,6 @@ void main() { child: MediaQuery( data: topPadding100, child: Scaffold( - primary: true, appBar: AppBar( bottom: PreferredSize( preferredSize: const Size.fromHeight(200.0), @@ -1177,7 +1167,6 @@ void main() { child: MediaQuery( data: const MediaQueryData(padding: EdgeInsets.symmetric(vertical: 100.0)), child: Scaffold( - primary: true, body: Column( children: [ AppBar( @@ -1440,7 +1429,6 @@ void main() { height: 50.0, padding: const EdgeInsets.all(4.0), child: const Placeholder( - strokeWidth: 2.0, color: Color(0xFFFFFFFF), ), ), @@ -1472,7 +1460,6 @@ void main() { height: 50.0, padding: const EdgeInsets.all(4.0), child: const Placeholder( - strokeWidth: 2.0, color: Color(0xFFFFFFFF), ), ), @@ -2073,7 +2060,6 @@ void main() { slivers: [ SliverAppBar( expandedHeight: appBarHeight, - pinned: false, floating: true, snap: snap, actions: [ @@ -2376,8 +2362,6 @@ void main() { const double toolbarHeight = 100.0; await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, toolbarHeight: toolbarHeight, )); @@ -2398,8 +2382,6 @@ void main() { const double collapsedHeight = 150.0; await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, toolbarHeight: toolbarHeight, collapsedHeight: collapsedHeight, )); @@ -2418,8 +2400,6 @@ void main() { const double collapsedHeight = 56.0; await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, collapsedHeight: collapsedHeight, )); @@ -2498,10 +2478,7 @@ void main() { }); testWidgets('SliverAppBar.titleSpacing defaults to NavigationToolbar.kMiddleSpacing', (WidgetTester tester) async { - await tester.pumpWidget(buildSliverAppBarApp( - floating: false, - pinned: false, - )); + await tester.pumpWidget(buildSliverAppBarApp()); final NavigationToolbar navToolBar = tester.widget(find.byType(NavigationToolbar)); expect(navToolBar.middleSpacing, NavigationToolbar.kMiddleSpacing); diff --git a/packages/flutter/test/material/app_bar_theme_test.dart b/packages/flutter/test/material/app_bar_theme_test.dart index 5029f645fd..171dbe5594 100644 --- a/packages/flutter/test/material/app_bar_theme_test.dart +++ b/packages/flutter/test/material/app_bar_theme_test.dart @@ -343,7 +343,7 @@ void main() { ); } - await tester.pumpWidget(buildFrame(appIconColor: Colors.lime, appBarIconColor: null)); + await tester.pumpWidget(buildFrame(appIconColor: Colors.lime)); expect(getIconText().text.style!.color, Colors.lime); await tester.pumpWidget(buildFrame(appIconColor: Colors.lime, appBarIconColor: Colors.purple)); diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index 615e18fdeb..d42a42410e 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -631,7 +631,6 @@ void main() { darkTheme: ThemeData( brightness: Brightness.dark, ), - themeMode: ThemeMode.system, home: Builder( builder: (BuildContext context) { appliedTheme = Theme.of(context); @@ -657,7 +656,6 @@ void main() { darkTheme: ThemeData( brightness: Brightness.dark, ), - themeMode: ThemeMode.system, home: Builder( builder: (BuildContext context) { appliedTheme = Theme.of(context); diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index 9b198bfb2d..3b409027f5 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -172,9 +172,7 @@ void main() { await tester.pumpWidget( const MaterialApp( home: Scaffold( - bottomNavigationBar: BottomAppBar( - shape: null, - ), + bottomNavigationBar: BottomAppBar(), ), ), ); @@ -194,9 +192,7 @@ void main() { await tester.pumpWidget( const MaterialApp( home: Scaffold( - bottomNavigationBar: ShapeListener(BottomAppBar( - shape: null, - )), + bottomNavigationBar: ShapeListener(BottomAppBar()), floatingActionButton: FloatingActionButton( onPressed: null, child: Icon(Icons.add), @@ -354,12 +350,11 @@ void main() { await tester.pumpWidget( const MaterialApp( home: Scaffold( - bottomNavigationBar: - BottomAppBar( - shape: RectangularNotch(), - notchMargin: 0.0, - child: SizedBox(height: 100.0), - ), + bottomNavigationBar: BottomAppBar( + shape: RectangularNotch(), + notchMargin: 0.0, + child: SizedBox(height: 100.0), + ), ), ), ); diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index 5a8bff6432..88cf921ec8 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -290,7 +290,6 @@ void main() { testWidgets('Padding is calculated properly on items - all labels', (WidgetTester tester) async { const double selectedFontSize = 16.0; - const double unselectedFontSize = 12.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; const IconThemeData selectedIconTheme = IconThemeData(size: selectedIconSize); @@ -304,7 +303,6 @@ void main() { showSelectedLabels: true, showUnselectedLabels: true, selectedFontSize: selectedFontSize, - unselectedFontSize: unselectedFontSize, selectedIconTheme: selectedIconTheme, unselectedIconTheme: unselectedIconTheme, items: const [ @@ -333,7 +331,6 @@ void main() { testWidgets('Padding is calculated properly on items - selected labels only', (WidgetTester tester) async { const double selectedFontSize = 16.0; - const double unselectedFontSize = 12.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; const IconThemeData selectedIconTheme = IconThemeData(size: selectedIconSize); @@ -347,7 +344,6 @@ void main() { showSelectedLabels: true, showUnselectedLabels: false, selectedFontSize: selectedFontSize, - unselectedFontSize: unselectedFontSize, selectedIconTheme: selectedIconTheme, unselectedIconTheme: unselectedIconTheme, items: const [ @@ -375,7 +371,6 @@ void main() { testWidgets('Padding is calculated properly on items - no labels', (WidgetTester tester) async { const double selectedFontSize = 16.0; - const double unselectedFontSize = 12.0; const double selectedIconSize = 36.0; const double unselectedIconSize = 20.0; const IconThemeData selectedIconTheme = IconThemeData(size: selectedIconSize); @@ -389,7 +384,6 @@ void main() { showSelectedLabels: false, showUnselectedLabels: false, selectedFontSize: selectedFontSize, - unselectedFontSize: unselectedFontSize, selectedIconTheme: selectedIconTheme, unselectedIconTheme: unselectedIconTheme, items: const [ @@ -1492,7 +1486,6 @@ void main() { home: Scaffold( bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, - currentIndex: 0, items: List.generate(itemCount, (int itemIndex) { return BottomNavigationBarItem( icon: const Icon(Icons.android), @@ -2032,7 +2025,6 @@ void main() { builder: (BuildContext context) { return Scaffold( bottomNavigationBar: BottomNavigationBar( - currentIndex: 0, items: [ BottomNavigationBarItem( icon: SizedBox(key: icon0, width: 200, height: 10), @@ -2081,7 +2073,6 @@ void main() { builder: (BuildContext context) { return Scaffold( bottomNavigationBar: BottomNavigationBar( - currentIndex: 0, landscapeLayout: BottomNavigationBarLandscapeLayout.centered, items: [ BottomNavigationBarItem( @@ -2126,7 +2117,6 @@ void main() { builder: (BuildContext context) { return Scaffold( bottomNavigationBar: BottomNavigationBar( - currentIndex: 0, landscapeLayout: BottomNavigationBarLandscapeLayout.linear, items: [ BottomNavigationBarItem( diff --git a/packages/flutter/test/material/button_style_test.dart b/packages/flutter/test/material/button_style_test.dart index 998dbc5d47..b9a2640429 100644 --- a/packages/flutter/test/material/button_style_test.dart +++ b/packages/flutter/test/material/button_style_test.dart @@ -164,8 +164,8 @@ void main() { expect(ButtonStyle.lerp(null, null, 0.5), null); expect(ButtonStyle.lerp(null, null, 1), null); - const BorderSide blackSide = BorderSide(width: 1, color: Color(0xFF000000)); - const BorderSide whiteSide = BorderSide(width: 1, color: Color(0xFFFFFFFF)); + const BorderSide blackSide = BorderSide(); + const BorderSide whiteSide = BorderSide(color: Color(0xFFFFFFFF)); const BorderSide emptyBlackSide = BorderSide(width: 0, color: Color(0x00000000)); final ButtonStyle blackStyle = ButtonStyle(side: MaterialStateProperty.all(blackSide)); diff --git a/packages/flutter/test/material/button_theme_test.dart b/packages/flutter/test/material/button_theme_test.dart index 0ff40626cb..ff536ab26f 100644 --- a/packages/flutter/test/material/button_theme_test.dart +++ b/packages/flutter/test/material/button_theme_test.dart @@ -400,6 +400,5 @@ void main() { await tester.pump(const Duration(milliseconds: 800)); // Wait for splash and highlight to be well under way. expect(textColor(), pressedColor); }, - semanticsEnabled: true, ); } diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index 82c64efdc2..3a47e27d4b 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -34,7 +34,7 @@ void main() { child: CalendarDatePicker( key: key, initialDate: initialDate ?? DateTime(2016, DateTime.january, 15), - firstDate: firstDate ?? DateTime(2001, DateTime.january, 1), + firstDate: firstDate ?? DateTime(2001), lastDate: lastDate ?? DateTime(2031, DateTime.december, 31), currentDate: currentDate ?? DateTime(2016, DateTime.january, 3), onDateChanged: onDateChanged ?? (DateTime date) {}, @@ -65,7 +65,7 @@ void main() { key: key, selectedDate: selectedDate ?? DateTime(2016, DateTime.january, 15), initialDate: initialDate ?? DateTime(2016, DateTime.january, 15), - firstDate: firstDate ?? DateTime(2001, DateTime.january, 1), + firstDate: firstDate ?? DateTime(2001), lastDate: lastDate ?? DateTime(2031, DateTime.december, 31), currentDate: currentDate ?? DateTime(2016, DateTime.january, 3), onChanged: onChanged ?? (DateTime date) {}, @@ -96,17 +96,17 @@ void main() { await tester.tap(previousMonthIcon); await tester.pumpAndSettle(); expect(find.text('December 2015'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2015, DateTime.december, 1))); + expect(displayedMonth, equals(DateTime(2015, DateTime.december))); await tester.tap(previousMonthIcon); await tester.pumpAndSettle(); expect(find.text('November 2015'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2015, DateTime.november, 1))); + expect(displayedMonth, equals(DateTime(2015, DateTime.november))); // Go forward a month await tester.tap(nextMonthIcon); await tester.pumpAndSettle(); expect(find.text('December 2015'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2015, DateTime.december, 1))); + expect(displayedMonth, equals(DateTime(2015, DateTime.december))); }); testWidgets('Can select a year', (WidgetTester tester) async { @@ -120,7 +120,7 @@ void main() { await tester.tap(find.text('2018')); await tester.pumpAndSettle(); expect(find.text('January 2018'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2018, DateTime.january, 1))); + expect(displayedMonth, equals(DateTime(2018))); }); testWidgets('Selecting date does not change displayed month', (WidgetTester tester) async { @@ -135,12 +135,12 @@ void main() { await tester.tap(nextMonthIcon); await tester.pumpAndSettle(); expect(find.text('April 2020'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2020, DateTime.april, 1))); + expect(displayedMonth, equals(DateTime(2020, DateTime.april))); await tester.tap(find.text('25')); await tester.pumpAndSettle(); expect(find.text('April 2020'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2020, DateTime.april, 1))); + expect(displayedMonth, equals(DateTime(2020, DateTime.april))); expect(selectedDate, equals(DateTime(2020, DateTime.april, 25))); // There isn't a 31 in April so there shouldn't be one if it is showing April. expect(find.text('31'), findsNothing); @@ -174,7 +174,7 @@ void main() { await tester.tap(find.text('2018')); await tester.pumpAndSettle(); expect(find.text('March 2018'), findsOneWidget); - expect(displayedMonth, equals(DateTime(2018, DateTime.march, 1))); + expect(displayedMonth, equals(DateTime(2018, DateTime.march))); }); testWidgets('Can select a year and then a day', (WidgetTester tester) async { @@ -224,7 +224,7 @@ void main() { await tester.tap(nextMonthIcon); await tester.pumpAndSettle(); - expect(displayedMonth, equals(DateTime(2017, DateTime.february, 1))); + expect(displayedMonth, equals(DateTime(2017, DateTime.february))); // Shouldn't be possible to keep going forward into March. expect(nextMonthIcon, findsNothing); @@ -232,7 +232,7 @@ void main() { await tester.pumpAndSettle(); await tester.tap(previousMonthIcon); await tester.pumpAndSettle(); - expect(displayedMonth, equals(DateTime(2016, DateTime.december, 1))); + expect(displayedMonth, equals(DateTime(2016, DateTime.december))); // Shouldn't be possible to keep going backward into November. expect(previousMonthIcon, findsNothing); }); @@ -272,7 +272,7 @@ void main() { await tester.pumpAndSettle(); // Month should be clamped to June as the range starts at June 2016. expect(find.text('June 2016'), findsOneWidget); - expect(displayedMonth, DateTime(2016, DateTime.june, 1)); + expect(displayedMonth, DateTime(2016, DateTime.june)); }); testWidgets('Selecting lastDate year respects lastDate', (WidgetTester tester) async { @@ -289,7 +289,7 @@ void main() { await tester.pumpAndSettle(); // Month should be clamped to January as the range ends at January 2019. expect(find.text('January 2019'), findsOneWidget); - expect(displayedMonth, DateTime(2019, DateTime.january, 1)); + expect(displayedMonth, DateTime(2019)); }); testWidgets('Only predicate days are selectable', (WidgetTester tester) async { @@ -355,7 +355,7 @@ void main() { final Key pickerKey = UniqueKey(); final DateTime initialDate = DateTime(2020, 1, 21); final DateTime updatedDate = DateTime(1976, 2, 23); - final DateTime firstDate = DateTime(1970, 1, 1); + final DateTime firstDate = DateTime(1970); final DateTime lastDate = DateTime(2099, 31, 12); const Color selectedColor = Color(0xff2196f3); // default primary color @@ -413,7 +413,6 @@ void main() { await tester.pumpWidget(calendarDatePicker( key: pickerKey, - initialCalendarMode: DatePickerMode.day, )); await tester.pumpAndSettle(); @@ -872,7 +871,7 @@ void main() { await tester.pumpAndSettle(); await tester.tap(find.text('2018')); await tester.pumpAndSettle(); - expect(selectedDate, equals(DateTime(2018, DateTime.january, 1))); + expect(selectedDate, equals(DateTime(2018))); }); testWidgets('Cannot select disabled year', (WidgetTester tester) async { @@ -891,7 +890,7 @@ void main() { expect(selectedYear, isNull); await tester.tap(find.text('2018')); await tester.pumpAndSettle(); - expect(selectedYear, equals(DateTime(2018, DateTime.july, 1))); + expect(selectedYear, equals(DateTime(2018, DateTime.july))); }); }); } diff --git a/packages/flutter/test/material/card_test.dart b/packages/flutter/test/material/card_test.dart index 908e14165c..6eb4823d2b 100644 --- a/packages/flutter/test/material/card_test.dart +++ b/packages/flutter/test/material/card_test.dart @@ -87,7 +87,6 @@ void main() { child: Material( child: Center( child: Card( - semanticContainer: true, child: Column( children: const [ Text('First child'), @@ -181,7 +180,7 @@ void main() { clipBehavior: Clip.antiAliasWithSaveLayer, ), ), - child: const Card(clipBehavior: null), + child: const Card(), ); })); expect(tester.widget(find.byType(Material)).clipBehavior, Clip.antiAliasWithSaveLayer); diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart index 2310376de7..cc4d9ee5aa 100644 --- a/packages/flutter/test/material/checkbox_test.dart +++ b/packages/flutter/test/material/checkbox_test.dart @@ -978,7 +978,7 @@ void main() { ); } - await tester.pumpWidget(buildCheckbox(active: false, useOverlay: false)); + await tester.pumpWidget(buildCheckbox(useOverlay: false)); await tester.startGesture(tester.getCenter(find.byType(Checkbox))); await tester.pumpAndSettle(); @@ -1006,7 +1006,7 @@ void main() { reason: 'Default active pressed Checkbox should have overlay color from fillColor', ); - await tester.pumpWidget(buildCheckbox(active: false)); + await tester.pumpWidget(buildCheckbox()); await tester.startGesture(tester.getCenter(find.byType(Checkbox))); await tester.pumpAndSettle(); @@ -1252,7 +1252,7 @@ void main() { expect(getCheckboxRenderer(), isNot(paints..drrect())); // no border expect(getCheckboxRenderer(), paints..path(color: activeColor)); // checkbox fill - await tester.pumpWidget(buildApp(value: null)); + await tester.pumpWidget(buildApp()); await tester.pumpAndSettle(); expect(getCheckboxRenderer(), isNot(paints..drrect())); // no border expect(getCheckboxRenderer(), paints..path(color: activeColor)); // checkbox fill @@ -1305,7 +1305,7 @@ void main() { await tester.pumpAndSettle(); expectBorder(); - await tester.pumpWidget(buildApp(value: null)); + await tester.pumpWidget(buildApp()); await tester.pumpAndSettle(); expectBorder(); }); diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index 7d818fbe48..6fbe965543 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -618,7 +618,6 @@ void main() { expect(tester.getCenter(find.text('ABC')).dx, greaterThan(tester.getCenter(find.byKey(iconKey)).dx)); await tester.pumpWidget( _wrapForChip( - textDirection: TextDirection.ltr, child: test, ), ); @@ -787,7 +786,6 @@ void main() { final GlobalKey keyB = GlobalKey(); await tester.pumpWidget( _wrapForChip( - textDirection: TextDirection.ltr, child: Overlay( initialEntries: [ OverlayEntry( @@ -1415,9 +1413,6 @@ void main() { selected: selected, label: Text('Long Chip Label', key: labelKey), shape: const StadiumBorder(), - showCheckmark: true, - tapEnabled: true, - isEnabled: true, ); }), ], @@ -1497,9 +1492,6 @@ void main() { selected: selected, label: Text('Long Chip Label', key: labelKey), shape: const StadiumBorder(), - showCheckmark: true, - tapEnabled: true, - isEnabled: true, ); }), ], @@ -1575,8 +1567,6 @@ void main() { label: Text('Long Chip Label', key: labelKey), shape: const StadiumBorder(), showCheckmark: false, - tapEnabled: true, - isEnabled: true, ); }), ], @@ -1620,7 +1610,6 @@ void main() { Widget buildChip(ChipThemeData data) { return _wrapForChip( - textDirection: TextDirection.ltr, child: Theme( data: theme, child: const InputChip( @@ -1650,7 +1639,6 @@ void main() { Widget buildChip() { return _wrapForChip( - textDirection: TextDirection.ltr, child: Theme( data: theme, child: const Chip( @@ -1730,7 +1718,6 @@ void main() { return RawChip( showCheckmark: showCheckmark, onDeleted: isDeletable ? () { } : null, - tapEnabled: true, avatar: avatar, deleteIcon: deleteIcon, isEnabled: isSelectable || isPressable, @@ -1776,7 +1763,7 @@ void main() { await tester.pumpAndSettle(); // Check default theme with disabled widget. - await tester.pumpWidget(buildApp(isSelectable: false, isPressable: false, isDeletable: true)); + await tester.pumpWidget(buildApp(isSelectable: false)); await tester.pumpAndSettle(); materialBox = getMaterialBox(tester); labelStyle = getLabelStyle(tester); @@ -1816,8 +1803,6 @@ void main() { await tester.pumpWidget(buildApp( chipTheme: customTheme, isSelectable: false, - isPressable: false, - isDeletable: true, )); await tester.pumpAndSettle(); materialBox = getMaterialBox(tester); @@ -1996,7 +1981,6 @@ void main() { await tester.pumpWidget(MaterialApp( home: Material( child: RawChip( - isEnabled: true, label: const Text('test'), selected: selected, onSelected: (bool value) { @@ -2048,7 +2032,6 @@ void main() { await tester.pumpWidget(MaterialApp( home: Material( child: RawChip( - isEnabled: true, label: const Text('test'), selected: selected, onSelected: (bool value) { @@ -2208,8 +2191,6 @@ void main() { await tester.pumpWidget(MaterialApp( home: Material( child: RawChip( - isEnabled: true, - tapEnabled: true, onPressed: () {}, label: const Text('test'), ), @@ -2263,8 +2244,6 @@ void main() { await tester.pumpWidget(const MaterialApp( home: Material( child: RawChip( - isEnabled: true, - tapEnabled: true, label: Text('test'), ), ), @@ -2317,7 +2296,7 @@ void main() { children: [ Chip( materialTapTargetSize: MaterialTapTargetSize.padded, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + shape: const RoundedRectangleBorder(), avatar: const CircleAvatar(child: Text('A')), label: const Text('Chip A'), onDeleted: () { @@ -2354,7 +2333,6 @@ void main() { const MaterialApp( home: Material( child: RawChip( - selected: false, label: Text('raw chip'), ), ), @@ -2383,7 +2361,6 @@ void main() { home: Material( child: FilterChip( onSelected: (bool valueChanged) { }, - selected: false, label: const Text('filter chip'), ), ), @@ -2397,7 +2374,6 @@ void main() { const MaterialApp( home: Material( child: InputChip( - selected: false, label: Text('input chip'), ), ), @@ -2420,7 +2396,6 @@ void main() { Widget buildChip(ChipThemeData data) { return _wrapForChip( - textDirection: TextDirection.ltr, child: Theme( data: theme, child: inputChip, @@ -2467,7 +2442,7 @@ void main() { children: [ InputChip( materialTapTargetSize: MaterialTapTargetSize.padded, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + shape: const RoundedRectangleBorder(), avatar: const CircleAvatar(child: Text('A')), label: const Text('Chip A'), onPressed: () { @@ -2488,7 +2463,7 @@ void main() { await tester.pumpWidget( _wrapForChip( child: InputChip( - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + shape: const RoundedRectangleBorder(), avatar: const CircleAvatar(child: Text('A')), label: const Text('Chip A'), onPressed: () { }, @@ -2496,7 +2471,7 @@ void main() { ), ); - expect(find.byType(InputChip).hitTestable(at: Alignment.center), findsOneWidget); + expect(find.byType(InputChip).hitTestable(), findsOneWidget); }); void checkChipMaterialClipBehavior(WidgetTester tester, Clip clipBehavior) { @@ -2702,7 +2677,7 @@ void main() { else if (states.contains(MaterialState.selected)) sideColor = selectedColor; - return BorderSide(color: sideColor, width: 1); + return BorderSide(color: sideColor); } Widget chipWidget({ bool enabled = true, bool selected = false }) { @@ -2787,7 +2762,7 @@ void main() { else if (states.contains(MaterialState.selected)) sideColor = selectedColor; - return BorderSide(color: sideColor, width: 1); + return BorderSide(color: sideColor); } Widget chipWidget({ bool enabled = true, bool selected = false }) { @@ -2875,7 +2850,7 @@ void main() { else if (states.contains(MaterialState.selected)) return null; - return BorderSide(color: sideColor, width: 1); + return BorderSide(color: sideColor); } Widget chipWidget({ bool enabled = true, bool selected = false }) { @@ -3018,8 +2993,8 @@ void main() { testWidgets('Chip defers to theme, if shape and side resolves to null', (WidgetTester tester) async { const OutlinedBorder themeShape = StadiumBorder(); const OutlinedBorder selectedShape = RoundedRectangleBorder(); - const BorderSide themeBorderSide = BorderSide(color: Color(0x00000001), width: 1); - const BorderSide selectedBorderSide = BorderSide(color: Color(0x00000002), width: 1); + const BorderSide themeBorderSide = BorderSide(color: Color(0x00000001)); + const BorderSide selectedBorderSide = BorderSide(color: Color(0x00000002)); OutlinedBorder? getShape(Set states) { if (states.contains(MaterialState.selected)) @@ -3071,7 +3046,7 @@ void main() { child: InputChip( focusNode: focusNode, autofocus: true, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + shape: const RoundedRectangleBorder(), avatar: const CircleAvatar(child: Text('A')), label: const Text('Chip A'), onPressed: () { }, @@ -3086,10 +3061,9 @@ void main() { child: InputChip( focusNode: focusNode, autofocus: true, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + shape: const RoundedRectangleBorder(), avatar: const CircleAvatar(child: Text('A')), label: const Text('Chip A'), - onPressed: null, ), ), ); @@ -3114,7 +3088,6 @@ void main() { focusNode: focusNode2, autofocus: true, label: const Text('Chip B'), - onPressed: null, ), ], ), @@ -3240,7 +3213,6 @@ void main() { await _pumpCheckmarkChip( tester, chip: _selectedInputChip(), - brightness: Brightness.light, ); _expectCheckmarkColor( @@ -3253,7 +3225,6 @@ void main() { await _pumpCheckmarkChip( tester, chip: _selectedFilterChip(), - brightness: Brightness.light, ); _expectCheckmarkColor( @@ -3424,7 +3395,6 @@ void main() { _chipWithOptionalDeleteButton( deleteButtonKey: deleteButtonKey, deletable: true, - useDeleteButtonTooltip: true, chipTooltip: 'Chip Tooltip', ), ); diff --git a/packages/flutter/test/material/chip_theme_test.dart b/packages/flutter/test/material/chip_theme_test.dart index a9fa9d184f..2fbdd7792c 100644 --- a/packages/flutter/test/material/chip_theme_test.dart +++ b/packages/flutter/test/material/chip_theme_test.dart @@ -93,16 +93,11 @@ void main() { child: Theme( data: theme, child: RawChip( - showCheckmark: true, onDeleted: () { }, - tapEnabled: true, avatar: const Placeholder(), deleteIcon: const Placeholder(), - isEnabled: true, - selected: false, label: const Text('Chip'), onSelected: (bool newValue) { }, - onPressed: null, ), ), ), @@ -143,16 +138,11 @@ void main() { child: ChipTheme( data: customTheme, child: RawChip( - showCheckmark: true, onDeleted: () { }, - tapEnabled: true, avatar: const Placeholder(), deleteIcon: const Placeholder(), - isEnabled: true, - selected: value, label: const Text('$value'), onSelected: (bool newValue) { }, - onPressed: null, ), ), ), @@ -245,7 +235,7 @@ void main() { elevation: 1.0, labelPadding: const EdgeInsets.symmetric(horizontal: 8.0), shape: const StadiumBorder(), - side: const BorderSide(color: Colors.black), + side: const BorderSide(), pressElevation: 4.0, shadowColor: Colors.black, selectedShadowColor: Colors.black, @@ -297,7 +287,7 @@ void main() { expect(lerpANull25.secondarySelectedColor, equals(Colors.white.withAlpha(0x0f))); expect(lerpANull25.shadowColor, equals(Colors.white.withAlpha(0x40))); expect(lerpANull25.selectedShadowColor, equals(Colors.white.withAlpha(0x40))); - expect(lerpANull25.labelPadding, equals(const EdgeInsets.only(left: 0.0, top: 2.0, right: 0.0, bottom: 2.0))); + expect(lerpANull25.labelPadding, equals(const EdgeInsets.only(top: 2.0, bottom: 2.0))); expect(lerpANull25.padding, equals(const EdgeInsets.all(0.5))); expect(lerpANull25.side!.color, equals(Colors.white.withAlpha(0x3f))); expect(lerpANull25.shape, isA()); @@ -316,7 +306,7 @@ void main() { expect(lerpANull75.secondarySelectedColor, equals(Colors.white.withAlpha(0x2e))); expect(lerpANull75.shadowColor, equals(Colors.white.withAlpha(0xbf))); expect(lerpANull75.selectedShadowColor, equals(Colors.white.withAlpha(0xbf))); - expect(lerpANull75.labelPadding, equals(const EdgeInsets.only(left: 0.0, top: 6.0, right: 0.0, bottom: 6.0))); + expect(lerpANull75.labelPadding, equals(const EdgeInsets.only(top: 6.0, bottom: 6.0))); expect(lerpANull75.padding, equals(const EdgeInsets.all(1.5))); expect(lerpANull75.side!.color, equals(Colors.white.withAlpha(0xbf))); expect(lerpANull75.shape, isA()); @@ -335,7 +325,7 @@ void main() { expect(lerpBNull25.secondarySelectedColor, equals(Colors.black.withAlpha(0x2e))); expect(lerpBNull25.shadowColor, equals(Colors.black.withAlpha(0xbf))); expect(lerpBNull25.selectedShadowColor, equals(Colors.black.withAlpha(0xbf))); - expect(lerpBNull25.labelPadding, equals(const EdgeInsets.only(left: 6.0, top: 0.0, right: 6.0, bottom: 0.0))); + expect(lerpBNull25.labelPadding, equals(const EdgeInsets.only(left: 6.0, right: 6.0))); expect(lerpBNull25.padding, equals(const EdgeInsets.all(3.0))); expect(lerpBNull25.side!.color, equals(Colors.black.withAlpha(0x3f))); expect(lerpBNull25.shape, isA()); @@ -354,7 +344,7 @@ void main() { expect(lerpBNull75.secondarySelectedColor, equals(Colors.black.withAlpha(0x0f))); expect(lerpBNull75.shadowColor, equals(Colors.black.withAlpha(0x40))); expect(lerpBNull75.selectedShadowColor, equals(Colors.black.withAlpha(0x40))); - expect(lerpBNull75.labelPadding, equals(const EdgeInsets.only(left: 2.0, top: 0.0, right: 2.0, bottom: 0.0))); + expect(lerpBNull75.labelPadding, equals(const EdgeInsets.only(left: 2.0, right: 2.0))); expect(lerpBNull75.padding, equals(const EdgeInsets.all(1.0))); expect(lerpBNull75.side!.color, equals(Colors.black.withAlpha(0xbf))); expect(lerpBNull75.shape, isA()); @@ -470,7 +460,7 @@ void main() { if (states.contains(MaterialState.selected)) color = selectedColor; - return BorderSide(color: color, width: 1); + return BorderSide(color: color); } Widget chipWidget({ bool selected = false }) { @@ -509,7 +499,7 @@ void main() { if (states.contains(MaterialState.selected)) color = selectedColor; - return BorderSide(color: color, width: 1); + return BorderSide(color: color); } Widget chipWidget({ bool selected = false }) { diff --git a/packages/flutter/test/material/data_table_test.dart b/packages/flutter/test/material/data_table_test.dart index 6f526f782b..3353a4ea3d 100644 --- a/packages/flutter/test/material/data_table_test.dart +++ b/packages/flutter/test/material/data_table_test.dart @@ -464,7 +464,7 @@ void main() { // Check for ascending list await tester.pumpWidget(MaterialApp( - home: Material(child: buildTable(sortAscending: true)), + home: Material(child: buildTable()), )); // The `tester.widget` ensures that there is exactly one upward arrow. Transform transformOfArrow = tester.widget(find.widgetWithIcon(Transform, Icons.arrow_upward)); @@ -1181,9 +1181,7 @@ void main() { // Turn on sorting await tester.pumpWidget(MaterialApp( - home: Material(child: buildTable( - sortEnabled: true, - )), + home: Material(child: buildTable()), )); { @@ -1290,7 +1288,7 @@ void main() { return tableRow.decoration! as BoxDecoration; } - await tester.pumpWidget(buildTable(selected: false)); + await tester.pumpWidget(buildTable()); expect(lastTableRowBoxDecoration().color, null); await tester.pumpWidget(buildTable(selected: true)); diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index c5de359cb4..055c82e4e1 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -37,7 +37,7 @@ void main() { } setUp(() { - firstDate = DateTime(2001, DateTime.january, 1); + firstDate = DateTime(2001); lastDate = DateTime(2031, DateTime.december, 31); initialDate = DateTime(2016, DateTime.january, 15); today = DateTime(2016, DateTime.january, 3); @@ -383,7 +383,7 @@ void main() { showDatePicker( context: context, initialDate: DateTime(2016, DateTime.january, 15), - firstDate:DateTime(2001, DateTime.january, 1), + firstDate:DateTime(2001), lastDate: DateTime(2031, DateTime.december, 31), builder: (BuildContext context, Widget? child) { return Directionality( @@ -674,7 +674,7 @@ void main() { group('Input mode', () { setUp(() { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2017, DateTime.december, 31); initialDate = DateTime(2016, DateTime.january, 15); initialEntryMode = DatePickerEntryMode.input; @@ -1282,8 +1282,8 @@ class _RestorableDatePickerDialogTestWidgetState extends State<_RestorableDatePi restorationId: 'date_picker_dialog', initialEntryMode: DatePickerEntryMode.values[args['datePickerEntryMode'] as int], initialDate: DateTime.fromMillisecondsSinceEpoch(args['selectedDate'] as int), - firstDate: DateTime(2021, 1, 1), - lastDate: DateTime(2022, 1, 1), + firstDate: DateTime(2021), + lastDate: DateTime(2022), ); }, ); diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index 0a224b3268..9c6f5b98a8 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -28,7 +28,7 @@ void main() { String? saveText; setUp(() { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); currentDate = null; initialDateRange = DateTimeRange( @@ -127,7 +127,7 @@ void main() { }); testWidgets('Last month header should be visible if last date is selected', (WidgetTester tester) async { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); initialDateRange = DateTimeRange( start: lastDate, @@ -141,7 +141,7 @@ void main() { }); testWidgets('First month header should be visible if first date is selected', (WidgetTester tester) async { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); initialDateRange = DateTimeRange( start: firstDate, @@ -156,9 +156,9 @@ void main() { }); testWidgets('Current month header should be visible if no date is selected', (WidgetTester tester) async { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2016, DateTime.december, 31); - currentDate = DateTime(2016, DateTime.september, 1); + currentDate = DateTime(2016, DateTime.september); initialDateRange = null; await preparePicker(tester, (Future range) async { @@ -352,7 +352,7 @@ void main() { onPressed: () { showDateRangePicker( context: context, - firstDate:DateTime(2001, DateTime.january, 1), + firstDate:DateTime(2001), lastDate: DateTime(2031, DateTime.december, 31), builder: (BuildContext context, Widget? child) { return Directionality( @@ -618,7 +618,7 @@ void main() { group('Input mode', () { setUp(() { - firstDate = DateTime(2015, DateTime.january, 1); + firstDate = DateTime(2015); lastDate = DateTime(2017, DateTime.december, 31); initialDateRange = DateTimeRange( start: DateTime(2017, DateTime.january, 15), @@ -814,7 +814,6 @@ void main() { await tester.pumpWidget(MaterialApp( theme: ThemeData.light().copyWith( inputDecorationTheme: const InputDecorationTheme( - filled: false, border: border, ), ), @@ -978,7 +977,7 @@ class _RestorableDateRangePickerDialogTestWidgetState extends State<_RestorableD @override String? get restorationId => 'scaffold_state'; - final RestorableDateTimeN _startDate = RestorableDateTimeN(DateTime(2021, 1, 1)); + final RestorableDateTimeN _startDate = RestorableDateTimeN(DateTime(2021)); final RestorableDateTimeN _endDate = RestorableDateTimeN(DateTime(2021, 1, 5)); late final RestorableRouteFuture _restorableDateRangePickerRouteFuture = RestorableRouteFuture( onComplete: _selectDateRange, @@ -1019,9 +1018,9 @@ class _RestorableDateRangePickerDialogTestWidgetState extends State<_RestorableD return DateRangePickerDialog( restorationId: 'date_picker_dialog', initialEntryMode: DatePickerEntryMode.values[args['datePickerEntryMode'] as int], - firstDate: DateTime(2021, 1, 1), + firstDate: DateTime(2021), currentDate: DateTime(2021, 1, 25), - lastDate: DateTime(2022, 1, 1), + lastDate: DateTime(2022), ); }, ); diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index cd2f4f5271..1d3f6e8aae 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -216,7 +216,6 @@ void main() { testWidgets('Null dialog shape', (WidgetTester tester) async { const AlertDialog dialog = AlertDialog( actions: [ ], - shape: null, ); await tester.pumpWidget(_buildAppWithDialog(dialog)); @@ -1257,9 +1256,7 @@ void main() { ); await tester.pumpWidget( const MediaQuery( - data: MediaQueryData( - viewInsets: EdgeInsets.zero, - ), + data: MediaQueryData(), child: Dialog( child: Placeholder(), ), @@ -1283,9 +1280,7 @@ void main() { // Test with no padding await tester.pumpWidget( const MediaQuery( - data: MediaQueryData( - viewInsets: EdgeInsets.zero, - ), + data: MediaQueryData(), child: Dialog( insetPadding: null, child: Placeholder(), @@ -1298,9 +1293,7 @@ void main() { // Test with an insetPadding await tester.pumpWidget( const MediaQuery( - data: MediaQueryData( - viewInsets: EdgeInsets.zero, - ), + data: MediaQueryData(), child: Dialog( insetPadding: EdgeInsets.fromLTRB(10.0, 20.0, 30.0, 40.0), child: Placeholder(), diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index ab8047d53c..a9d573e9b9 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -51,7 +51,6 @@ void main() { const DialogTheme( backgroundColor: Color(0xff123456), elevation: 8.0, - shape: null, alignment: Alignment.bottomLeft, titleTextStyle: TextStyle(color: Color(0xffffffff)), contentTextStyle: TextStyle(color: Color(0xff000000)), diff --git a/packages/flutter/test/material/drawer_test.dart b/packages/flutter/test/material/drawer_test.dart index f26fb354f6..415366d982 100644 --- a/packages/flutter/test/material/drawer_test.dart +++ b/packages/flutter/test/material/drawer_test.dart @@ -143,7 +143,7 @@ void main() { // Default drawerScrimColor - await tester.pumpWidget(buildFrame(drawerScrimColor: null)); + await tester.pumpWidget(buildFrame()); scaffoldKey.currentState!.openDrawer(); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/material/dropdown_form_field_test.dart b/packages/flutter/test/material/dropdown_form_field_test.dart index e1ad316895..0ccfb18388 100644 --- a/packages/flutter/test/material/dropdown_form_field_test.dart +++ b/packages/flutter/test/material/dropdown_form_field_test.dart @@ -213,8 +213,8 @@ void main() { labelText: 'labelText', ), value: value, + onChanged: null, // this disables the menu and shows the disabledHint. disabledHint: const Text('disabledHint'), - onChanged: null, // disable the menu to show the disabledHint. items: const >[ DropdownMenuItem( value: 1, @@ -365,8 +365,8 @@ void main() { ), value: value, hint: const Text('hint'), - disabledHint: const Text('disabledHint'), onChanged: null, // disabled + disabledHint: const Text('disabledHint'), items: const >[ DropdownMenuItem( value: 1, @@ -409,7 +409,6 @@ void main() { }, items: const >[ DropdownMenuItem( - value: null, child: Text('None'), ), DropdownMenuItem( @@ -531,12 +530,10 @@ void main() { testWidgets('DropdownButtonFormField with isDense:true aligns selected menu item', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - const String value = 'two'; await tester.pumpWidget( buildFormFrame( buttonKey: buttonKey, - value: value, onChanged: onChanged, ), ); @@ -617,7 +614,6 @@ void main() { child: const Text(value), ), ], - isDense: true, onChanged: (_) { }, style: const TextStyle( color: Colors.amber, @@ -652,7 +648,7 @@ void main() { ); } // [disabledHint] should display when [items] is null - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('enabled'), findsNothing); expect(find.text('disabled'), findsOneWidget); @@ -674,11 +670,10 @@ void main() { buttonKey: buttonKey, value: null, hint: const Text('hint used when disabled'), - disabledHint: null, ); } // [hint] should display when [items] is null and [disabledHint] is not defined - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('hint used when disabled'), findsOneWidget); // [hint] should display when [items] is an empty list and [disabledHint] is not defined. @@ -699,7 +694,7 @@ void main() { ); } // [hint] should display when [items] is null and [disabledHint] is not defined - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('hint used when disabled'), findsOneWidget); // [hint] should display when [items] is an empty list and [disabledHint] is not defined. @@ -719,7 +714,7 @@ void main() { ); } // [hint] should display when [items] is null and [disabledHint] is not defined - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('hint used when disabled'), findsOneWidget); // [hint] should display when [items] is an empty list and [disabledHint] is not defined. @@ -740,7 +735,7 @@ void main() { disabledHint: const Text('disabled'), ); } - await tester.pumpWidget(build(items: menuItems, onChanged: null)); + await tester.pumpWidget(build(items: menuItems)); expect(find.text('enabled'), findsNothing); expect(find.text('disabled'), findsOneWidget); }); @@ -757,7 +752,7 @@ void main() { disabledHint: const Text('disabled'), ); } - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); final RenderBox disabledHintBox = tester.renderObject( find.byKey(buttonKey), ); @@ -808,7 +803,6 @@ void main() { debugDisableShadows = false; await tester.pumpWidget(buildFormFrame( buttonKey: buttonKey, - items: menuItems, onChanged: onChanged, )); await tester.tap(find.byKey(buttonKey)); @@ -831,7 +825,6 @@ void main() { await tester.pumpWidget(buildFormFrame( buttonKey: buttonKeyOne, - items: menuItems, elevation: 16, onChanged: onChanged, )); @@ -847,7 +840,6 @@ void main() { await tester.tap(find.text('one').last); await tester.pumpWidget(buildFormFrame( buttonKey: buttonKeyTwo, - items: menuItems, elevation: 24, onChanged: onChanged, )); diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 7543ccb78d..3a8ba4c544 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -331,7 +331,7 @@ bool sameGeometry(RenderBox box1, RenderBox box2) { void main() { testWidgets('Default dropdown golden', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - Widget build() => buildFrame(buttonKey: buttonKey, value: 'two', onChanged: onChanged); + Widget build() => buildFrame(buttonKey: buttonKey, onChanged: onChanged); await tester.pumpWidget(build()); final Finder buttonFinder = find.byKey(buttonKey); assert(tester.renderObject(buttonFinder).attached); @@ -343,7 +343,7 @@ void main() { testWidgets('Expanded dropdown golden', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - Widget build() => buildFrame(buttonKey: buttonKey, value: 'two', isExpanded: true, onChanged: onChanged); + Widget build() => buildFrame(buttonKey: buttonKey, isExpanded: true, onChanged: onChanged); await tester.pumpWidget(build()); final Finder buttonFinder = find.byKey(buttonKey); assert(tester.renderObject(buttonFinder).attached); @@ -693,9 +693,8 @@ void main() { for (final TextDirection textDirection in TextDirection.values) { testWidgets('Dropdown button aligns selected menu item ($textDirection)', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - const String value = 'two'; - Widget build() => buildFrame(buttonKey: buttonKey, value: value, textDirection: textDirection, onChanged: onChanged); + Widget build() => buildFrame(buttonKey: buttonKey, textDirection: textDirection, onChanged: onChanged); await tester.pumpWidget(build()); final RenderBox buttonBox = tester.renderObject(find.byKey(buttonKey)); @@ -742,7 +741,7 @@ void main() { testWidgets('Arrow icon aligns with the edge of button when expanded', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - Widget build() => buildFrame(buttonKey: buttonKey, value: 'two', isExpanded: true, onChanged: onChanged); + Widget build() => buildFrame(buttonKey: buttonKey, isExpanded: true, onChanged: onChanged); await tester.pumpWidget(build()); final RenderBox buttonBox = tester.renderObject(find.byKey(buttonKey)); @@ -807,7 +806,6 @@ void main() { // test for disabled color await tester.pumpWidget(buildFrame( icon: customIcon, - onChanged: null, )); final RichText disabledRichText = tester.widget(_iconRichText(iconKey)); @@ -840,7 +838,6 @@ void main() { iconSize: 30.0, iconEnabledColor: Colors.pink, iconDisabledColor: Colors.orange, - onChanged: null, )); final RichText disabledRichText = tester.widget(_iconRichText(iconKey)); @@ -879,7 +876,6 @@ void main() { iconSize: 30.0, iconEnabledColor: Colors.pink, iconDisabledColor: Colors.orange, - onChanged: null, )); final RichText disabledRichText = tester.widget(_iconRichText(iconKey)); @@ -888,9 +884,8 @@ void main() { testWidgets('Dropdown button with isDense:true aligns selected menu item', (WidgetTester tester) async { final Key buttonKey = UniqueKey(); - const String value = 'two'; - Widget build() => buildFrame(buttonKey: buttonKey, value: value, isDense: true, onChanged: onChanged); + Widget build() => buildFrame(buttonKey: buttonKey, isDense: true, onChanged: onChanged); await tester.pumpWidget(build()); final RenderBox buttonBox = tester.renderObject(find.byKey(buttonKey)); @@ -1214,7 +1209,7 @@ void main() { expect(menuRect.topRight, Offset(menuRect.width, buttonRect.top)); await popUpAndDown( - buildFrame(alignment: Alignment.center, value: menuItems.first, onChanged: onChanged), + buildFrame(value: menuItems.first, onChanged: onChanged), ); expect(menuRect.topLeft, buttonRect.topLeft); expect(menuRect.topRight, buttonRect.topRight); @@ -1272,7 +1267,7 @@ void main() { testWidgets('Semantics Tree contains only selected element', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); - await tester.pumpWidget(buildFrame(items: menuItems, onChanged: onChanged)); + await tester.pumpWidget(buildFrame(onChanged: onChanged)); expect(semantics, isNot(includesNodeWith(label: menuItems[0]))); expect(semantics, includesNodeWith(label: menuItems[1])); @@ -1288,7 +1283,6 @@ void main() { await tester.pumpWidget(buildFrame( buttonKey: key, value: null, - items: menuItems, onChanged: (String? _) { }, hint: const Text('test'), )); @@ -1304,7 +1298,6 @@ void main() { await tester.pumpWidget(buildFrame( buttonKey: key, value: 'three', - items: menuItems, onChanged: onChanged, hint: const Text('test'), )); @@ -1325,7 +1318,6 @@ void main() { await tester.pumpWidget(buildFrame( buttonKey: key, value: null, - items: menuItems, onChanged: onChanged, )); await tester.tap(find.byKey(key)); @@ -1411,7 +1403,7 @@ void main() { ); // [disabledHint] should display when [items] is null - await tester.pumpWidget(build(items: null, onChanged: onChanged)); + await tester.pumpWidget(build(onChanged: onChanged)); expect(find.text('enabled'), findsNothing); expect(find.text('disabled'), findsOneWidget); @@ -1421,7 +1413,7 @@ void main() { expect(find.text('disabled'), findsOneWidget); // [disabledHint] should display when [onChanged] is null - await tester.pumpWidget(build(items: menuItems, onChanged: null)); + await tester.pumpWidget(build(items: menuItems)); expect(find.text('enabled'), findsNothing); expect(find.text('disabled'), findsOneWidget); final RenderBox disabledHintBox = tester.renderObject(find.byKey(buttonKey)); @@ -1447,7 +1439,7 @@ void main() { ); // The selected value should be displayed when the button is disabled. - await tester.pumpWidget(build(items: menuItems, onChanged: null, value: 'two')); + await tester.pumpWidget(build(items: menuItems, value: 'two')); // The dropdown icon and the selected menu item are vertically aligned. expect(tester.getCenter(find.text('two')).dy, tester.getCenter(find.byType(Icon)).dy); @@ -1455,7 +1447,6 @@ void main() { await tester.pumpWidget(build( items: menuItems, onChanged: onChanged, - value: null, hint: const Text('hint'), disabledHint: const Text('disabledHint'), )); @@ -1464,8 +1455,6 @@ void main() { // If [value] is null, the button is disabled, [disabledHint] is displayed when [disabledHint] is non-null. await tester.pumpWidget(build( items: menuItems, - onChanged: null, - value: null, hint: const Text('hint'), disabledHint: const Text('disabledHint'), )); @@ -1474,10 +1463,7 @@ void main() { // If [value] is null, the button is disabled, [hint] is displayed when [disabledHint] is null. await tester.pumpWidget(build( items: menuItems, - onChanged: null, - value: null, hint: const Text('hint'), - disabledHint: null, )); expect(tester.getCenter(find.text('hint')).dy, tester.getCenter(find.byType(Icon)).dy); @@ -1489,10 +1475,6 @@ void main() { // If [value], [hint] and [disabledHint] are null, the button is disabled, nothing displayed. await tester.pumpWidget(build( items: menuItems, - onChanged: null, - value: null, - hint: null, - disabledHint: null, )); expect(getIndex(), null); @@ -1500,9 +1482,6 @@ void main() { await tester.pumpWidget(build( items: menuItems, onChanged: onChanged, - value: null, - hint: null, - disabledHint: null, )); expect(getIndex(), null); }); @@ -1554,7 +1533,7 @@ void main() { expect(textColor('two'), Colors.yellow); // The selected value should be displayed when the button is disabled. - await tester.pumpWidget(build(onChanged: null, value: 'two')); + await tester.pumpWidget(build(value: 'two')); expect(tester.getCenter(find.text('two')).dy, tester.getCenter(find.byType(Icon)).dy); // Selected item has a disabled color from [theme.disabledColor] // when the button is disable. @@ -1573,11 +1552,10 @@ void main() { buttonKey: buttonKey, value: null, hint: const Text('hint used when disabled'), - disabledHint: null, ); } // [hint] should display when [items] is null and [disabledHint] is not defined - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('hint used when disabled'), findsOneWidget); // [hint] should display when [items] is an empty list and [disabledHint] is not defined. @@ -1598,7 +1576,7 @@ void main() { ); } // [hint] should display when [items] is null and [disabledHint] is not defined - await tester.pumpWidget(build(items: null)); + await tester.pumpWidget(build()); expect(find.text('hint used when disabled'), findsOneWidget); // [hint] should display when [items] is an empty list and [disabledHint] is not defined. @@ -1743,7 +1721,6 @@ void main() { ); }).toList(); }, - onChanged: null, )); final RenderBox dropdownButtonRenderBox = tester.renderObject( @@ -1781,7 +1758,6 @@ void main() { ); }).toList(); }, - onChanged: null, )); final RenderBox dropdownButtonRenderBox = tester.renderObject( @@ -1819,7 +1795,6 @@ void main() { ); }).toList(); }, - onChanged: null, )); final RenderBox dropdownButtonRenderBox = tester.renderObject( @@ -1857,7 +1832,6 @@ void main() { ); }).toList(); }, - onChanged: null, )); final RenderBox dropdownButtonRenderBox = tester.renderObject( @@ -1895,7 +1869,6 @@ void main() { MaterialApp( home: Material( child: Align( - alignment: Alignment.center, child: button, ), ), @@ -2006,7 +1979,6 @@ void main() { MaterialApp( home: Material( child: Align( - alignment: Alignment.center, child: button, ), ), @@ -2083,12 +2055,11 @@ void main() { await tester.pumpWidget(buildFrame( buttonKey: buttonKey, underline: customUnderline, - value: 'two', onChanged: onChanged, )); expect(tester.widgetList(decoratedBox).last.decoration, decoration); - await tester.pumpWidget(buildFrame(buttonKey: buttonKey, value: 'two', onChanged: onChanged)); + await tester.pumpWidget(buildFrame(buttonKey: buttonKey, onChanged: onChanged)); expect(tester.widgetList(decoratedBox).last.decoration, defaultDecoration); }); @@ -2370,7 +2341,6 @@ void main() { return DropdownButton( isExpanded: true, elevation: 2, - value: null, hint: LayoutBuilder( builder: (BuildContext context, BoxConstraints constraints) { // Stack with a positioned widget is used to override the @@ -3465,14 +3435,15 @@ void main() { MaterialApp( home: Material( child: DropdownButton( - key: key, - items: ['One', 'Two', 'Three', 'Four'] - .map>((String value) { + key: key, + onChanged: null, + items: ['One', 'Two', 'Three', 'Four'] + .map>((String value) { return DropdownMenuItem( value: value, child: Text(value), ); - }).toList() + }).toList(), ), ), ), diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index 10b14ffbe8..e29c6142cd 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -183,7 +183,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); @@ -358,7 +357,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); elevatedButton = find.byType(ElevatedButton); expect(tester.widget(elevatedButton).enabled, true); @@ -368,7 +367,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); elevatedButton = find.byType(ElevatedButton); expect(tester.widget(elevatedButton).enabled, true); @@ -377,7 +376,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); elevatedButton = find.byType(ElevatedButton); expect(tester.widget(elevatedButton).enabled, false); diff --git a/packages/flutter/test/material/elevated_button_theme_test.dart b/packages/flutter/test/material/elevated_button_theme_test.dart index 86c97ba7c7..db694f4227 100644 --- a/packages/flutter/test/material/elevated_button_theme_test.dart +++ b/packages/flutter/test/material/elevated_button_theme_test.dart @@ -178,7 +178,7 @@ void main() { }); testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { - await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: null, overallStyle: style)); + await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); diff --git a/packages/flutter/test/material/expand_icon_test.dart b/packages/flutter/test/material/expand_icon_test.dart index 2b6fffb391..8acf7071c1 100644 --- a/packages/flutter/test/material/expand_icon_test.dart +++ b/packages/flutter/test/material/expand_icon_test.dart @@ -100,7 +100,6 @@ void main() { await tester.pumpWidget(wrap( child: ExpandIcon( - isExpanded: false, onPressed: (bool isExpanded) { expanded = !expanded; }, @@ -194,7 +193,6 @@ void main() { await tester.pumpWidget(wrap( child: ExpandIcon( - isExpanded: false, onPressed: (bool _) { }, ), )); @@ -276,7 +274,6 @@ void main() { await tester.pumpWidget(wrap( child: const ExpandIcon( - isExpanded: false, onPressed: null, disabledColor: Colors.cyan, ), @@ -287,7 +284,6 @@ void main() { await tester.pumpWidget(wrap( child: const ExpandIcon( - isExpanded: false, onPressed: null, color: Colors.indigo, disabledColor: Colors.cyan, diff --git a/packages/flutter/test/material/expansion_panel_test.dart b/packages/flutter/test/material/expansion_panel_test.dart index 5bb342a7b9..beae622220 100644 --- a/packages/flutter/test/material/expansion_panel_test.dart +++ b/packages/flutter/test/material/expansion_panel_test.dart @@ -89,7 +89,6 @@ class ExpansionPanelListSemanticsTestState extends State[ ExpansionPanel( - canTapOnHeader: false, headerBuilder: (BuildContext context, bool isExpanded) { return MergeSemantics( key: widget.headerKey, @@ -462,21 +461,18 @@ void main() { return Text(isExpanded ? 'B' : 'A'); }, body: const SizedBox(height: 100.0), - isExpanded: false, ), ExpansionPanel( headerBuilder: (BuildContext context, bool isExpanded) { return Text(isExpanded ? 'D' : 'C'); }, body: const SizedBox(height: 100.0), - isExpanded: false, ), ExpansionPanel( headerBuilder: (BuildContext context, bool isExpanded) { return Text(isExpanded ? 'F' : 'E'); }, body: const SizedBox(height: 100.0), - isExpanded: false, ), ]; @@ -924,7 +920,6 @@ void main() { return const Text('Collapsed', key: collapsedKey); }, body: const SizedBox(height: 100.0), - isExpanded: false, ), ]; @@ -1010,7 +1005,6 @@ void main() { }, canTapOnHeader: true, body: const SizedBox(height: 100.0), - isExpanded: false, ), ]; diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 42234d7ddb..68ec473f43 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -78,7 +78,6 @@ void main() { ), ExpansionTile( key: collapsedKey, - initiallyExpanded: false, title: const Text('Collapsed'), children: [ ListTile( @@ -180,7 +179,6 @@ void main() { trailing: TestIcon(key: expandedIconKey), ), ExpansionTile( - initiallyExpanded: false, title: TestText('Collapsed', key: collapsedTitleKey), children: const [ListTile(title: Text('0'))], trailing: TestIcon(key: collapsedIconKey), @@ -242,7 +240,6 @@ void main() { children: const [ ExpansionTile( title: Text('Tile 1'), - initiallyExpanded: false, maintainState: true, children: [ Text('Maintaining State'), @@ -250,8 +247,6 @@ void main() { ), ExpansionTile( title: Text('Title 2'), - initiallyExpanded: false, - maintainState: false, children: [ Text('Discarding State'), ], @@ -538,7 +533,6 @@ void main() { collapsedIconColor: collapsedIconColor, textColor: textColor, collapsedTextColor: collapsedTextColor, - initiallyExpanded: false, title: TestText('title'), trailing: TestIcon(), children: [ diff --git a/packages/flutter/test/material/flat_button_test.dart b/packages/flutter/test/material/flat_button_test.dart index edbe10cb12..08721f4b9c 100644 --- a/packages/flutter/test/material/flat_button_test.dart +++ b/packages/flutter/test/material/flat_button_test.dart @@ -154,13 +154,12 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('FlatButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); - final ColorScheme colorScheme = ColorScheme.fromSwatch(primarySwatch: Colors.blue); + final ColorScheme colorScheme = ColorScheme.fromSwatch(); Color getTextColor(Set states) { final Set interactiveStates = { @@ -219,7 +218,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('FlatButton uses stateful color for text color in different states', (WidgetTester tester) async { @@ -580,7 +578,7 @@ void main() { textDirection: TextDirection.ltr, child: Material( child: MediaQuery( - data: const MediaQueryData(textScaleFactor: 1.0), + data: const MediaQueryData(), child: Center( child: FlatButton( onPressed: () { }, @@ -707,7 +705,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); flatButton = find.byType(FlatButton); expect(tester.widget(flatButton).enabled, true); @@ -717,7 +715,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); flatButton = find.byType(FlatButton); expect(tester.widget(flatButton).enabled, true); @@ -726,7 +724,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); flatButton = find.byType(FlatButton); expect(tester.widget(flatButton).enabled, false); diff --git a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart b/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart index 40f37591c0..6c3b6758fa 100644 --- a/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart +++ b/packages/flutter/test/material/flexible_space_bar_collapse_mode_test.dart @@ -102,7 +102,6 @@ void main() { background: Container( key: appbarContainerKey, ), - collapseMode: CollapseMode.parallax, ), ), SliverToBoxAdapter( diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart index 69ae6dee06..8cbf3f1a79 100644 --- a/packages/flutter/test/material/floating_action_button_location_test.dart +++ b/packages/flutter/test/material/floating_action_button_location_test.dart @@ -11,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('Basic floating action button locations', () { testWidgets('still animates motion when the floating action button is null', (WidgetTester tester) async { - await tester.pumpWidget(_buildFrame(fab: null, location: null)); + await tester.pumpWidget(_buildFrame(fab: null)); expect(find.byType(FloatingActionButton), findsNothing); expect(tester.binding.transientCallbackCount, 0); @@ -641,7 +641,6 @@ void main() { label: '1', ), ], - currentIndex: 0, ) : null, floatingActionButtonLocation: location, floatingActionButton: Builder( diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index 9a0e62f8c7..20d895f3a2 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -909,7 +909,7 @@ void main() { isFocusable: true, ), ); - }, semanticsEnabled: true); + }); testWidgets('Foreground color applies to icon on fab', (WidgetTester tester) async { const Color foregroundColor = Color(0xcafefeed); diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart index 3e4daf2fa4..18f765f93c 100644 --- a/packages/flutter/test/material/icon_button_test.dart +++ b/packages/flutter/test/material/icon_button_test.dart @@ -570,7 +570,6 @@ void main() { child: Center( child: IconButton( onPressed: () {}, - enableFeedback: true, icon: const Icon(Icons.link), ), ), diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart index 5b78b6c1a7..995d65a31b 100644 --- a/packages/flutter/test/material/inherited_theme_test.dart +++ b/packages/flutter/test/material/inherited_theme_test.dart @@ -342,14 +342,11 @@ void main() { ListTile( leading: Icon(Icons.computer, key: selectedIconKey), title: const Text('selected'), - enabled: true, selected: true, ), ListTile( leading: Icon(Icons.add, key: unselectedIconKey), title: const Text('unselected'), - enabled: true, - selected: false, ), ], ), diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart index 7dbf405d16..ade64fd0a6 100644 --- a/packages/flutter/test/material/ink_well_test.dart +++ b/packages/flutter/test/material/ink_well_test.dart @@ -1339,7 +1339,6 @@ void main() { expect(tester.getSemantics(find.bySemanticsLabel('Foo')), matchesSemantics( label: 'Foo', - hasTapAction: false, hasLongPressAction: true, isFocusable: true, textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/input_date_picker_form_field_test.dart b/packages/flutter/test/material/input_date_picker_form_field_test.dart index 047727dcdf..a440bd0aa9 100644 --- a/packages/flutter/test/material/input_date_picker_form_field_test.dart +++ b/packages/flutter/test/material/input_date_picker_form_field_test.dart @@ -36,7 +36,7 @@ void main() { child: InputDatePickerFormField( key: key, initialDate: initialDate ?? DateTime(2016, DateTime.january, 15), - firstDate: firstDate ?? DateTime(2001, DateTime.january, 1), + firstDate: firstDate ?? DateTime(2001), lastDate: lastDate ?? DateTime(2031, DateTime.december, 31), onDateSubmitted: onDateSubmitted, onDateSaved: onDateSaved, @@ -271,7 +271,6 @@ void main() { await tester.pumpWidget(_inputDatePickerField( theme: ThemeData.from(colorScheme: const ColorScheme.light()).copyWith( inputDecorationTheme: const InputDecorationTheme( - filled: false, border: border, ), ), diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 604028ad13..ce700a9f36 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -204,7 +204,6 @@ void main() { // The label appears within the input text when there is content and floatingLabelBehavior is never await tester.pumpWidget( buildInputDecorator( - isEmpty: false, // isFocused: false (default) decoration: const InputDecoration( labelText: 'label', @@ -249,7 +248,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( labelText: 'label', ), @@ -309,7 +307,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( labelText: 'label', enabled: false, @@ -329,7 +326,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( labelText: 'label', enabled: false, @@ -350,7 +346,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( labelText: 'label', alignLabelWithHint: true, @@ -461,7 +456,6 @@ void main() { // the floatingLabelBehavior is set to never. await tester.pumpWidget( buildInputDecorator( - isEmpty: false, // isFocused: false (default) decoration: const InputDecoration( label: Text.rich( @@ -528,7 +522,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( label: Text.rich( TextSpan( @@ -611,7 +604,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( label: Text.rich( TextSpan( @@ -642,7 +634,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( label: Text.rich( TextSpan( @@ -674,7 +665,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, decoration: const InputDecoration( label: Text.rich( TextSpan( @@ -872,7 +862,6 @@ void main() { alignLabelWithHint: alignLabelWithHint, hintText: 'hint', border: const OutlineInputBorder( - borderSide: BorderSide(width: 1, color: Colors.black, style: BorderStyle.solid), borderRadius: BorderRadius.zero, ), ), @@ -1014,7 +1003,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( - isEmpty: false, isFocused: true, decoration: const InputDecoration( labelText: 'label', @@ -1462,7 +1450,6 @@ void main() { labelText: 'label', helperText: kHelper3, helperMaxLines: 3, - errorText: null, filled: true, ), ), @@ -1493,7 +1480,6 @@ void main() { labelText: 'label', helperText: kHelper3, helperMaxLines: 2, - errorText: null, filled: true, ), ), @@ -1514,7 +1500,6 @@ void main() { labelText: 'label', helperText: kHelper2, helperMaxLines: 3, - errorText: null, filled: true, ), ), @@ -1535,7 +1520,6 @@ void main() { labelText: 'label', helperText: kHelper1, helperMaxLines: 3, - errorText: null, filled: true, ), ), @@ -1925,7 +1909,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( - isEmpty: false, isFocused: true, visualDensity: VisualDensity.compact, decoration: const InputDecoration( @@ -2020,7 +2003,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( - isEmpty: false, isFocused: true, visualDensity: const VisualDensity(horizontal: 2.0, vertical: 2.0), decoration: const InputDecoration( @@ -2948,7 +2930,6 @@ void main() { buildInputDecorator( // isEmpty: false (default) // isFocused: false (default) - textDirection: TextDirection.ltr, decoration: const InputDecoration( contentPadding: EdgeInsetsDirectional.only(start: 40.0, top: 12.0, bottom: 12.0), labelText: 'label', @@ -3159,7 +3140,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( isEmpty: true, - isFocused: false, baseStyle: style, decoration: const InputDecoration( hintText: 'hint', @@ -3498,8 +3478,6 @@ void main() { decoration: InputDecoration(), baseStyle: TextStyle(), textAlign: TextAlign.center, - isFocused: false, - isEmpty: false, child: Placeholder(), ); expect( @@ -3958,7 +3936,7 @@ void main() { ); } - await pumpDecorator(focused: false, empty: true); + await pumpDecorator(focused: false); await tester.pumpAndSettle(); expect(getLabelRect(tester).topLeft, equals(const Offset(12, 20))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); @@ -3968,7 +3946,7 @@ void main() { expect(getLabelRect(tester).topLeft, equals(const Offset(12, -5.5))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); - await pumpDecorator(focused: true, empty: true); + await pumpDecorator(focused: true); await tester.pumpAndSettle(); expect(getLabelRect(tester).topLeft, equals(const Offset(12, -5.5))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); @@ -3978,7 +3956,7 @@ void main() { expect(getLabelRect(tester).topLeft, equals(const Offset(12, -5.5))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); - await pumpDecorator(focused: false, empty: true, enabled: false); + await pumpDecorator(focused: false, enabled: false); await tester.pumpAndSettle(); expect(getLabelRect(tester).topLeft, equals(const Offset(12, 20))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); @@ -3989,7 +3967,7 @@ void main() { expect(getLabelRect(tester).size, equals(const Size(80, 16))); // Focused and disabled happens with NavigationMode.directional. - await pumpDecorator(focused: true, empty: true, enabled: false); + await pumpDecorator(focused: true, enabled: false); await tester.pumpAndSettle(); expect(getLabelRect(tester).topLeft, equals(const Offset(12, 20))); expect(getLabelRect(tester).size, equals(const Size(80, 16))); @@ -4061,7 +4039,6 @@ void main() { await tester.pumpWidget( buildInputDecorator( theme: theme, - decoration: const InputDecoration(), ), ); await tester.pumpAndSettle(); @@ -4084,7 +4061,6 @@ void main() { buildInputDecorator( theme: theme, isHovering: true, - decoration: const InputDecoration(), ), ); await tester.pumpAndSettle(); @@ -4095,7 +4071,6 @@ void main() { buildInputDecorator( theme: theme, isFocused: true, - decoration: const InputDecoration(), ), ); await tester.pumpAndSettle(); @@ -4803,7 +4778,7 @@ void main() { child: TextField( decoration: InputDecoration( border: const OutlineInputBorder( - borderSide: BorderSide(color: Colors.greenAccent, width: 1.0), + borderSide: BorderSide(color: Colors.greenAccent), ), suffixIcon: const Icon(Icons.arrow_drop_down), floatingLabelBehavior: floatingLabelBehavior, @@ -5215,8 +5190,7 @@ void main() { await tester.pumpWidget( buildInputDecorator( - isEmpty: true, - isFocused: false, // Label appears inline, on top of the input field. + isEmpty: true, // Label appears inline, on top of the input field. inputDecorationTheme: InputDecorationTheme( labelStyle: labelStyle, // filled: false (default) - don't pad by left/right 12dps diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index b1bcf64e88..03180c4792 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -454,10 +454,7 @@ void main() { testWidgets('ListTile contentPadding', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -499,10 +496,7 @@ void main() { testWidgets('ListTile contentPadding', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -546,10 +540,7 @@ void main() { Widget buildFrame(double leadingWidth, TextDirection textDirection) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -1182,7 +1173,6 @@ void main() { ListTile( title: Text('A', key: childKey), dense: true, - enabled: true, onTap: () {}, ), ], @@ -1230,7 +1220,6 @@ void main() { ListTile( title: Text('A', key: childKey), dense: true, - enabled: true, autofocus: true, onTap: () {}, ), @@ -1954,10 +1943,7 @@ void main() { testWidgets('ListTile horizontalTitleGap = 0.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeHorizontalTitleGap, double? widgetHorizontalTitleGap }) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -2009,10 +1995,7 @@ void main() { testWidgets('ListTile horizontalTitleGap = (default) && ListTile minLeadingWidth = (default)', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -2051,10 +2034,7 @@ void main() { VisualDensity? visualDensity, }) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -2096,10 +2076,7 @@ void main() { testWidgets('ListTile minVerticalPadding = 80.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeMinVerticalPadding, double? widgetMinVerticalPadding }) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -2145,10 +2122,7 @@ void main() { testWidgets('ListTile minLeadingWidth = 60.0', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection, { double? themeMinLeadingWidth, double? widgetMinLeadingWidth }) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( @@ -2326,7 +2300,6 @@ void main() { home: Material( child: Center( child: ListTile( - enabled: true, selected: selected, leading: TestIcon(key: leadingKey), trailing: TestIcon(key: trailingKey), diff --git a/packages/flutter/test/material/material_button_test.dart b/packages/flutter/test/material/material_button_test.dart index d5f68a6931..dcdd6a4e6f 100644 --- a/packages/flutter/test/material/material_button_test.dart +++ b/packages/flutter/test/material/material_button_test.dart @@ -261,7 +261,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('MaterialButton gets focus when autofocus is set.', (WidgetTester tester) async { @@ -317,7 +316,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); materialButton = find.byType(MaterialButton); expect(tester.widget(materialButton).enabled, true); @@ -327,7 +326,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); materialButton = find.byType(MaterialButton); expect(tester.widget(materialButton).enabled, true); @@ -336,7 +335,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); materialButton = find.byType(MaterialButton); expect(tester.widget(materialButton).enabled, false); diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 25689ab3d8..591518cea7 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -97,7 +97,6 @@ void main() { testWidgets('Material implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); const Material( - type: MaterialType.canvas, color: Color(0xFFFFFFFF), shadowColor: Color(0xffff0000), textStyle: TextStyle(color: Color(0xff00ff00)), @@ -190,7 +189,7 @@ void main() { // This code verifies that the PhysicalModel's elevation animates over // a kThemeChangeDuration time interval. - await tester.pumpWidget(buildMaterial(elevation: 0.0)); + await tester.pumpWidget(buildMaterial()); final RenderPhysicalShape modelA = getModel(tester); expect(modelA.elevation, equals(0.0)); @@ -215,7 +214,7 @@ void main() { // This code verifies that the PhysicalModel's shadowColor animates over // a kThemeChangeDuration time interval. - await tester.pumpWidget(buildMaterial(shadowColor: const Color(0xFF00FF00))); + await tester.pumpWidget(buildMaterial()); final RenderPhysicalShape modelA = getModel(tester); expect(modelA.shadowColor, equals(const Color(0xFF00FF00))); @@ -366,7 +365,7 @@ void main() { Theme( data: ThemeData( applyElevationOverlayColor: true, - colorScheme: const ColorScheme.dark(surface: surfaceColor), + colorScheme: const ColorScheme.dark(), ), child: buildMaterial( color: surfaceColor.withOpacity(.75), @@ -548,7 +547,6 @@ void main() { await tester.pumpWidget( Material( key: materialKey, - type: MaterialType.canvas, child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -565,7 +563,6 @@ void main() { await tester.pumpWidget( Material( key: materialKey, - type: MaterialType.canvas, borderRadius: const BorderRadius.all(Radius.circular(5.0)), elevation: 1.0, child: const SizedBox(width: 100.0, height: 100.0), @@ -584,7 +581,6 @@ void main() { await tester.pumpWidget( Material( key: materialKey, - type: MaterialType.canvas, shape: const StadiumBorder(), elevation: 1.0, child: const SizedBox(width: 100.0, height: 100.0), @@ -796,7 +792,6 @@ void main() { height: 300, child: Material( clipBehavior: Clip.hardEdge, - elevation: 0, shape: const RoundedRectangleBorder( side: BorderSide(color: Colors.grey, width: 6), borderRadius: BorderRadius.all(Radius.circular(8)), @@ -835,7 +830,6 @@ void main() { height: 300, child: Material( clipBehavior: Clip.hardEdge, - elevation: 0, shape: const RoundedRectangleBorder( side: BorderSide(color: Colors.grey, width: 6), borderRadius: BorderRadius.all(Radius.circular(8)), diff --git a/packages/flutter/test/material/navigation_bar_test.dart b/packages/flutter/test/material/navigation_bar_test.dart index fa6dba2b77..ee29b6f47f 100644 --- a/packages/flutter/test/material/navigation_bar_test.dart +++ b/packages/flutter/test/material/navigation_bar_test.dart @@ -230,7 +230,7 @@ void main() { ); } - await tester.pumpWidget(_widget(selectedIndex: 0)); + await tester.pumpWidget(_widget()); expect( tester.getSemantics(find.text('AC')), @@ -248,7 +248,6 @@ void main() { label: 'Alarm\nTab 2 of 2', textDirection: TextDirection.ltr, isFocusable: true, - isSelected: false, hasTapAction: true, ), ); @@ -261,7 +260,6 @@ void main() { label: 'AC\nTab 1 of 2', textDirection: TextDirection.ltr, isFocusable: true, - isSelected: false, hasTapAction: true, ), ); @@ -297,7 +295,7 @@ void main() { ); } - await tester.pumpWidget(_widget(selectedIndex: 0)); + await tester.pumpWidget(_widget()); expect( tester.getSemantics(find.text('AC')), @@ -315,7 +313,6 @@ void main() { label: 'Alarm\nTab 2 of 2', textDirection: TextDirection.ltr, isFocusable: true, - isSelected: false, hasTapAction: true, ), ); @@ -328,7 +325,6 @@ void main() { label: 'AC\nTab 1 of 2', textDirection: TextDirection.ltr, isFocusable: true, - isSelected: false, hasTapAction: true, ), ); diff --git a/packages/flutter/test/material/navigation_bar_theme_test.dart b/packages/flutter/test/material/navigation_bar_theme_test.dart index 48c7cb960a..684336ab39 100644 --- a/packages/flutter/test/material/navigation_bar_theme_test.dart +++ b/packages/flutter/test/material/navigation_bar_theme_test.dart @@ -97,7 +97,6 @@ void main() { labelBehavior: labelBehavior, ), child: NavigationBar( - selectedIndex: 0, destinations: _destinations(), ), ), @@ -137,7 +136,6 @@ void main() { height: height, backgroundColor: backgroundColor, labelBehavior: labelBehavior, - selectedIndex: 0, destinations: _destinations(), ), ), diff --git a/packages/flutter/test/material/outline_button_test.dart b/packages/flutter/test/material/outline_button_test.dart index 434760bca2..583b8309e4 100644 --- a/packages/flutter/test/material/outline_button_test.dart +++ b/packages/flutter/test/material/outline_button_test.dart @@ -294,13 +294,12 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('OutlineButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); - final ColorScheme colorScheme = ColorScheme.fromSwatch(primarySwatch: Colors.blue); + final ColorScheme colorScheme = ColorScheme.fromSwatch(); Color getTextColor(Set states) { final Set interactiveStates = { @@ -359,7 +358,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('OutlineButton uses stateful color for text color in different states', (WidgetTester tester) async { @@ -684,7 +682,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); outlineButton = find.byType(OutlineButton); expect(tester.widget(outlineButton).enabled, true); @@ -694,7 +692,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); outlineButton = find.byType(OutlineButton); expect(tester.widget(outlineButton).enabled, true); @@ -703,7 +701,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); outlineButton = find.byType(OutlineButton); expect(tester.widget(outlineButton).enabled, false); @@ -772,7 +770,7 @@ void main() { // Pump a button with a null onPressed callback to make it disabled. await tester.pumpWidget( - buildFrame(onPressed: null), + buildFrame(), ); // Expect that the button is disabled and painted with the disabled border color. @@ -912,7 +910,7 @@ void main() { textDirection: TextDirection.ltr, child: Material( child: MediaQuery( - data: const MediaQueryData(textScaleFactor: 1.0), + data: const MediaQueryData(), child: Center( child: OutlineButton( onPressed: () {}, diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index 3c042ed401..ef30649472 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -43,7 +43,7 @@ void main() { expect(material.shape, isInstanceOf()); RoundedRectangleBorder materialShape = material.shape! as RoundedRectangleBorder; - expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12))); + expect(materialShape.side, BorderSide(color: colorScheme.onSurface.withOpacity(0.12))); expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0))); expect(material.textStyle!.color, colorScheme.primary); @@ -76,7 +76,7 @@ void main() { expect(material.shape, isInstanceOf()); materialShape = material.shape! as RoundedRectangleBorder; - expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12))); + expect(materialShape.side, BorderSide(color: colorScheme.onSurface.withOpacity(0.12))); expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0))); expect(material.textStyle!.color, colorScheme.primary); @@ -117,7 +117,7 @@ void main() { expect(material.shape, isInstanceOf()); materialShape = material.shape! as RoundedRectangleBorder; - expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12))); + expect(materialShape.side, BorderSide(color: colorScheme.onSurface.withOpacity(0.12))); expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0))); expect(material.textStyle!.color, colorScheme.primary); @@ -150,7 +150,7 @@ void main() { expect(material.shape, isInstanceOf()); materialShape = material.shape! as RoundedRectangleBorder; - expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12))); + expect(materialShape.side, BorderSide(color: colorScheme.onSurface.withOpacity(0.12))); expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0))); expect(material.textStyle!.color, colorScheme.onSurface.withOpacity(0.38)); @@ -294,7 +294,6 @@ void main() { await gesture.removePointer(); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('OutlinedButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { @@ -314,7 +313,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue)), + theme: ThemeData.from(colorScheme: ColorScheme.fromSwatch()), home: Scaffold( backgroundColor: Colors.white, body: Center( @@ -365,7 +364,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('OutlinedButton uses stateful color for text color in different states', (WidgetTester tester) async { @@ -514,15 +512,15 @@ void main() { BorderSide getBorderSide(Set states) { if (states.contains(MaterialState.pressed)) { - return const BorderSide(color: pressedColor, width: 1); + return const BorderSide(color: pressedColor); } if (states.contains(MaterialState.hovered)) { - return const BorderSide(color: hoverColor, width: 1); + return const BorderSide(color: hoverColor); } if (states.contains(MaterialState.focused)) { - return const BorderSide(color: focusedColor, width: 1); + return const BorderSide(color: focusedColor); } - return const BorderSide(color: defaultColor, width: 1); + return const BorderSide(color: defaultColor); } await tester.pumpWidget( @@ -588,7 +586,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); outlinedButton = find.byType(OutlinedButton); expect(tester.widget(outlinedButton).enabled, true); @@ -598,7 +596,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); outlinedButton = find.byType(OutlinedButton); expect(tester.widget(outlinedButton).enabled, true); @@ -607,7 +605,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); outlinedButton = find.byType(OutlinedButton); expect(tester.widget(outlinedButton).enabled, false); @@ -858,7 +856,7 @@ void main() { // Pump a button with a null onPressed callback to make it disabled. await tester.pumpWidget( - buildFrame(onPressed: null), + buildFrame(), ); // Expect that the button is disabled and painted with the disabled border color. @@ -983,7 +981,7 @@ void main() { textDirection: TextDirection.ltr, child: Material( child: MediaQuery( - data: const MediaQueryData(textScaleFactor: 1.0), + data: const MediaQueryData(), child: Center( child: OutlinedButton( style: ButtonStyle( diff --git a/packages/flutter/test/material/outlined_button_theme_test.dart b/packages/flutter/test/material/outlined_button_theme_test.dart index 6662ea2fd4..fd71f2827e 100644 --- a/packages/flutter/test/material/outlined_button_theme_test.dart +++ b/packages/flutter/test/material/outlined_button_theme_test.dart @@ -36,7 +36,7 @@ void main() { expect(material.shape, isInstanceOf()); final RoundedRectangleBorder materialShape = material.shape! as RoundedRectangleBorder; - expect(materialShape.side, BorderSide(width: 1, color: colorScheme.onSurface.withOpacity(0.12))); + expect(materialShape.side, BorderSide(color: colorScheme.onSurface.withOpacity(0.12))); expect(materialShape.borderRadius, const BorderRadius.all(Radius.circular(4.0))); expect(material.textStyle!.color, colorScheme.primary); @@ -181,7 +181,7 @@ void main() { }); testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { - await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: null, overallStyle: style)); + await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart index 2b1a77b888..f5321ebd5b 100644 --- a/packages/flutter/test/material/page_test.dart +++ b/packages/flutter/test/material/page_test.dart @@ -879,7 +879,7 @@ void main() { expect(find.text('second'), findsOneWidget); myPages = >[ - MaterialPage(key: pageKeyOne, maintainState: true, child: const Text('first')), + MaterialPage(key: pageKeyOne, child: const Text('first')), MaterialPage(key: pageKeyTwo, child: const Text('second')), ]; diff --git a/packages/flutter/test/material/paginated_data_table_test.dart b/packages/flutter/test/material/paginated_data_table_test.dart index 23b5a8f826..ab3b89aed6 100644 --- a/packages/flutter/test/material/paginated_data_table_test.dart +++ b/packages/flutter/test/material/paginated_data_table_test.dart @@ -302,7 +302,6 @@ void main() { header: header != null ? Text(header) : null, actions: actions, source: TestDataSource(allowSelection: true), - showCheckboxColumn: true, columns: const [ DataColumn(label: Text('Name')), DataColumn(label: Text('Calories'), numeric: true), @@ -862,7 +861,6 @@ void main() { home: PaginatedDataTable( header: const Text('Test table'), source: TestDataSource(allowSelection: true), - showCheckboxColumn: true, columns: const [ DataColumn(label: Text('Name')), DataColumn(label: Text('Calories'), numeric: true), diff --git a/packages/flutter/test/material/persistent_bottom_sheet_test.dart b/packages/flutter/test/material/persistent_bottom_sheet_test.dart index 175bec0a63..5ef26fd914 100644 --- a/packages/flutter/test/material/persistent_bottom_sheet_test.dart +++ b/packages/flutter/test/material/persistent_bottom_sheet_test.dart @@ -466,7 +466,6 @@ void main() { await tester.pumpWidget( const MaterialApp( home: Scaffold( - bottomSheet: null, body: Placeholder(), ), ), diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index fe9e6c277c..f2a1b1a513 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -438,7 +438,6 @@ void main() { itemBuilderCalled = true; return >[ PopupMenuItem( - enabled: true, value: 1, child: Text('Tap me please!', key: childKey), ), diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index 5c49e9924e..2d81980be7 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -50,7 +50,7 @@ void main() { child: Center( child: SizedBox( width: 200.0, - child: LinearProgressIndicator(value: null), + child: LinearProgressIndicator(), ), ), ), @@ -368,7 +368,7 @@ void main() { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( const Center( - child: CircularProgressIndicator(value: null), + child: CircularProgressIndicator(), ), ); diff --git a/packages/flutter/test/material/radio_test.dart b/packages/flutter/test/material/radio_test.dart index c3ccf6fb6d..34baceb074 100644 --- a/packages/flutter/test/material/radio_test.dart +++ b/packages/flutter/test/material/radio_test.dart @@ -1007,7 +1007,7 @@ void main() { ); } - await tester.pumpWidget(buildRadio(active: false, useOverlay: false)); + await tester.pumpWidget(buildRadio(useOverlay: false)); await tester.press(_findRadio()); await tester.pumpAndSettle(); @@ -1035,7 +1035,7 @@ void main() { reason: 'Default active pressed Radio should have overlay color from fillColor', ); - await tester.pumpWidget(buildRadio(active: false)); + await tester.pumpWidget(buildRadio()); await tester.press(_findRadio()); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/material/raised_button_test.dart b/packages/flutter/test/material/raised_button_test.dart index 200da4c17e..5ea00505ce 100644 --- a/packages/flutter/test/material/raised_button_test.dart +++ b/packages/flutter/test/material/raised_button_test.dart @@ -156,7 +156,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('RaisedButton uses stateful color for text color in different states', (WidgetTester tester) async { @@ -350,7 +349,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); raisedButton = find.byType(RaisedButton); expect(tester.widget(raisedButton).enabled, true); @@ -360,7 +359,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); raisedButton = find.byType(RaisedButton); expect(tester.widget(raisedButton).enabled, true); @@ -369,7 +368,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); raisedButton = find.byType(RaisedButton); expect(tester.widget(raisedButton).enabled, false); diff --git a/packages/flutter/test/material/range_slider_test.dart b/packages/flutter/test/material/range_slider_test.dart index a4727ae664..03a3f17af4 100644 --- a/packages/flutter/test/material/range_slider_test.dart +++ b/packages/flutter/test/material/range_slider_test.dart @@ -134,7 +134,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0.0, max: 100.0, divisions: 10, onChanged: (RangeValues newValues) { @@ -193,7 +192,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -340,7 +338,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -387,7 +384,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -534,7 +530,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -587,7 +582,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -740,7 +734,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -793,7 +786,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, divisions: 10, onChanged: (RangeValues newValues) { @@ -848,7 +840,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, onChanged: (RangeValues newValues) { setState(() { @@ -903,7 +894,6 @@ void main() { child: Center( child: RangeSlider( values: values, - min: 0, max: 100, onChanged: (RangeValues newValues) { setState(() { @@ -1702,7 +1692,6 @@ void main() { child: Material( child: RangeSlider( values: const RangeValues(10.0, 12.0), - min: 0.0, max: 100.0, onChanged: (RangeValues v) { }, ), @@ -1757,11 +1746,7 @@ void main() { inactiveColor: Colors.grey, labels: const RangeLabels('lowerValue', 'upperValue'), max: 100.0, - min: 0.0, onChanged: null, - onChangeEnd: null, - onChangeStart: null, - semanticFormatterCallback: null, values: const RangeValues(25.0, 75.0), ).debugFillProperties(builder); diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart index 27f6f60205..d42b02e751 100644 --- a/packages/flutter/test/material/raw_material_button_test.dart +++ b/packages/flutter/test/material/raw_material_button_test.dart @@ -236,7 +236,6 @@ void main() { await tester.pumpWidget( MaterialApp( home: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ RawMaterialButton( materialTapTargetSize: MaterialTapTargetSize.padded, @@ -457,7 +456,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); rawMaterialButton = find.byType(RawMaterialButton); expect(tester.widget(rawMaterialButton).enabled, true); @@ -467,7 +466,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); rawMaterialButton = find.byType(RawMaterialButton); expect(tester.widget(rawMaterialButton).enabled, true); @@ -476,7 +475,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); rawMaterialButton = find.byType(RawMaterialButton); expect(tester.widget(rawMaterialButton).enabled, false); diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index f250ccb34f..34ce29cd0c 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -73,7 +73,6 @@ void main() { final List currentListItems = listItems.take(1).toList(); final ReorderableListView reorderableListView = ReorderableListView( header: const Text('Header'), - scrollDirection: Axis.vertical, onReorder: (_, __) => onReorderWasCalled = true, children: currentListItems.map(listItemToWidget).toList(), ); @@ -160,7 +159,6 @@ void main() { testWidgets('properly determines the vertical drop area extents', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( - scrollDirection: Axis.vertical, onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( @@ -340,7 +338,6 @@ void main() { width: 100, height: 100, child: ReorderableListView( - scrollDirection: Axis.vertical, children: const [ SizedBox(key: firstBox, width: 10, height: 10), ], @@ -624,7 +621,6 @@ void main() { testWidgets("Doesn't hide accessibility when a child declares its own semantics", (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final Widget reorderableListView = ReorderableListView( - scrollDirection: Axis.vertical, onReorder: (int oldIndex, int newIndex) { }, children: [ const SizedBox( @@ -1320,7 +1316,6 @@ void main() { testWidgets('Animation test when placing an item in place', (WidgetTester tester) async { const Key testItemKey = Key('Test item'); final Widget reorderableListView = ReorderableListView( - scrollDirection: Axis.vertical, onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 58623f1fda..139a372c14 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -252,7 +252,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -431,7 +430,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -522,7 +520,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -1177,7 +1174,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.only(bottom: 20), viewInsets: EdgeInsets.only(bottom: 300), ), @@ -1367,7 +1363,6 @@ void main() { MaterialApp( home: SafeArea( left: false, - top: true, right: false, bottom: false, child: Scaffold( @@ -1424,7 +1419,6 @@ void main() { MaterialApp( home: SafeArea( left: false, - top: true, right: false, bottom: false, child: Scaffold( @@ -1643,7 +1637,6 @@ void main() { drawer: const Drawer( child: Text('Drawer'), ), - drawerEnableOpenDragGesture: true, body: const Text('Scaffold Body'), appBar: AppBar( centerTitle: true, @@ -1712,7 +1705,6 @@ void main() { endDrawer: const Drawer( child: Text('Drawer'), ), - endDrawerEnableOpenDragGesture: true, body: const Text('Scaffold Body'), appBar: AppBar( centerTitle: true, @@ -2076,7 +2068,6 @@ void main() { child: const Icon(Icons.add), ), floatingActionButtonLocation: FloatingActionButtonLocation.endTop, - extendBodyBehindAppBar: false, ), )); final Offset defaultOffset = tester.getCenter(find.byType(FloatingActionButton)); diff --git a/packages/flutter/test/material/scrollbar_test.dart b/packages/flutter/test/material/scrollbar_test.dart index 648d7c1d0b..8910d40391 100644 --- a/packages/flutter/test/material/scrollbar_test.dart +++ b/packages/flutter/test/material/scrollbar_test.dart @@ -1095,7 +1095,6 @@ void main() { behavior: const NoScrollbarBehavior(), child: Scrollbar( key: key2, - notificationPredicate: null, child: SingleChildScrollView( key: outerKey, child: SizedBox( @@ -1105,7 +1104,6 @@ void main() { children: [ Scrollbar( key: key1, - notificationPredicate: null, child: SizedBox( height: 300.0, width: double.infinity, diff --git a/packages/flutter/test/material/search_test.dart b/packages/flutter/test/material/search_test.dart index 56ee34a87e..bb97fbef24 100644 --- a/packages/flutter/test/material/search_test.dart +++ b/packages/flutter/test/material/search_test.dart @@ -321,7 +321,6 @@ void main() { await tester.pumpWidget(TestHomePage( delegate: delegate, passInInitialQuery: true, - initialQuery: null, )); await tester.tap(find.byTooltip('Search')); await tester.pumpAndSettle(); @@ -335,7 +334,6 @@ void main() { await tester.pumpWidget(TestHomePage( delegate: delegate, passInInitialQuery: true, - initialQuery: null, )); await tester.tap(find.byTooltip('Search')); await tester.pumpAndSettle(); @@ -357,7 +355,6 @@ void main() { await tester.pumpWidget(TestHomePage( delegate: delegate, passInInitialQuery: true, - initialQuery: null, )); // runs while search fades in @@ -789,10 +786,7 @@ void main() { testWidgets('`Leading` and `Actions` nullable test', (WidgetTester tester) async { // The search delegate page is displayed with no issues // even with a null return values for [buildLeading] and [buildActions]. - final _TestEmptySearchDelegate delegate = _TestEmptySearchDelegate( - result: 'Result', - suggestions: 'Suggestions', - ); + final _TestEmptySearchDelegate delegate = _TestEmptySearchDelegate(); final List selectedResults = []; await tester.pumpWidget(TestHomePage( @@ -831,10 +825,7 @@ void main() { final _MyNavigatorObserver rootObserver = _MyNavigatorObserver(); final _MyNavigatorObserver localObserver = _MyNavigatorObserver(); - final _TestEmptySearchDelegate delegate = _TestEmptySearchDelegate( - result: 'Result', - suggestions: 'Suggestions', - ); + final _TestEmptySearchDelegate delegate = _TestEmptySearchDelegate(); await tester.pumpWidget(MaterialApp( navigatorObservers: [rootObserver], diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index 2a65e60378..8897d5e3e7 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -476,7 +476,6 @@ void main() { width: 144.0 + 2 * 16.0, // _kPreferredTotalWidth child: Slider( key: sliderKey, - min: 0.0, max: 100.0, divisions: 10, value: value, @@ -522,8 +521,6 @@ void main() { child: Material( child: Slider( value: 0.0, - min: 0.0, - max: 1.0, onChanged: (double newValue) { log.add(newValue); }, @@ -544,7 +541,6 @@ void main() { child: Material( child: Slider( value: 0.0, - min: 0.0, max: 0.0, onChanged: (double newValue) { log.add(newValue); @@ -992,7 +988,6 @@ void main() { maxHeight: double.infinity, child: Slider( key: sliderKey, - min: 0.0, max: 100.0, divisions: isDiscrete ? 10 : null, label: '${value.round()}', @@ -1125,7 +1120,6 @@ void main() { child: Material( child: Center( child: Slider( - min: 0.0, max: 100.0, divisions: divisions, value: 0.25, @@ -1459,7 +1453,6 @@ void main() { child: Material( child: Slider( value: 100.0, - min: 0.0, max: 200.0, onChanged: (double v) { }, ), @@ -1568,7 +1561,6 @@ void main() { child: Material( child: Slider( value: 40.0, - min: 0.0, max: 200.0, divisions: 10, semanticFormatterCallback: (double value) => value.round().toString(), @@ -1952,30 +1944,30 @@ void main() { } // Default (showValueIndicator set to onlyForDiscrete). - await expectValueIndicator(isVisible: true, theme: theme, divisions: 3, enabled: true); + await expectValueIndicator(isVisible: true, theme: theme, divisions: 3); await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: false); - await expectValueIndicator(isVisible: false, theme: theme, enabled: true); + await expectValueIndicator(isVisible: false, theme: theme); await expectValueIndicator(isVisible: false, theme: theme, enabled: false); // With showValueIndicator set to onlyForContinuous. theme = theme.copyWith(showValueIndicator: ShowValueIndicator.onlyForContinuous); - await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: true); + await expectValueIndicator(isVisible: false, theme: theme, divisions: 3); await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: false); - await expectValueIndicator(isVisible: true, theme: theme, enabled: true); + await expectValueIndicator(isVisible: true, theme: theme); await expectValueIndicator(isVisible: false, theme: theme, enabled: false); // discrete enabled widget with showValueIndicator set to always. theme = theme.copyWith(showValueIndicator: ShowValueIndicator.always); - await expectValueIndicator(isVisible: true, theme: theme, divisions: 3, enabled: true); + await expectValueIndicator(isVisible: true, theme: theme, divisions: 3); await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: false); - await expectValueIndicator(isVisible: true, theme: theme, enabled: true); + await expectValueIndicator(isVisible: true, theme: theme); await expectValueIndicator(isVisible: false, theme: theme, enabled: false); // discrete enabled widget with showValueIndicator set to never. theme = theme.copyWith(showValueIndicator: ShowValueIndicator.never); - await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: true); + await expectValueIndicator(isVisible: false, theme: theme, divisions: 3); await expectValueIndicator(isVisible: false, theme: theme, divisions: 3, enabled: false); - await expectValueIndicator(isVisible: false, theme: theme, enabled: true); + await expectValueIndicator(isVisible: false, theme: theme); await expectValueIndicator(isVisible: false, theme: theme, enabled: false); }); @@ -2009,13 +2001,13 @@ void main() { ); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byKey(sliderKey))); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(value, equals(0.5)); await gesture.moveBy(const Offset(-500.0, 0.0)); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); // Change the tree to dispose the original widget. await tester.pumpWidget(Container()); - expect(await tester.pumpAndSettle(const Duration(milliseconds: 100)), equals(1)); + expect(await tester.pumpAndSettle(), equals(1)); await gesture.up(); }); @@ -2039,7 +2031,6 @@ void main() { children: [ Slider( key: sliderKey, - min: 0.0, max: 100.0, divisions: divisions, label: '${value.round()}', @@ -2295,11 +2286,7 @@ void main() { inactiveColor: Colors.grey, label: 'Set a value', max: 100.0, - min: 0.0, onChanged: null, - onChangeEnd: null, - onChangeStart: null, - semanticFormatterCallback: null, value: 50.0, ).debugFillProperties(builder); diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 7c61bc1e27..1d00f37a61 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -1136,17 +1136,13 @@ void main() { ..rrect(rrect: RRect.fromLTRBAndCorners( 24.0, 298.0, 24.0, 302.0, topLeft: const Radius.circular(2.0), - topRight: Radius.zero, - bottomRight: Radius.zero, bottomLeft: const Radius.circular(2.0), )) ..rect(rect: const Rect.fromLTRB(24.0, 297.0, 24.0, 303.0)) ..rrect(rrect: RRect.fromLTRBAndCorners( 24.0, 298.0, 776.0, 302.0, - topLeft: Radius.zero, topRight: const Radius.circular(2.0), bottomRight: const Radius.circular(2.0), - bottomLeft: Radius.zero, )) ..circle(x: 24.0, y: 300.0) ..shadow(elevation: 1.0) diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index ccc3ab1d8a..2d4901d6f8 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -741,8 +741,7 @@ void main() { dialogTheme: const DialogTheme(backgroundColor: Colors.black), floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: Colors.black), navigationRailTheme: const NavigationRailThemeData(backgroundColor: Colors.black), - typography: Typography.material2018(platform: TargetPlatform.android), - cupertinoOverrideTheme: null, + typography: Typography.material2018(), snackBarTheme: const SnackBarThemeData(backgroundColor: Colors.black), bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.black), popupMenuTheme: const PopupMenuThemeData(color: Colors.black), @@ -1919,7 +1918,6 @@ void main() { await tester.pumpWidget( MediaQuery( data: const MediaQueryData( - padding: EdgeInsets.zero, viewPadding: EdgeInsets.all(20), viewInsets: EdgeInsets.all(100), ), diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index 89b580ee33..9d66e1a400 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -583,7 +583,6 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async Step( title: const Text('Step 2'), content: Stepper( - type: StepperType.vertical, steps: const [ Step( title: Text('Nested step 1'), @@ -702,8 +701,6 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async MaterialApp( home: Material( child: Stepper( - currentStep: 0, - type: StepperType.vertical, steps: const [ Step( title: Text('Step 0'), @@ -728,7 +725,6 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async MaterialApp( home: Material( child: Stepper( - currentStep: 0, type: StepperType.horizontal, steps: const [ Step( @@ -966,7 +962,7 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async // Light theme final ColorScheme light = ThemeData.light().colorScheme; - await tester.pumpWidget(buildFrame(isActive: true, brightness: Brightness.light)); + await tester.pumpWidget(buildFrame(brightness: Brightness.light)); expect(circleFillColor(), light.primary); await tester.pumpWidget(buildFrame(isActive: false, brightness: Brightness.light)); await tester.pumpAndSettle(); @@ -974,7 +970,7 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async // Dark theme final ColorScheme dark = ThemeData.dark().colorScheme; - await tester.pumpWidget(buildFrame(isActive: true, brightness: Brightness.dark)); + await tester.pumpWidget(buildFrame(brightness: Brightness.dark)); await tester.pumpAndSettle(); expect(circleFillColor(), dark.secondary); await tester.pumpWidget(buildFrame(isActive: false, brightness: Brightness.dark)); @@ -1134,7 +1130,6 @@ testWidgets('Stepper custom indexed controls test', (WidgetTester tester) async height: 75, child: Stepper( margin: margin, - type: StepperType.vertical, steps: const [ Step( title: Text('Regular title'), diff --git a/packages/flutter/test/material/switch_list_tile_test.dart b/packages/flutter/test/material/switch_list_tile_test.dart index 74121e7dbb..6ce3a4aee6 100644 --- a/packages/flutter/test/material/switch_list_tile_test.dart +++ b/packages/flutter/test/material/switch_list_tile_test.dart @@ -73,7 +73,6 @@ void main() { TestSemantics.rootChild( id: 1, rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 56.0), - transform: null, flags: [ SemanticsFlag.hasEnabledState, SemanticsFlag.hasToggledState, @@ -220,10 +219,7 @@ void main() { testWidgets('SwitchListTile contentPadding', (WidgetTester tester) async { Widget buildFrame(TextDirection textDirection) { return MediaQuery( - data: const MediaQueryData( - padding: EdgeInsets.zero, - textScaleFactor: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: textDirection, child: Material( diff --git a/packages/flutter/test/material/switch_test.dart b/packages/flutter/test/material/switch_test.dart index 27131c5e00..c15d1dc91e 100644 --- a/packages/flutter/test/material/switch_test.dart +++ b/packages/flutter/test/material/switch_test.dart @@ -241,7 +241,6 @@ void main() { return Material( child: Center( child: Switch( - dragStartBehavior: DragStartBehavior.start, value: value, onChanged: (bool newValue) { setState(() { @@ -1600,7 +1599,7 @@ void main() { ); } - await tester.pumpWidget(buildSwitch(active: false, useOverlay: false)); + await tester.pumpWidget(buildSwitch(useOverlay: false)); await tester.press(find.byType(Switch)); await tester.pumpAndSettle(); @@ -1630,7 +1629,7 @@ void main() { reason: 'Default active pressed Switch should have overlay color from thumbColor', ); - await tester.pumpWidget(buildSwitch(active: false)); + await tester.pumpWidget(buildSwitch()); await tester.press(find.byType(Switch)); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/material/tab_bar_theme_test.dart b/packages/flutter/test/material/tab_bar_theme_test.dart index 18bcaaba00..319554c2ae 100644 --- a/packages/flutter/test/material/tab_bar_theme_test.dart +++ b/packages/flutter/test/material/tab_bar_theme_test.dart @@ -290,8 +290,7 @@ void main() { testWidgets('Tab bar theme - custom tab indicator', (WidgetTester tester) async { final TabBarTheme tabBarTheme = TabBarTheme( indicator: BoxDecoration( - border: Border.all(color: Colors.black), - shape: BoxShape.rectangle, + border: Border.all(), ), ); diff --git a/packages/flutter/test/material/tabbed_scrollview_warp_test.dart b/packages/flutter/test/material/tabbed_scrollview_warp_test.dart index b167fd2e11..bfc55deaa3 100644 --- a/packages/flutter/test/material/tabbed_scrollview_warp_test.dart +++ b/packages/flutter/test/material/tabbed_scrollview_warp_test.dart @@ -37,7 +37,7 @@ class _MyHomePageState extends State with TickerProviderStateMixin { @override void initState() { super.initState(); - tabController = TabController(initialIndex: 0, length: tabCount, vsync: this); + tabController = TabController(length: tabCount, vsync: this); } @override diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 5bd2223856..374f5e5496 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -89,7 +89,6 @@ class _NestedTabBarContainer extends StatelessWidget { ], ), Expanded( - flex: 1, child: TabBarView( controller: tabController, children: [ @@ -325,7 +324,7 @@ void main() { testWidgets('TabBar tap selects tab', (WidgetTester tester) async { final List tabs = ['A', 'B', 'C']; - await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', isScrollable: false)); + await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C')); expect(find.text('A'), findsOneWidget); expect(find.text('B'), findsOneWidget); expect(find.text('C'), findsOneWidget); @@ -334,7 +333,7 @@ void main() { expect(controller.index, 2); expect(controller.previousIndex, 2); - await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', isScrollable: false)); + await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C')); await tester.tap(find.text('B')); await tester.pump(); expect(controller.indexIsChanging, true); @@ -343,14 +342,14 @@ void main() { expect(controller.previousIndex, 2); expect(controller.indexIsChanging, false); - await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', isScrollable: false)); + await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C')); await tester.tap(find.text('C')); await tester.pump(); await tester.pump(const Duration(seconds: 1)); expect(controller.index, 2); expect(controller.previousIndex, 1); - await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', isScrollable: false)); + await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C')); await tester.tap(find.text('A')); await tester.pump(); await tester.pump(const Duration(seconds: 1)); @@ -1901,8 +1900,6 @@ void main() { child: TabBar( padding: padding, labelPadding: EdgeInsets.zero, - indicatorPadding: EdgeInsets.zero, - isScrollable: false, controller: controller, tabs: tabs, ), @@ -1958,7 +1955,6 @@ void main() { child: TabBar( padding: padding, labelPadding: EdgeInsets.zero, - indicatorPadding: EdgeInsets.zero, isScrollable: true, controller: controller, tabs: tabs, @@ -2219,7 +2215,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: tabs.length, - initialIndex: 0, ); await tester.pumpWidget( @@ -2293,7 +2288,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: tabs.length, - initialIndex: 0, ); await tester.pumpWidget( @@ -2437,7 +2431,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: 2, - initialIndex: 0, ); await tester.pumpWidget( @@ -2487,7 +2480,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: tabs.length, - initialIndex: 0, ); await tester.pumpWidget( @@ -2697,13 +2689,11 @@ void main() { final TabController controller1 = TabController( vsync: const TestVSync(), length: 2, - initialIndex: 0, ); final TabController controller2 = TabController( vsync: const TestVSync(), length: 2, - initialIndex: 0, ); await tester.pumpWidget(buildFrame(controller1)); @@ -3197,7 +3187,6 @@ void main() { : const Center(child: Text('No tabs')), bottomNavigationBar: BottomAppBar( child: Row( - mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( @@ -3319,8 +3308,6 @@ void main() { }); testWidgets('TabBar expands vertically to accommodate the Icon and child Text() pair the same amount it would expand for Icon and text pair.', (WidgetTester tester) async { - const double indicatorWeight = 2.0; - const List tabListWithText = [ Tab(icon: Icon(Icons.notifications), text: 'Test'), ]; @@ -3328,8 +3315,8 @@ void main() { Tab(icon: Icon(Icons.notifications), child: Text('Test')), ]; - const TabBar tabBarWithText = TabBar(tabs: tabListWithText, indicatorWeight: indicatorWeight); - const TabBar tabBarWithTextChild = TabBar(tabs: tabListWithTextChild, indicatorWeight: indicatorWeight); + const TabBar tabBarWithText = TabBar(tabs: tabListWithText); + const TabBar tabBarWithTextChild = TabBar(tabs: tabListWithTextChild); expect(tabBarWithText.preferredSize, tabBarWithTextChild.preferredSize); }); @@ -3365,7 +3352,6 @@ void main() { await tester.pumpWidget(TabControllerFrame( builder: buildTabControllerFrame, length: tabs.length, - initialIndex: 0, )); final RenderBox box = tester.renderObject(find.byType(TabBar)); @@ -3699,7 +3685,7 @@ void main() { testWidgets('Tabs are given uniform padding in case of few tabs having both text and icon', (WidgetTester tester) async { const EdgeInsetsGeometry expectedPaddingAdjusted = EdgeInsets.symmetric(vertical: 13.0, horizontal: 16.0); - const EdgeInsetsGeometry expectedPaddingDefault = EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0); + const EdgeInsetsGeometry expectedPaddingDefault = EdgeInsets.symmetric(horizontal: 16.0); await tester.pumpWidget( MaterialApp( @@ -3864,7 +3850,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: 2, - initialIndex: 0, ); await tester.pumpWidget( diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index 277f0e8233..45a3a9c8fe 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -185,7 +185,6 @@ void main() { await gesture.removePointer(); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('TextButton with colored theme meets a11y contrast guidelines', (WidgetTester tester) async { @@ -254,7 +253,6 @@ void main() { await expectLater(tester, meetsGuideline(textContrastGuideline)); }, skip: isBrowser, // https://github.com/flutter/flutter/issues/44115 - semanticsEnabled: true, ); testWidgets('TextButton uses stateful color for text color in different states', (WidgetTester tester) async { @@ -528,7 +526,7 @@ void main() { textDirection: TextDirection.ltr, child: Material( child: MediaQuery( - data: const MediaQueryData(textScaleFactor: 1.0), + data: const MediaQueryData(), child: Center( child: TextButton( onPressed: () { }, @@ -641,7 +639,7 @@ void main() { // onPressed not null, onLongPress null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: () { wasPressed = true; }, onLongPress: null), + buildFrame(onPressed: () { wasPressed = true; }), ); textButton = find.byType(TextButton); expect(tester.widget(textButton).enabled, true); @@ -651,7 +649,7 @@ void main() { // onPressed null, onLongPress not null. wasPressed = false; await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: () { wasPressed = true; }), + buildFrame(onLongPress: () { wasPressed = true; }), ); textButton = find.byType(TextButton); expect(tester.widget(textButton).enabled, true); @@ -660,7 +658,7 @@ void main() { // onPressed null, onLongPress null. await tester.pumpWidget( - buildFrame(onPressed: null, onLongPress: null), + buildFrame(), ); textButton = find.byType(TextButton); expect(tester.widget(textButton).enabled, false); diff --git a/packages/flutter/test/material/text_button_theme_test.dart b/packages/flutter/test/material/text_button_theme_test.dart index 81e2212f9f..819397148b 100644 --- a/packages/flutter/test/material/text_button_theme_test.dart +++ b/packages/flutter/test/material/text_button_theme_test.dart @@ -176,7 +176,7 @@ void main() { }); testWidgets('Overall Theme button theme style overrides defaults, null theme and empty overall style', (WidgetTester tester) async { - await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), themeStyle: null, overallStyle: style)); + await tester.pumpWidget(buildFrame(buttonStyle: const ButtonStyle(), overallStyle: style)); await tester.pumpAndSettle(); // allow the animations to finish checkButton(tester); }); diff --git a/packages/flutter/test/material/text_field_restoration_test.dart b/packages/flutter/test/material/text_field_restoration_test.dart index dc37d0523c..523d17c20f 100644 --- a/packages/flutter/test/material/text_field_restoration_test.dart +++ b/packages/flutter/test/material/text_field_restoration_test.dart @@ -99,7 +99,6 @@ class TestWidgetState extends State with RestorationMixin { Widget build(BuildContext context) { return Material( child: Align( - alignment: Alignment.center, child: SizedBox( width: 50, child: TextField( diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index 4fa99060d6..98a815d2ef 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -506,7 +506,7 @@ void main() { await tester.tap(find.byKey(icon)); await tester.pump(); expect(controller.text, ''); - expect(controller.selection, const TextSelection.collapsed(offset: 0, affinity: TextAffinity.downstream)); + expect(controller.selection, const TextSelection.collapsed(offset: 0)); }); testWidgets('Cursor radius is 2.0', (WidgetTester tester) async { @@ -684,7 +684,7 @@ void main() { actualNewValue, const TextEditingValue( text: '12', - selection: TextSelection.collapsed(offset: 2, affinity: TextAffinity.downstream), + selection: TextSelection.collapsed(offset: 2), ), ); }, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events. @@ -770,7 +770,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pump(); @@ -862,7 +862,6 @@ void main() { style: const TextStyle(height: 4, color: Colors.black45), toolbarOptions: const ToolbarOptions(copy: true, selectAll: true), selectionHeightStyle: ui.BoxHeightStyle.includeLineSpacingBottom, - selectionWidthStyle: ui.BoxWidthStyle.tight, maxLines: 3, ), ], @@ -2223,7 +2222,6 @@ void main() { child: TextField( controller: controller, expands: true, - minLines: null, maxLines: null, ), ), @@ -4117,7 +4115,6 @@ void main() { tester.testTextInput.updateEditingValue(const TextEditingValue( text: testValue, selection: TextSelection.collapsed(offset: 10), - composing: TextRange.empty, )); await tester.pump(); expect(textController.text, testValue); @@ -4127,7 +4124,6 @@ void main() { tester.testTextInput.updateEditingValue(const TextEditingValue( text: '${testValue}9999999', selection: TextSelection.collapsed(offset: 10 + 7), - composing: TextRange.empty, )); await tester.pump(); @@ -4139,7 +4135,6 @@ void main() { tester.testTextInput.updateEditingValue(const TextEditingValue( text: '0123455555555556789', selection: TextSelection.collapsed(offset: 19), - composing: TextRange.empty, )); await tester.pump(); @@ -4166,7 +4161,6 @@ void main() { tester.testTextInput.updateEditingValue(const TextEditingValue( text: testValue, selection: TextSelection(baseOffset: 8, extentOffset: 10), - composing: TextRange.empty, )); await tester.pump(); expect(textController.text, testValue); @@ -4176,7 +4170,6 @@ void main() { tester.testTextInput.updateEditingValue(const TextEditingValue( text: '01234569999999', selection: TextSelection.collapsed(offset: 14), - composing: TextRange.empty, )); await tester.pump(); @@ -4708,7 +4701,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: TextField( controller: controller, maxLines: 3, @@ -4901,7 +4893,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -4978,7 +4969,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -5052,7 +5042,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -5105,7 +5094,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -5183,7 +5171,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -5252,7 +5239,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -5304,7 +5290,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: textField, ), ), @@ -6993,7 +6978,7 @@ void main() { // Cursor at tap position, not at word edge. expect( controller.selection, - const TextSelection.collapsed(offset: 3, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 3), ); }, variant: const TargetPlatformVariant({ TargetPlatform.iOS, TargetPlatform.macOS }), @@ -7097,7 +7082,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pumpAndSettle(); @@ -7499,7 +7484,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pump(const Duration(milliseconds: 500)); @@ -7657,7 +7642,7 @@ void main() { // Long press on iOS shows collapsed selection cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 3, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 3), ); // Cursor move doesn't trigger a toolbar initially. expect(find.byType(CupertinoButton), findsNothing); @@ -7668,7 +7653,7 @@ void main() { // The selection position is now moved with the drag. expect( controller.selection, - const TextSelection.collapsed(offset: 6, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 6), ); // Still no toolbar. expect(find.byType(CupertinoButton), findsNothing); @@ -7679,7 +7664,7 @@ void main() { // The selection position is now moved with the drag. expect( controller.selection, - const TextSelection.collapsed(offset: 9, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 9), ); // Still no toolbar. expect(find.byType(CupertinoButton), findsNothing); @@ -7690,7 +7675,7 @@ void main() { // The selection isn't affected by the gesture lift. expect( controller.selection, - const TextSelection.collapsed(offset: 9, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 9), ); // The toolbar now shows up. expect(find.byType(CupertinoButton), isContextMenuProvidedByPlatform ? findsNothing : findsNWidgets(2)); @@ -7708,7 +7693,6 @@ void main() { child: Center( child: TextField( controller: controller, - maxLines: 1, ), ), ), @@ -7743,14 +7727,14 @@ void main() { await tester.pump(); expect( controller.selection, - const TextSelection.collapsed(offset: 56, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 56), ); // Keep moving out. await gesture.moveBy(const Offset(1, 0)); await tester.pump(); expect( controller.selection, - const TextSelection.collapsed(offset: 62, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 62), ); await gesture.moveBy(const Offset(1, 0)); await tester.pump(); @@ -7812,7 +7796,7 @@ void main() { // First tap moved the cursor to the beginning of the second word. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pump(const Duration(milliseconds: 500)); @@ -7856,7 +7840,7 @@ void main() { await tester.pump(const Duration(milliseconds: 50)); expect( controller.selection, - const TextSelection.collapsed(offset: 3, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 3), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); @@ -7864,7 +7848,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pumpAndSettle(); @@ -7910,7 +7894,7 @@ void main() { await tester.pumpAndSettle(); expect( controller.selection, - const TextSelection.collapsed(offset: 3, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 3), ); await gesture.down(textFieldStart + const Offset(150.0, 9.0)); @@ -7921,7 +7905,7 @@ void main() { // the word. expect( controller.selection, - const TextSelection.collapsed(offset: 9, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 9), ); // Double click selection. @@ -7994,7 +7978,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 8, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 8), ); await tester.tapAt(textfieldStart + const Offset(150.0, 9.0)); await tester.pumpAndSettle(); @@ -8040,7 +8024,7 @@ void main() { await tester.pump(const Duration(milliseconds: 50)); expect( controller.selection, - const TextSelection.collapsed(offset: 3, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 3), ); // Second click selects. @@ -8062,7 +8046,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 6, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 6), ); await gesture.down(textFieldStart + const Offset(100.0, 9.0)); await tester.pump(); @@ -8081,7 +8065,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 9, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 9), ); await gesture.down(textFieldStart + const Offset(150.0, 9.0)); await tester.pump(); @@ -8323,7 +8307,6 @@ void main() { position: offset + const Offset(150.0, 9.0), pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); // We don't want this gesture to select any word on Android. @@ -8370,7 +8353,6 @@ void main() { position: textfieldStart + const Offset(150.0, 9.0), pressure: 0.5, pressureMin: 0, - pressureMax: 1, ), ); // We expect the force press to select a word at the given location. @@ -8422,7 +8404,6 @@ void main() { position: textfieldStart + const Offset(150.0, 9.0), pressure: 0.5, pressureMin: 0, - pressureMax: 1, ), ); await gesture.up(); @@ -8461,12 +8442,10 @@ void main() { decoration: InputDecoration(labelText: 'foo'), keyboardType: TextInputType.text, textInputAction: TextInputAction.done, - textCapitalization: TextCapitalization.none, style: TextStyle(color: Color(0xff00ff00)), textAlign: TextAlign.end, textDirection: TextDirection.ltr, autofocus: true, - obscureText: false, autocorrect: false, maxLines: 10, maxLength: 100, @@ -9773,7 +9752,7 @@ void main() { ); } - await tester.pumpWidget(textFieldBuilder(behavior: FloatingLabelBehavior.auto)); + await tester.pumpWidget(textFieldBuilder()); // The label will be positioned within the content when unfocused. expect(tester.getTopLeft(find.text('Label')).dy, 20.0); diff --git a/packages/flutter/test/material/text_form_field_restoration_test.dart b/packages/flutter/test/material/text_form_field_restoration_test.dart index dd4fc54c68..95440d1f4a 100644 --- a/packages/flutter/test/material/text_form_field_restoration_test.dart +++ b/packages/flutter/test/material/text_form_field_restoration_test.dart @@ -41,7 +41,7 @@ void main() { return MaterialApp( restorationScopeId: 'app', home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -99,7 +99,7 @@ void main() { return MaterialApp( restorationScopeId: 'app', home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -231,7 +231,6 @@ class TestWidgetState extends State with RestorationMixin { Widget build(BuildContext context) { return Material( child: Align( - alignment: Alignment.center, child: SizedBox( width: 50, child: TextFormField( diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index ab7edb6aaa..e41865cdab 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -517,9 +517,7 @@ void main() { MaterialApp( home: Material( child: Center( - child: TextFormField( - initialValue: null, - ), + child: TextFormField(), ), ), ), @@ -542,9 +540,7 @@ void main() { MaterialApp( home: Material( child: Center( - child: TextFormField( - initialValue: null, - ), + child: TextFormField(), ), ), ), diff --git a/packages/flutter/test/material/text_selection_test.dart b/packages/flutter/test/material/text_selection_test.dart index d0cf606070..29c968fe9e 100644 --- a/packages/flutter/test/material/text_selection_test.dart +++ b/packages/flutter/test/material/text_selection_test.dart @@ -568,7 +568,7 @@ void main() { padding: const EdgeInsets.symmetric(horizontal: 250), child: FittedBox( child: materialTextSelectionControls.buildHandle( - context, TextSelectionHandleType.right, 10.0, null, + context, TextSelectionHandleType.right, 10.0, ), ), ), diff --git a/packages/flutter/test/material/text_selection_theme_test.dart b/packages/flutter/test/material/text_selection_theme_test.dart index b815cde065..c722ca14da 100644 --- a/packages/flutter/test/material/text_selection_theme_test.dart +++ b/packages/flutter/test/material/text_selection_theme_test.dart @@ -88,7 +88,6 @@ void main() { context, TextSelectionHandleType.left, 10.0, - null, ); }, ), @@ -142,7 +141,6 @@ void main() { context, TextSelectionHandleType.left, 10.0, - null, ); }, ), @@ -204,7 +202,6 @@ void main() { context, TextSelectionHandleType.left, 10.0, - null, ); }, ), diff --git a/packages/flutter/test/material/text_theme_test.dart b/packages/flutter/test/material/text_theme_test.dart index e5a88c2c21..9a89a6b972 100644 --- a/packages/flutter/test/material/text_theme_test.dart +++ b/packages/flutter/test/material/text_theme_test.dart @@ -15,7 +15,7 @@ void main() { }); test('TextTheme copyWith apply, merge basics with Typography.black', () { - final Typography typography = Typography.material2018(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(); expect(typography.black, equals(typography.black.copyWith())); expect(typography.black, equals(typography.black.apply())); expect(typography.black, equals(typography.black.merge(null))); @@ -27,7 +27,7 @@ void main() { }); test('TextTheme copyWith', () { - final Typography typography = Typography.material2018(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(); final TextTheme whiteCopy = typography.black.copyWith( headline1: typography.white.headline1, headline2: typography.white.headline2, @@ -84,7 +84,7 @@ void main() { TextDecoration.lineThrough, ]); - final Typography typography = Typography.material2018(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(); final TextTheme theme = typography.black.apply( fontFamily: fontFamily, displayColor: displayColor, @@ -130,7 +130,7 @@ void main() { }); test('TextTheme apply fontSizeFactor fontSizeDelta', () { - final Typography typography = Typography.material2018(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(); final TextTheme baseTheme = Typography.englishLike2018.merge(typography.black); final TextTheme sizeTheme = baseTheme.apply( fontSizeFactor: 2.0, diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 915ddc4a26..c556bf64be 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -52,7 +52,7 @@ void main() { }); test('Default chip label style gets a default bodyText1 if textTheme.bodyText1 is null', () { - const TextTheme noBodyText1TextTheme = TextTheme(bodyText1: null); + const TextTheme noBodyText1TextTheme = TextTheme(); final ThemeData lightTheme = ThemeData(brightness: Brightness.light, textTheme: noBodyText1TextTheme); final ThemeData darkTheme = ThemeData(brightness: Brightness.dark, textTheme: noBodyText1TextTheme); final Typography typography = Typography.material2018(platform: lightTheme.platform); @@ -326,7 +326,7 @@ void main() { floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: Colors.black), navigationBarTheme: const NavigationBarThemeData(backgroundColor: Colors.black), navigationRailTheme: const NavigationRailThemeData(backgroundColor: Colors.black), - typography: Typography.material2018(platform: TargetPlatform.android), + typography: Typography.material2018(), cupertinoOverrideTheme: null, snackBarTheme: const SnackBarThemeData(backgroundColor: Colors.black), bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.black), diff --git a/packages/flutter/test/material/theme_defaults_test.dart b/packages/flutter/test/material/theme_defaults_test.dart index 672dafd716..78ac3915a3 100644 --- a/packages/flutter/test/material/theme_defaults_test.dart +++ b/packages/flutter/test/material/theme_defaults_test.dart @@ -216,7 +216,7 @@ void main() { group('FloatingActionButton', () { const BoxConstraints defaultFABConstraints = BoxConstraints.tightFor(width: 56.0, height: 56.0); - const ShapeBorder defaultFABShape = CircleBorder(side: BorderSide.none); + const ShapeBorder defaultFABShape = CircleBorder(); const EdgeInsets defaultFABPadding = EdgeInsets.zero; testWidgets('theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index 41d9278c87..b2e7a36441 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -814,7 +814,6 @@ void _tests() { await mediaQueryBoilerplate( tester, false, - textScaleFactor: 1.0, initialTime: const TimeOfDay(hour: 7, minute: 41), ); @@ -920,7 +919,7 @@ void _testsInput() { testWidgets('Switching to input entry mode triggers entry callback', (WidgetTester tester) async { bool triggeredCallback = false; - await mediaQueryBoilerplate(tester, true, entryMode: TimePickerEntryMode.dial, onEntryModeChange: (TimePickerEntryMode mode) { + await mediaQueryBoilerplate(tester, true, onEntryModeChange: (TimePickerEntryMode mode) { if (mode == TimePickerEntryMode.input) { triggeredCallback = true; } @@ -932,7 +931,7 @@ void _testsInput() { }); testWidgets('Can double tap hours (when selected) to enter input mode', (WidgetTester tester) async { - await mediaQueryBoilerplate(tester, false, entryMode: TimePickerEntryMode.dial); + await mediaQueryBoilerplate(tester, false); final Finder hourFinder = find.ancestor( of: find.text('7'), matching: find.byType(InkWell), @@ -950,7 +949,7 @@ void _testsInput() { }); testWidgets('Can not double tap hours (when not selected) to enter input mode', (WidgetTester tester) async { - await mediaQueryBoilerplate(tester, false, entryMode: TimePickerEntryMode.dial); + await mediaQueryBoilerplate(tester, false); final Finder hourFinder = find.ancestor( of: find.text('7'), matching: find.byType(InkWell), @@ -976,7 +975,7 @@ void _testsInput() { }); testWidgets('Can double tap minutes (when selected) to enter input mode', (WidgetTester tester) async { - await mediaQueryBoilerplate(tester, false, entryMode: TimePickerEntryMode.dial); + await mediaQueryBoilerplate(tester, false); final Finder minuteFinder = find.ancestor( of: find.text('00'), matching: find.byType(InkWell), @@ -998,7 +997,7 @@ void _testsInput() { }); testWidgets('Can not double tap minutes (when not selected) to enter input mode', (WidgetTester tester) async { - await mediaQueryBoilerplate(tester, false, entryMode: TimePickerEntryMode.dial); + await mediaQueryBoilerplate(tester, false); final Finder minuteFinder = find.ancestor( of: find.text('00'), matching: find.byType(InkWell), diff --git a/packages/flutter/test/material/toggle_buttons_test.dart b/packages/flutter/test/material/toggle_buttons_test.dart index 6682452713..3e01b47083 100644 --- a/packages/flutter/test/material/toggle_buttons_test.dart +++ b/packages/flutter/test/material/toggle_buttons_test.dart @@ -620,7 +620,6 @@ void main() { child: boilerplate( child: ToggleButtons( isSelected: const [true], - onPressed: null, children: [ Row(children: const [ Text('First child'), @@ -709,7 +708,6 @@ void main() { child: ToggleButtons( fillColor: selectedFillColor, isSelected: const [false, true], - onPressed: null, children: const [ Text('First child'), Text('Second child'), @@ -773,7 +771,6 @@ void main() { child: ToggleButtons( fillColor: MaterialStateColor.resolveWith(getFillColor), isSelected: const [false, true], - onPressed: null, children: const [ Text('First child'), Text('Second child'), @@ -1492,7 +1489,6 @@ void main() { child: boilerplate( child: ToggleButtons( direction: Axis.vertical, - verticalDirection: VerticalDirection.down, isSelected: const [false, true, false], onPressed: (int index) {}, children: const [ diff --git a/packages/flutter/test/material/toggle_buttons_theme_test.dart b/packages/flutter/test/material/toggle_buttons_theme_test.dart index aadbf321db..cd8246ec5d 100644 --- a/packages/flutter/test/material/toggle_buttons_theme_test.dart +++ b/packages/flutter/test/material/toggle_buttons_theme_test.dart @@ -416,7 +416,6 @@ void main() { data: ToggleButtonsThemeData(fillColor: MaterialStateColor.resolveWith(getColor)), child: ToggleButtons( isSelected: const [true, false], - onPressed: null, children: const [ Text('First child'), Text('Second child'), diff --git a/packages/flutter/test/material/typography_test.dart b/packages/flutter/test/material/typography_test.dart index 4b60e80a3c..cdee39affe 100644 --- a/packages/flutter/test/material/typography_test.dart +++ b/packages/flutter/test/material/typography_test.dart @@ -17,12 +17,12 @@ void main() { }); test('Typography on non-Apple platforms defaults to the correct font', () { - expect(Typography.material2018(platform: TargetPlatform.android).black.headline6!.fontFamily, 'Roboto'); + expect(Typography.material2018().black.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.fuchsia).black.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.linux).black.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.linux).black.headline6!.fontFamilyFallback, ['Ubuntu', 'Cantarell', 'DejaVu Sans', 'Liberation Sans', 'Arial']); expect(Typography.material2018(platform: TargetPlatform.windows).black.headline6!.fontFamily, 'Segoe UI'); - expect(Typography.material2018(platform: TargetPlatform.android).white.headline6!.fontFamily, 'Roboto'); + expect(Typography.material2018().white.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.fuchsia).white.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.linux).white.headline6!.fontFamily, 'Roboto'); expect(Typography.material2018(platform: TargetPlatform.linux).white.headline6!.fontFamilyFallback, ['Ubuntu', 'Cantarell', 'DejaVu Sans', 'Liberation Sans', 'Arial']); @@ -83,7 +83,6 @@ void main() { testWidgets('Typography implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); Typography.material2014( - platform: TargetPlatform.android, black: Typography.blackCupertino, white: Typography.whiteCupertino, englishLike: Typography.englishLike2018, diff --git a/packages/flutter/test/painting/binding_test.dart b/packages/flutter/test/painting/binding_test.dart index 337591db32..687baea937 100644 --- a/packages/flutter/test/painting/binding_test.dart +++ b/packages/flutter/test/painting/binding_test.dart @@ -18,7 +18,6 @@ Future main() async { imageCache!.putIfAbsent(1, () => OneFrameImageStreamCompleter( Future.value(ImageInfo( image: image, - scale: 1.0, )), )); diff --git a/packages/flutter/test/painting/border_radius_test.dart b/packages/flutter/test/painting/border_radius_test.dart index 8812b698b9..5e29b72279 100644 --- a/packages/flutter/test/painting/border_radius_test.dart +++ b/packages/flutter/test/painting/border_radius_test.dart @@ -73,9 +73,7 @@ void main() { expect(borderRadius.bottomRight, radius2); expect(borderRadius.toRRect(rect), RRect.fromRectAndCorners( rect, - topLeft: Radius.zero, topRight: radius1, - bottomLeft: Radius.zero, bottomRight: radius2, )); @@ -245,17 +243,13 @@ void main() { expect(borderRadius.bottomEnd, radius2); expect(borderRadius.resolve(TextDirection.ltr).toRRect(rect), RRect.fromRectAndCorners( rect, - topLeft: Radius.zero, topRight: radius1, - bottomLeft: Radius.zero, bottomRight: radius2, )); expect(borderRadius.resolve(TextDirection.rtl).toRRect(rect), RRect.fromRectAndCorners( rect, topLeft: radius1, - topRight: Radius.zero, bottomLeft: radius2, - bottomRight: Radius.zero, )); expect( @@ -458,14 +452,11 @@ void main() { const BorderRadius ltr = BorderRadius.only( topLeft: Radius.elliptical(300.0, 500.0), // tL + 0 - 0 topRight: Radius.elliptical(30.0, 50.0), // 0 + tE - 0 - bottomLeft: Radius.elliptical(-3.0, -5.0), // 0 + 0 - bL - bottomRight: Radius.zero, // 0 + 0 - 0 + bottomLeft: Radius.elliptical(-3.0, -5.0), // 0 + 0 - 0 ); const BorderRadius rtl = BorderRadius.only( - topLeft: Radius.elliptical(330.0, 550.0), // tL + tE - 0 - topRight: Radius.zero, // 0 + 0 - 0 - bottomLeft: Radius.elliptical(-3.0, -5.0), // 0 + 0 - bL - bottomRight: Radius.zero, // 0 + 0 - 0 + topLeft: Radius.elliptical(330.0, 550.0), // 0 + 0 - 0 + bottomLeft: Radius.elliptical(-3.0, -5.0), // 0 + 0 - 0 ); expect(a.add(b.subtract(c)).resolve(TextDirection.ltr), ltr); expect(a.add(b.subtract(c)).resolve(TextDirection.rtl), rtl); diff --git a/packages/flutter/test/painting/border_rtl_test.dart b/packages/flutter/test/painting/border_rtl_test.dart index fac5316db5..d1804cb8cd 100644 --- a/packages/flutter/test/painting/border_rtl_test.dart +++ b/packages/flutter/test/painting/border_rtl_test.dart @@ -443,7 +443,7 @@ void main() { top: BorderSide(style: BorderStyle.none), start: BorderSide(style: BorderStyle.none), end: BorderSide(style: BorderStyle.none), - bottom: BorderSide(style: BorderStyle.solid, width: 0.0), + bottom: BorderSide(width: 0.0), ).isUniform, false, ); @@ -452,17 +452,11 @@ void main() { top: BorderSide(style: BorderStyle.none), start: BorderSide(style: BorderStyle.none), end: BorderSide(style: BorderStyle.none), - bottom: BorderSide.none, ).isUniform, false, ); expect( - const BorderDirectional( - top: BorderSide.none, - start: BorderSide.none, - end: BorderSide.none, - bottom: BorderSide.none, - ).isUniform, + const BorderDirectional().isUniform, true, ); expect( diff --git a/packages/flutter/test/painting/border_side_test.dart b/packages/flutter/test/painting/border_side_test.dart index 93d12f602d..c655cefd4b 100644 --- a/packages/flutter/test/painting/border_side_test.dart +++ b/packages/flutter/test/painting/border_side_test.dart @@ -9,19 +9,13 @@ void main() { test('BorderSide - asserts when constructed incorrectly', () { expect( const BorderSide(), - const BorderSide( - color: Color(0xFF000000), - width: 1.0, - style: BorderStyle.solid, - ), + const BorderSide(), ); expect(() => BorderSide(width: nonconst(-1.0)), throwsAssertionError); expect( const BorderSide(width: -0.0), const BorderSide( - color: Color(0xFF000000), width: 0.0, - style: BorderStyle.solid, ), ); }); @@ -38,7 +32,7 @@ void main() { const BorderSide side2 = BorderSide(width: 2.0); const BorderSide side3 = BorderSide(width: 3.0); const BorderSide side5 = BorderSide(width: 5.0); - const BorderSide solid = BorderSide(style: BorderStyle.solid); + const BorderSide solid = BorderSide(); const BorderSide yellowNone = BorderSide(style: BorderStyle.none, color: Color(0xFFFFFF00), width: 0.0); // canMerge expect( BorderSide.canMerge(BorderSide.none, BorderSide.none), isTrue); @@ -101,7 +95,7 @@ void main() { expect(none.scale(2.0), none); }); test('BorderSide - toPaint', () { - final Paint paint1 = const BorderSide(width: 2.5, color: Color(0xFFFFFF00), style: BorderStyle.solid).toPaint(); + final Paint paint1 = const BorderSide(width: 2.5, color: Color(0xFFFFFF00)).toPaint(); expect(paint1.strokeWidth, 2.5); expect(paint1.style, PaintingStyle.stroke); expect(paint1.color, const Color(0xFFFFFF00)); @@ -114,7 +108,7 @@ void main() { }); test("BorderSide - won't lerp into negative widths", () { const BorderSide side0 = BorderSide(width: 0.0); - const BorderSide side1 = BorderSide(width: 1.0); + const BorderSide side1 = BorderSide(); const BorderSide side2 = BorderSide(width: 2.0); expect(BorderSide.lerp(side2, side1, 10.0), BorderSide.none); expect(BorderSide.lerp(side1, side2, -10.0), BorderSide.none); diff --git a/packages/flutter/test/painting/border_test.dart b/packages/flutter/test/painting/border_test.dart index ae9916e039..355964bd9d 100644 --- a/packages/flutter/test/painting/border_test.dart +++ b/packages/flutter/test/painting/border_test.dart @@ -17,7 +17,7 @@ void main() { test('Border.symmetric constructor', () { const BorderSide side1 = BorderSide(color: Color(0xFFFFFFFF)); - const BorderSide side2 = BorderSide(color: Color(0xFF000000)); + const BorderSide side2 = BorderSide(); const Border border = Border.symmetric(vertical: side1, horizontal: side2); expect(border.left, same(side1)); expect(border.top, same(side2)); @@ -168,7 +168,7 @@ void main() { left: BorderSide(style: BorderStyle.none), top: BorderSide(style: BorderStyle.none), right: BorderSide(style: BorderStyle.none), - bottom: BorderSide(style: BorderStyle.solid, width: 0.0), + bottom: BorderSide(width: 0.0), ).isUniform, false, ); @@ -177,7 +177,7 @@ void main() { left: BorderSide(style: BorderStyle.none), top: BorderSide(style: BorderStyle.none), right: BorderSide(style: BorderStyle.none), - bottom: BorderSide(style: BorderStyle.solid, width: 0.0), + bottom: BorderSide(width: 0.0), ).isUniform, false, ); @@ -186,17 +186,11 @@ void main() { left: BorderSide(style: BorderStyle.none), top: BorderSide(style: BorderStyle.none), right: BorderSide(style: BorderStyle.none), - bottom: BorderSide.none, ).isUniform, false, ); expect( - const Border( - left: BorderSide.none, - top: BorderSide.none, - right: BorderSide.none, - bottom: BorderSide.none, - ).isUniform, + const Border().isUniform, true, ); expect( diff --git a/packages/flutter/test/painting/box_painter_test.dart b/packages/flutter/test/painting/box_painter_test.dart index 33be44f1c0..b1c095a721 100644 --- a/packages/flutter/test/painting/box_painter_test.dart +++ b/packages/flutter/test/painting/box_painter_test.dart @@ -34,7 +34,6 @@ void main() { expect(BorderSide.lerp(side1, side2, 0.5), equals(BorderSide( color: Color.lerp(const Color(0xFF000000), const Color(0xFF00FFFF), 0.5)!, width: 1.5, - style: BorderStyle.solid, ))); final BorderSide side3 = side2.copyWith(style: BorderStyle.none); @@ -262,7 +261,7 @@ void main() { child: Center( child: Container( decoration: const BoxDecoration( - boxShadow: [BoxShadow(blurRadius: 4.0, blurStyle: BlurStyle.normal)], + boxShadow: [BoxShadow(blurRadius: 4.0)], ), width: 20, height: 20, @@ -295,7 +294,7 @@ void main() { child: Container( decoration: const BoxDecoration( color: Colors.black, - boxShadow: [BoxShadow(blurRadius: 16.0, offset: Offset(4, 4), blurStyle: BlurStyle.normal, color: Colors.green, spreadRadius: 2)], + boxShadow: [BoxShadow(blurRadius: 16.0, offset: Offset(4, 4), color: Colors.green, spreadRadius: 2)], ), width: 64, height: 64, diff --git a/packages/flutter/test/painting/decoration_test.dart b/packages/flutter/test/painting/decoration_test.dart index 6206a18da4..3d5a1c801e 100644 --- a/packages/flutter/test/painting/decoration_test.dart +++ b/packages/flutter/test/painting/decoration_test.dart @@ -37,7 +37,7 @@ class SynchronousTestImageProvider extends ImageProvider { @override ImageStreamCompleter load(int key, DecoderCallback decode) { return OneFrameImageStreamCompleter( - SynchronousFuture(TestImageInfo(key, image: image, scale: 1.0)), + SynchronousFuture(TestImageInfo(key, image: image)), ); } } @@ -336,13 +336,11 @@ void main() { image: SynchronousTestImageProvider(image), colorFilter: colorFilter, fit: BoxFit.contain, - alignment: Alignment.center, centerSlice: const Rect.fromLTWH(10.0, 20.0, 30.0, 40.0), repeat: ImageRepeat.repeatY, matchTextDirection: true, scale: 0.5, opacity: 0.5, - filterQuality: FilterQuality.low, invertColors: true, isAntiAlias: true, ); @@ -355,7 +353,6 @@ void main() { try { boxPainter.paint(canvas, Offset.zero, const ImageConfiguration( size: Size(100.0, 100.0), - textDirection: null, )); } on FlutterError catch (e) { error = e; @@ -407,31 +404,31 @@ void main() { // (Use a ShapeDecoration and ShapeBorder if you want to lerp the shapes...) expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), -1.0, ), - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), ); expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), 0.0, ), - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), ); expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), 0.25, ), - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), ); expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), 0.75, ), @@ -439,7 +436,7 @@ void main() { ); expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), 1.0, ), @@ -447,7 +444,7 @@ void main() { ); expect( BoxDecoration.lerp( - const BoxDecoration(shape: BoxShape.rectangle), + const BoxDecoration(), const BoxDecoration(shape: BoxShape.circle), 2.0, ), @@ -528,8 +525,6 @@ void main() { scale: scale, alignment: Alignment.bottomRight, fit: BoxFit.none, - repeat: ImageRepeat.noRepeat, - flipHorizontally: false, ); const Size imageSize = Size(100.0, 100.0); @@ -572,8 +567,6 @@ void main() { scale: scale, alignment: Alignment.bottomRight, fit: BoxFit.scaleDown, - repeat: ImageRepeat.noRepeat, - flipHorizontally: false, ); const Size imageSize = Size(100.0, 100.0); @@ -615,8 +608,6 @@ void main() { scale: 2.0, alignment: Alignment.bottomRight, fit: BoxFit.scaleDown, - repeat: ImageRepeat.noRepeat, - flipHorizontally: false, ); const Size imageSize = Size(100.0, 100.0); @@ -665,10 +656,7 @@ void main() { rect: outputRect, image: image, scale: 3.0, - alignment: Alignment.center, fit: boxFit, - repeat: ImageRepeat.noRepeat, - flipHorizontally: false, ); final Invocation call = canvas.invocations.firstWhere((Invocation call) => call.memberName == #drawImageRect); diff --git a/packages/flutter/test/painting/edge_insets_test.dart b/packages/flutter/test/painting/edge_insets_test.dart index 92fd81650c..989ea6f52b 100644 --- a/packages/flutter/test/painting/edge_insets_test.dart +++ b/packages/flutter/test/painting/edge_insets_test.dart @@ -118,8 +118,8 @@ void main() { expect(EdgeInsetsGeometry.lerp(const EdgeInsetsDirectional.only(bottom: 10.0), EdgeInsetsDirectional.zero, 0.5), const EdgeInsetsDirectional.only(bottom: 5.0)); expect(EdgeInsetsGeometry.lerp(const EdgeInsetsDirectional.only(bottom: 10.0), EdgeInsets.zero, 0.5), const EdgeInsetsDirectional.only(bottom: 5.0)); expect(EdgeInsetsGeometry.lerp(const EdgeInsetsDirectional.only(start: 10.0), const EdgeInsets.only(left: 20.0), 0.5), const EdgeInsetsDirectional.only(start: 5.0).add(const EdgeInsets.only(left: 10.0))); - expect(EdgeInsetsGeometry.lerp(const EdgeInsetsDirectional.only(start: 0.0, bottom: 1.0), const EdgeInsetsDirectional.only(start: 1.0, bottom: 1.0).add(const EdgeInsets.only(right: 2.0, bottom: 0.0)), 0.5), const EdgeInsetsDirectional.only(start: 0.5).add(const EdgeInsets.only(right: 1.0, bottom: 1.0))); - expect(EdgeInsetsGeometry.lerp(const EdgeInsets.only(left: 0.0, bottom: 1.0), const EdgeInsetsDirectional.only(end: 1.0, bottom: 1.0).add(const EdgeInsets.only(right: 2.0, bottom: 0.0)), 0.5), const EdgeInsetsDirectional.only(start: 0.0, end: 0.5).add(const EdgeInsets.only(right: 1.0, bottom: 1.0))); + expect(EdgeInsetsGeometry.lerp(const EdgeInsetsDirectional.only(bottom: 1.0), const EdgeInsetsDirectional.only(start: 1.0, bottom: 1.0).add(const EdgeInsets.only(right: 2.0)), 0.5), const EdgeInsetsDirectional.only(start: 0.5).add(const EdgeInsets.only(right: 1.0, bottom: 1.0))); + expect(EdgeInsetsGeometry.lerp(const EdgeInsets.only(bottom: 1.0), const EdgeInsetsDirectional.only(end: 1.0, bottom: 1.0).add(const EdgeInsets.only(right: 2.0)), 0.5), const EdgeInsetsDirectional.only(end: 0.5).add(const EdgeInsets.only(right: 1.0, bottom: 1.0))); }); test('EdgeInsetsGeometry.lerp(normal, ...)', () { diff --git a/packages/flutter/test/painting/geometry_test.dart b/packages/flutter/test/painting/geometry_test.dart index 6798107777..a0bc3836a4 100644 --- a/packages/flutter/test/painting/geometry_test.dart +++ b/packages/flutter/test/painting/geometry_test.dart @@ -15,7 +15,6 @@ void main() { childSize: const Size(20.0, 10.0), target: const Offset(50.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 0.0, ), const Offset(40.0, 40.0), @@ -26,7 +25,6 @@ void main() { childSize: const Size(200.0, 10.0), target: const Offset(50.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 0.0, ), const Offset(-50.0, 40.0), @@ -37,7 +35,6 @@ void main() { childSize: const Size(200.0, 10.0), target: const Offset(0.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 0.0, ), const Offset(-50.0, 40.0), @@ -48,7 +45,6 @@ void main() { childSize: const Size(200.0, 10.0), target: const Offset(100.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 0.0, ), const Offset(-50.0, 40.0), @@ -59,7 +55,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(50.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 20.0, // 60.0 left ), const Offset(25.0, 40.0), @@ -70,7 +65,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(50.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 30.0, // 40.0 left ), const Offset(25.0, 40.0), @@ -81,7 +75,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(0.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 20.0, // 60.0 left ), const Offset(20.0, 40.0), @@ -92,7 +85,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(0.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 30.0, // 40.0 left ), const Offset(25.0, 40.0), @@ -103,7 +95,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(100.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 20.0, // 60.0 left ), const Offset(30.0, 40.0), @@ -114,7 +105,6 @@ void main() { childSize: const Size(50.0, 10.0), target: const Offset(100.0, 50.0), preferBelow: false, - verticalOffset: 0.0, margin: 30.0, // 40.0 left ), const Offset(25.0, 40.0), diff --git a/packages/flutter/test/painting/gradient_test.dart b/packages/flutter/test/painting/gradient_test.dart index ed798c0b23..26cb6d8da2 100644 --- a/packages/flutter/test/painting/gradient_test.dart +++ b/packages/flutter/test/painting/gradient_test.dart @@ -490,7 +490,6 @@ void main() { test('SweepGradient lerp test', () { const SweepGradient testGradient1 = SweepGradient( center: Alignment.topLeft, - startAngle: 0.0, endAngle: math.pi / 2, colors: [ Color(0x33333333), @@ -526,7 +525,6 @@ void main() { test('SweepGradient lerp test with stops', () { const SweepGradient testGradient1 = SweepGradient( center: Alignment.topLeft, - startAngle: 0.0, endAngle: math.pi / 2, colors: [ Color(0x33333333), @@ -643,7 +641,6 @@ void main() { test('SweepGradient scale test)', () { const SweepGradient testGradient = SweepGradient( center: Alignment.topLeft, - startAngle: 0.0, endAngle: math.pi / 2, colors: [ Color(0xff333333), @@ -655,7 +652,6 @@ void main() { expect(actual, const SweepGradient( center: Alignment.topLeft, - startAngle: 0.0, endAngle: math.pi / 2, colors: [ Color(0x80333333), @@ -720,7 +716,6 @@ void main() { ], ); const RadialGradient testGradient2 = RadialGradient( - center: Alignment.center, radius: 20.0, colors: [ Color(0x44444444), diff --git a/packages/flutter/test/painting/image_provider_resize_image_test.dart b/packages/flutter/test/painting/image_provider_resize_image_test.dart index ea1a413a30..292b0824f3 100644 --- a/packages/flutter/test/painting/image_provider_resize_image_test.dart +++ b/packages/flutter/test/painting/image_provider_resize_image_test.dart @@ -87,7 +87,7 @@ void main() { test('ResizeImage takes one dim', () async { final Uint8List bytes = Uint8List.fromList(kTransparentImage); final MemoryImage memoryImage = MemoryImage(bytes); - final ResizeImage resizeImage = ResizeImage(memoryImage, width: 10, height: null); + final ResizeImage resizeImage = ResizeImage(memoryImage, width: 10); expect(resizeImage.width, 10); expect(resizeImage.height, null); expect(resizeImage.imageProvider, memoryImage); diff --git a/packages/flutter/test/painting/matrix_utils_test.dart b/packages/flutter/test/painting/matrix_utils_test.dart index 2860893c4f..65b1381699 100644 --- a/packages/flutter/test/painting/matrix_utils_test.dart +++ b/packages/flutter/test/painting/matrix_utils_test.dart @@ -11,7 +11,7 @@ import 'package:vector_math/vector_math_64.dart'; void main() { test('MatrixUtils.transformRect handles very large finite values', () { const Rect evilRect = Rect.fromLTRB(0.0, -1.7976931348623157e+308, 800.0, 1.7976931348623157e+308); - final Matrix4 transform = Matrix4.identity()..translate(10.0, 0.0); + final Matrix4 transform = Matrix4.identity()..translate(10.0); final Rect transformedRect = MatrixUtils.transformRect(transform, evilRect); expect(transformedRect.isFinite, true); }); @@ -83,7 +83,6 @@ void main() { final Matrix4 actual = MatrixUtils.createCylindricalProjectionTransform( radius: 100.0, angle: pi / 3.0, - perspective: 0.001, ); expect(actual.storage, [ diff --git a/packages/flutter/test/painting/mocks_for_image_cache.dart b/packages/flutter/test/painting/mocks_for_image_cache.dart index d5be093486..f89f6189b4 100644 --- a/packages/flutter/test/painting/mocks_for_image_cache.dart +++ b/packages/flutter/test/painting/mocks_for_image_cache.dart @@ -136,6 +136,6 @@ class LoadErrorCompleterImageProvider extends ImageProvider[ Offset(30.0, 10.0), Offset(50.0, 10.0), ], diff --git a/packages/flutter/test/painting/shape_decoration_test.dart b/packages/flutter/test/painting/shape_decoration_test.dart index 5a79d3b925..bfb6894141 100644 --- a/packages/flutter/test/painting/shape_decoration_test.dart +++ b/packages/flutter/test/painting/shape_decoration_test.dart @@ -22,10 +22,10 @@ void main() { expect(() => ShapeDecoration(color: colorR, gradient: nonconst(gradient), shape: const Border()), throwsAssertionError); expect( ShapeDecoration.fromBoxDecoration(const BoxDecoration(shape: BoxShape.circle)), - const ShapeDecoration(shape: CircleBorder(side: BorderSide.none)), + const ShapeDecoration(shape: CircleBorder()), ); expect( - ShapeDecoration.fromBoxDecoration(BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadiusDirectional.circular(100.0))), + ShapeDecoration.fromBoxDecoration(BoxDecoration(borderRadius: BorderRadiusDirectional.circular(100.0))), ShapeDecoration(shape: RoundedRectangleBorder(borderRadius: BorderRadiusDirectional.circular(100.0))), ); expect( @@ -33,11 +33,11 @@ void main() { const ShapeDecoration(shape: CircleBorder(side: BorderSide(color: colorG))), ); expect( - ShapeDecoration.fromBoxDecoration(BoxDecoration(shape: BoxShape.rectangle, border: Border.all(color: colorR))), + ShapeDecoration.fromBoxDecoration(BoxDecoration(border: Border.all(color: colorR))), ShapeDecoration(shape: Border.all(color: colorR)), ); expect( - ShapeDecoration.fromBoxDecoration(const BoxDecoration(shape: BoxShape.rectangle, border: BorderDirectional(start: BorderSide()))), + ShapeDecoration.fromBoxDecoration(const BoxDecoration(border: BorderDirectional(start: BorderSide()))), const ShapeDecoration(shape: BorderDirectional(start: BorderSide())), ); }); @@ -98,7 +98,7 @@ void main() { }); test('ShapeDecoration.getClipPath', () { - const ShapeDecoration decoration = ShapeDecoration(shape: CircleBorder(side: BorderSide.none)); + const ShapeDecoration decoration = ShapeDecoration(shape: CircleBorder()); const Rect rect = Rect.fromLTWH(0.0, 0.0, 100.0, 20.0); final Path clipPath = decoration.getClipPath(rect, TextDirection.ltr); final Matcher isLookLikeExpectedPath = isPathThat( @@ -122,7 +122,7 @@ class TestImageProvider extends ImageProvider { @override ImageStreamCompleter load(TestImageProvider key, DecoderCallback decode) { return OneFrameImageStreamCompleter( - SynchronousFuture(ImageInfo(image: image, scale: 1.0)), + SynchronousFuture(ImageInfo(image: image)), ); } } diff --git a/packages/flutter/test/painting/stadium_border_test.dart b/packages/flutter/test/painting/stadium_border_test.dart index 496db9bfd7..1743be2931 100644 --- a/packages/flutter/test/painting/stadium_border_test.dart +++ b/packages/flutter/test/painting/stadium_border_test.dart @@ -32,9 +32,9 @@ void main() { expect(ShapeBorder.lerp(c10, c20, 0.5), c15); expect(ShapeBorder.lerp(c10, c20, 1.0), c20); - const StadiumBorder c1 = StadiumBorder(side: BorderSide(width: 1.0)); + const StadiumBorder c1 = StadiumBorder(side: BorderSide()); expect(c1.getOuterPath(Rect.fromCircle(center: Offset.zero, radius: 1.0)), isUnitCircle); - const StadiumBorder c2 = StadiumBorder(side: BorderSide(width: 1.0)); + const StadiumBorder c2 = StadiumBorder(side: BorderSide()); expect(c2.getInnerPath(Rect.fromCircle(center: Offset.zero, radius: 2.0)), isUnitCircle); const Rect rect = Rect.fromLTRB(10.0, 20.0, 100.0, 200.0); expect( @@ -48,8 +48,8 @@ void main() { }); test('StadiumBorder and CircleBorder', () { - const StadiumBorder stadium = StadiumBorder(side: BorderSide.none); - const CircleBorder circle = CircleBorder(side: BorderSide.none); + const StadiumBorder stadium = StadiumBorder(); + const CircleBorder circle = CircleBorder(); const Rect rect = Rect.fromLTWH(0.0, 0.0, 100.0, 20.0); final Matcher looksLikeS = isPathThat( includes: const [ Offset(30.0, 10.0), Offset(50.0, 10.0), ], @@ -111,8 +111,8 @@ void main() { }); test('StadiumBorder and RoundedRectBorder', () { - const StadiumBorder stadium = StadiumBorder(side: BorderSide.none); - const RoundedRectangleBorder rrect = RoundedRectangleBorder(side: BorderSide.none); + const StadiumBorder stadium = StadiumBorder(); + const RoundedRectangleBorder rrect = RoundedRectangleBorder(); const Rect rect = Rect.fromLTWH(0.0, 0.0, 100.0, 50.0); final Matcher looksLikeS = isPathThat( includes: const [ diff --git a/packages/flutter/test/painting/text_painter_rtl_test.dart b/packages/flutter/test/painting/text_painter_rtl_test.dart index 98d8d75afc..ea05a25834 100644 --- a/packages/flutter/test/painting/text_painter_rtl_test.dart +++ b/packages/flutter/test/painting/text_painter_rtl_test.dart @@ -21,15 +21,15 @@ void main() { painter.layout(); expect( - painter.getWordBoundary(const TextPosition(offset: 1, affinity: TextAffinity.downstream)), + painter.getWordBoundary(const TextPosition(offset: 1)), const TextRange(start: 0, end: 3), ); expect( - painter.getWordBoundary(const TextPosition(offset: 5, affinity: TextAffinity.downstream)), + painter.getWordBoundary(const TextPosition(offset: 5)), const TextRange(start: 4, end: 7), ); expect( - painter.getWordBoundary(const TextPosition(offset: 9, affinity: TextAffinity.downstream)), + painter.getWordBoundary(const TextPosition(offset: 9)), const TextRange(start: 8, end: 11), ); }); @@ -50,11 +50,11 @@ void main() { // The skips here are because the old rendering code considers the bidi formatting characters // to be part of the word sometimes and not others, which is fine, but we'd mildly prefer if // we were consistently considering them part of words always. - final TextRange hebrew1 = painter.getWordBoundary(const TextPosition(offset: 4, affinity: TextAffinity.downstream)); + final TextRange hebrew1 = painter.getWordBoundary(const TextPosition(offset: 4)); expect(hebrew1, const TextRange(start: 0, end: 8), skip: skipExpectsWithKnownBugs); // https://github.com/flutter/flutter/issues/87536 - final TextRange english2 = painter.getWordBoundary(const TextPosition(offset: 14, affinity: TextAffinity.downstream)); + final TextRange english2 = painter.getWordBoundary(const TextPosition(offset: 14)); expect(english2, const TextRange(start: 9, end: 19), skip: skipExpectsWithKnownBugs); // https://github.com/flutter/flutter/issues/87536 - final TextRange hebrew3 = painter.getWordBoundary(const TextPosition(offset: 24, affinity: TextAffinity.downstream)); + final TextRange hebrew3 = painter.getWordBoundary(const TextPosition(offset: 24)); expect(hebrew3, const TextRange(start: 20, end: 28)); // >>>>>>>>>>>>>>> embedding level 2 @@ -72,7 +72,7 @@ void main() { Offset.zero, ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 0, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 0), Rect.zero), Offset.zero, ); expect( @@ -80,7 +80,7 @@ void main() { const Offset(240.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 1, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 1), Rect.zero), const Offset(240.0, 0.0), ); expect( @@ -88,7 +88,7 @@ void main() { const Offset(180.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 7, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 7), Rect.zero), const Offset(180.0, 0.0), ); expect( @@ -96,7 +96,7 @@ void main() { const Offset(170.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 8, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 8), Rect.zero), const Offset(170.0, 0.0), ); expect( @@ -104,7 +104,7 @@ void main() { const Offset(160.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 9, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 9), Rect.zero), const Offset(160.0, 0.0), ); expect( @@ -112,7 +112,7 @@ void main() { const Offset(80.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 10, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 10), Rect.zero), const Offset(80.0, 0.0), ); @@ -179,11 +179,11 @@ void main() { expect(textSpan.text!.length, 28); painter.layout(); - final TextRange hebrew1 = painter.getWordBoundary(const TextPosition(offset: 4, affinity: TextAffinity.downstream)); + final TextRange hebrew1 = painter.getWordBoundary(const TextPosition(offset: 4)); expect(hebrew1, const TextRange(start: 0, end: 8), skip: skipExpectsWithKnownBugs); // https://github.com/flutter/flutter/issues/87536 - final TextRange english2 = painter.getWordBoundary(const TextPosition(offset: 14, affinity: TextAffinity.downstream)); + final TextRange english2 = painter.getWordBoundary(const TextPosition(offset: 14)); expect(english2, const TextRange(start: 9, end: 19), skip: skipExpectsWithKnownBugs); // https://github.com/flutter/flutter/issues/87536 - final TextRange hebrew3 = painter.getWordBoundary(const TextPosition(offset: 24, affinity: TextAffinity.downstream)); + final TextRange hebrew3 = painter.getWordBoundary(const TextPosition(offset: 24)); expect(hebrew3, const TextRange(start: 20, end: 28)); // >>>>>>>>>>>>>>> embedding level 2 @@ -200,7 +200,7 @@ void main() { const Offset(240.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 0, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 0), Rect.zero), const Offset(240.0, 0.0), ); expect( @@ -208,7 +208,7 @@ void main() { const Offset(240.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 1, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 1), Rect.zero), const Offset(240.0, 0.0), ); expect( @@ -216,7 +216,7 @@ void main() { const Offset(180.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 7, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 7), Rect.zero), const Offset(180.0, 0.0), ); expect( @@ -224,7 +224,7 @@ void main() { const Offset(170.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 8, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 8), Rect.zero), const Offset(170.0, 0.0), ); expect( @@ -232,7 +232,7 @@ void main() { const Offset(160.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 9, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 9), Rect.zero), const Offset(160.0, 0.0), ); expect( @@ -240,7 +240,7 @@ void main() { const Offset(80.0, 0.0), ); expect( - painter.getOffsetForCaret(const TextPosition(offset: 10, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 10), Rect.zero), const Offset(80.0, 0.0), ); @@ -271,7 +271,7 @@ void main() { for (int index = 0; index <= 2; index += 1) { expect( - painter.getWordBoundary(const TextPosition(offset: 0, affinity: TextAffinity.downstream)), + painter.getWordBoundary(const TextPosition(offset: 0)), const TextRange(start: 0, end: 2), ); } @@ -281,7 +281,7 @@ void main() { Offset.zero, ); expect( // before the A - painter.getOffsetForCaret(const TextPosition(offset: 0, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 0), Rect.zero), Offset.zero, ); @@ -290,7 +290,7 @@ void main() { const Offset(10.0, 0.0), ); expect( // between A and Alef, before the Alef - painter.getOffsetForCaret(const TextPosition(offset: 1, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 1), Rect.zero), const Offset(10.0, 10.0), ); @@ -299,7 +299,7 @@ void main() { const Offset(0.0, 10.0), ); expect( // after the Alef - painter.getOffsetForCaret(const TextPosition(offset: 2, affinity: TextAffinity.downstream), Rect.zero), + painter.getOffsetForCaret(const TextPosition(offset: 2), Rect.zero), const Offset(0.0, 10.0), ); @@ -495,19 +495,19 @@ void main() { // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(0.0, 5.0)).toString(), - const TextPosition(offset: 0, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 0).toString(), ); expect( // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(-100.0, 5.0)).toString(), - const TextPosition(offset: 0, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 0).toString(), ); expect( // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(4.0, 5.0)).toString(), - const TextPosition(offset: 0, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 0).toString(), ); expect( // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff @@ -519,7 +519,7 @@ void main() { // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(12.0, 5.0)).toString(), - const TextPosition(offset: 1, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 1).toString(), // currently we say upstream instead of downstream skip: skipExpectsWithKnownBugs, // https://github.com/flutter/flutter/issues/87536 ); @@ -540,14 +540,14 @@ void main() { // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(58.0, 5.0)).toString(), - const TextPosition(offset: 3, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 3).toString(), skip: skipExpectsWithKnownBugs, // this is part of https://github.com/flutter/flutter/issues/11375 ); expect( // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff // ^ painter.getPositionForOffset(const Offset(62.0, 5.0)).toString(), - const TextPosition(offset: 6, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 6).toString(), ); expect( // Aaa Bbb Ccc Gimel Bet Alef Ddd Eee Fff @@ -584,13 +584,13 @@ void main() { // Vav He Dalet Aaa Bbb Ccc Gimel Bet Alef // ^ painter.getPositionForOffset(const Offset(28.0, 5.0)).toString(), - const TextPosition(offset: 6, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 6).toString(), ); expect( // Vav He Dalet Aaa Bbb Ccc Gimel Bet Alef // ^ painter.getPositionForOffset(const Offset(32.0, 5.0)).toString(), - const TextPosition(offset: 3, affinity: TextAffinity.downstream).toString(), + const TextPosition(offset: 3).toString(), skip: skipExpectsWithKnownBugs, // this is part of https://github.com/flutter/flutter/issues/11375 ); expect( diff --git a/packages/flutter/test/painting/text_painter_test.dart b/packages/flutter/test/painting/text_painter_test.dart index ade3a71e92..78af9ed471 100644 --- a/packages/flutter/test/painting/text_painter_test.dart +++ b/packages/flutter/test/painting/text_painter_test.dart @@ -9,7 +9,7 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; const bool isCanvasKit = - bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false); + bool.fromEnvironment('FLUTTER_WEB_USE_SKIA'); void main() { test('TextPainter caret test', () { @@ -42,7 +42,7 @@ void main() { ..textDirection = TextDirection.ltr; List children = [const TextSpan(text: 'B'), const TextSpan(text: 'C')]; - painter.text = TextSpan(text: null, children: children); + painter.text = TextSpan(children: children); painter.layout(); Offset caretOffset = painter.getOffsetForCaret(const ui.TextPosition(offset: 0), ui.Rect.zero); @@ -53,7 +53,7 @@ void main() { expect(caretOffset.dx, painter.width); children = []; - painter.text = TextSpan(text: null, children: children); + painter.text = TextSpan(children: children); painter.layout(); caretOffset = painter.getOffsetForCaret(const ui.TextPosition(offset: 0), ui.Rect.zero); @@ -759,7 +759,7 @@ void main() { // Null values are valid. See https://github.com/flutter/flutter/pull/48346#issuecomment-584839221 test('TextPainter set TextHeightBehavior null test', () { - final TextPainter painter = TextPainter(textHeightBehavior: null) + final TextPainter painter = TextPainter() ..textDirection = TextDirection.ltr; painter.textHeightBehavior = const TextHeightBehavior(); @@ -907,7 +907,6 @@ void main() { ..textHeightBehavior = const TextHeightBehavior( applyHeightToFirstAscent: false, applyHeightToLastDescent: false, - leadingDistribution: TextLeadingDistribution.proportional, ) ..layout(); @@ -954,9 +953,7 @@ void main() { const TextSelection(baseOffset: 0, extentOffset: 1), ).first.toRect(); - painter.textHeightBehavior = const TextHeightBehavior( - leadingDistribution: TextLeadingDistribution.proportional, - ); + painter.textHeightBehavior = const TextHeightBehavior(); painter.layout(); final Rect newGlyphBox = painter.getBoxesForSelection( diff --git a/packages/flutter/test/painting/text_span_test.dart b/packages/flutter/test/painting/text_span_test.dart index bcec0332eb..ce6e11e9b5 100644 --- a/packages/flutter/test/painting/text_span_test.dart +++ b/packages/flutter/test/painting/text_span_test.dart @@ -13,8 +13,8 @@ void main() { const TextSpan a2 = TextSpan(text: 'a'); const TextSpan b1 = TextSpan(children: [ a1 ]); const TextSpan b2 = TextSpan(children: [ a2 ]); - const TextSpan c1 = TextSpan(text: null); - const TextSpan c2 = TextSpan(text: null); + const TextSpan c1 = TextSpan(); + const TextSpan c2 = TextSpan(); expect(a1 == a2, isTrue); expect(b1 == b2, isTrue); diff --git a/packages/flutter/test/painting/text_style_test.dart b/packages/flutter/test/painting/text_style_test.dart index 5187cde627..0f1922af72 100644 --- a/packages/flutter/test/painting/text_style_test.dart +++ b/packages/flutter/test/painting/text_style_test.dart @@ -94,7 +94,7 @@ void main() { equals('TextStyle(inherit: false, )'), ); expect( - const TextStyle(inherit: true).toString(), + const TextStyle().toString(), equals('TextStyle()'), ); @@ -465,7 +465,7 @@ void main() { final ui.ParagraphStyle paragraphStyle0 = style0.getParagraphStyle(textScaleFactor: 2.5); const TextStyle style1 = TextStyle(fontSize: 25); - final ui.ParagraphStyle paragraphStyle1 = style1.getParagraphStyle(textScaleFactor: 1); + final ui.ParagraphStyle paragraphStyle1 = style1.getParagraphStyle(); expect(paragraphStyle0 == paragraphStyle1, true); }); diff --git a/packages/flutter/test/physics/newton_test.dart b/packages/flutter/test/physics/newton_test.dart index e70d7363b0..92852c3eaf 100644 --- a/packages/flutter/test/physics/newton_test.dart +++ b/packages/flutter/test/physics/newton_test.dart @@ -128,7 +128,6 @@ void main() { crit = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, - ratio: 1.0, ), 0.0, 300.0, 0.0); expect(crit.type, SpringType.criticallyDamped); @@ -159,7 +158,6 @@ void main() { final SpringSimulation crit = SpringSimulation(SpringDescription.withDampingRatio( mass: 1.0, stiffness: 100.0, - ratio: 1.0, ), 0.0, 500.0, 0.0); crit.tolerance = const Tolerance(distance: 0.01, velocity: 0.01); diff --git a/packages/flutter/test/rendering/annotated_region_test.dart b/packages/flutter/test/rendering/annotated_region_test.dart index 2c94bbc0c3..1b8e38e741 100644 --- a/packages/flutter/test/rendering/annotated_region_test.dart +++ b/packages/flutter/test/rendering/annotated_region_test.dart @@ -11,7 +11,7 @@ void main() { test('finds the first value in a OffsetLayer when sized', () { final ContainerLayer containerLayer = ContainerLayer(); final List layers = [ - OffsetLayer(offset: Offset.zero), + OffsetLayer(), OffsetLayer(offset: const Offset(0.0, 100.0)), OffsetLayer(offset: const Offset(0.0, 200.0)), ]; @@ -140,7 +140,7 @@ void main() { test('finds the first value in a OffsetLayer when sized', () { final ContainerLayer containerLayer = ContainerLayer(); final List layers = [ - OffsetLayer(offset: Offset.zero), + OffsetLayer(), OffsetLayer(offset: const Offset(0.0, 100.0)), OffsetLayer(offset: const Offset(0.0, 200.0)), ]; diff --git a/packages/flutter/test/rendering/baseline_test.dart b/packages/flutter/test/rendering/baseline_test.dart index 1047269906..93aff3afb4 100644 --- a/packages/flutter/test/rendering/baseline_test.dart +++ b/packages/flutter/test/rendering/baseline_test.dart @@ -21,31 +21,31 @@ void main() { ); final BoxParentData childParentData = child.parentData! as BoxParentData; - layout(root, phase: EnginePhase.layout); + layout(root); expect(childParentData.offset.dx, equals(0.0)); expect(childParentData.offset.dy, equals(-100.0)); expect(parent.size, equals(const Size(100.0, 0.0))); parent.baseline = 25.0; - pumpFrame(phase: EnginePhase.layout); + pumpFrame(); expect(childParentData.offset.dx, equals(0.0)); expect(childParentData.offset.dy, equals(-75.0)); expect(parent.size, equals(const Size(100.0, 25.0))); parent.baseline = 90.0; - pumpFrame(phase: EnginePhase.layout); + pumpFrame(); expect(childParentData.offset.dx, equals(0.0)); expect(childParentData.offset.dy, equals(-10.0)); expect(parent.size, equals(const Size(100.0, 90.0))); parent.baseline = 100.0; - pumpFrame(phase: EnginePhase.layout); + pumpFrame(); expect(childParentData.offset.dx, equals(0.0)); expect(childParentData.offset.dy, equals(0.0)); expect(parent.size, equals(const Size(100.0, 100.0))); parent.baseline = 110.0; - pumpFrame(phase: EnginePhase.layout); + pumpFrame(); expect(childParentData.offset.dx, equals(0.0)); expect(childParentData.offset.dy, equals(10.0)); expect(parent.size, equals(const Size(100.0, 110.0))); diff --git a/packages/flutter/test/rendering/box_constraints_test.dart b/packages/flutter/test/rendering/box_constraints_test.dart index f4e3c26aed..aa337b3560 100644 --- a/packages/flutter/test/rendering/box_constraints_test.dart +++ b/packages/flutter/test/rendering/box_constraints_test.dart @@ -93,19 +93,16 @@ void main() { test('BoxConstraints lerp with unbounded width', () { const BoxConstraints constraints1 = BoxConstraints( minWidth: double.infinity, - maxWidth: double.infinity, minHeight: 10.0, maxHeight: 20.0, ); const BoxConstraints constraints2 = BoxConstraints( minWidth: double.infinity, - maxWidth: double.infinity, minHeight: 20.0, maxHeight: 30.0, ); const BoxConstraints constraints3 = BoxConstraints( minWidth: double.infinity, - maxWidth: double.infinity, minHeight: 15.0, maxHeight: 25.0, ); @@ -117,19 +114,16 @@ void main() { minWidth: 10.0, maxWidth: 20.0, minHeight: double.infinity, - maxHeight: double.infinity, ); const BoxConstraints constraints2 = BoxConstraints( minWidth: 20.0, maxWidth: 30.0, minHeight: double.infinity, - maxHeight: double.infinity, ); const BoxConstraints constraints3 = BoxConstraints( minWidth: 15.0, maxWidth: 25.0, minHeight: double.infinity, - maxHeight: double.infinity, ); expect(BoxConstraints.lerp(constraints1, constraints2, 0.5), constraints3); }); @@ -137,19 +131,15 @@ void main() { test('BoxConstraints lerp from bounded to unbounded', () { const BoxConstraints constraints1 = BoxConstraints( minWidth: double.infinity, - maxWidth: double.infinity, minHeight: double.infinity, - maxHeight: double.infinity, ); const BoxConstraints constraints2 = BoxConstraints( minWidth: 20.0, maxWidth: 30.0, minHeight: double.infinity, - maxHeight: double.infinity, ); const BoxConstraints constraints3 = BoxConstraints( minWidth: double.infinity, - maxWidth: double.infinity, minHeight: 20.0, maxHeight: 30.0, ); diff --git a/packages/flutter/test/rendering/box_test.dart b/packages/flutter/test/rendering/box_test.dart index bdfa639c93..2de55ae804 100644 --- a/packages/flutter/test/rendering/box_test.dart +++ b/packages/flutter/test/rendering/box_test.dart @@ -596,7 +596,6 @@ void main() { constrainedAxis: Axis.horizontal, textDirection: TextDirection.ltr, child: RenderFlex( - direction: Axis.horizontal, textDirection: TextDirection.ltr, children: [flexible], ), @@ -1085,9 +1084,9 @@ void main() { test('localToGlobal with ancestor', () { final RenderConstrainedBox innerConstrained = RenderConstrainedBox(additionalConstraints: const BoxConstraints.tightFor(width: 50, height: 50)); - final RenderPositionedBox innerCenter = RenderPositionedBox(alignment: Alignment.center, child: innerConstrained); + final RenderPositionedBox innerCenter = RenderPositionedBox(child: innerConstrained); final RenderConstrainedBox outerConstrained = RenderConstrainedBox(additionalConstraints: const BoxConstraints.tightFor(width: 100, height: 100), child: innerCenter); - final RenderPositionedBox outerCentered = RenderPositionedBox(alignment: Alignment.center, child: outerConstrained); + final RenderPositionedBox outerCentered = RenderPositionedBox(child: outerConstrained); layout(outerCentered); diff --git a/packages/flutter/test/rendering/debug_test.dart b/packages/flutter/test/rendering/debug_test.dart index dce60cc9f2..695041add9 100644 --- a/packages/flutter/test/rendering/debug_test.dart +++ b/packages/flutter/test/rendering/debug_test.dart @@ -224,7 +224,7 @@ void main() { ); layout(root, phase: EnginePhase.compositingBits); - final OffsetLayer rootLayer = OffsetLayer(offset: Offset.zero); + final OffsetLayer rootLayer = OffsetLayer(); final PaintingContext context = PaintingContext( rootLayer, const Rect.fromLTWH(0, 0, 500, 500), diff --git a/packages/flutter/test/rendering/dynamic_intrinsics_test.dart b/packages/flutter/test/rendering/dynamic_intrinsics_test.dart index a1ab1a444f..725992c6c3 100644 --- a/packages/flutter/test/rendering/dynamic_intrinsics_test.dart +++ b/packages/flutter/test/rendering/dynamic_intrinsics_test.dart @@ -86,8 +86,6 @@ void main() { ), ), constraints: const BoxConstraints( - minWidth: 0.0, - minHeight: 0.0, maxWidth: 1000.0, maxHeight: 1000.0, ), @@ -110,8 +108,6 @@ void main() { ), ), constraints: const BoxConstraints( - minWidth: 0.0, - minHeight: 0.0, maxWidth: 1000.0, maxHeight: 1000.0, ), @@ -130,8 +126,6 @@ void main() { layout( RenderInvalidIntrinsics(), constraints: const BoxConstraints( - minWidth: 0.0, - minHeight: 0.0, maxWidth: 1000.0, maxHeight: 1000.0, ), diff --git a/packages/flutter/test/rendering/editable_test.dart b/packages/flutter/test/rendering/editable_test.dart index 0ce14f895a..13f036c0bc 100644 --- a/packages/flutter/test/rendering/editable_test.dart +++ b/packages/flutter/test/rendering/editable_test.dart @@ -41,7 +41,7 @@ class _FakeEditableTextState with TextSelectionDelegate { @override Future pasteText(SelectionChangedCause cause) { - return Future.value(null); + return Future.value(); } @override @@ -131,7 +131,6 @@ void main() { ), startHandleLayerLink: LayerLink(), endHandleLayerLink: LayerLink(), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, locale: const Locale('ja', 'JP'), offset: ViewportOffset.zero(), @@ -183,7 +182,6 @@ void main() { ), startHandleLayerLink: LayerLink(), endHandleLayerLink: LayerLink(), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, locale: const Locale('en', 'US'), offset: ViewportOffset.fixed(10.0), @@ -283,7 +281,6 @@ void main() { final TextSelectionDelegate delegate = _FakeEditableTextState(); final RenderEditable editable = RenderEditable( - textAlign: TextAlign.start, textDirection: TextDirection.ltr, offset: ViewportOffset.zero(), textSelectionDelegate: delegate, @@ -794,7 +791,6 @@ void main() { ), startHandleLayerLink: LayerLink(), endHandleLayerLink: LayerLink(), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, locale: const Locale('en', 'US'), offset: ViewportOffset.fixed(10.0), @@ -832,7 +828,6 @@ void main() { style: TextStyle(height: 1.0, fontSize: 10.0, fontFamily: 'Ahem'), text: '12345', ), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, locale: const Locale('en', 'US'), offset: ViewportOffset.zero(), @@ -896,7 +891,6 @@ void main() { // This is a Unicode left-to-right mark character that will not render // any glyphs. text: const TextSpan(text: '\u200e'), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, offset: ViewportOffset.zero(), textSelectionDelegate: delegate, @@ -915,7 +909,6 @@ void main() { final TextSelectionDelegate delegate = _FakeEditableTextState(); final RenderEditable editable = RenderEditable( maxLines: null, - textAlign: TextAlign.start, textDirection: TextDirection.ltr, offset: ViewportOffset.zero(), textSelectionDelegate: delegate, @@ -1281,7 +1274,6 @@ void main() { textDirection: TextDirection.ltr, // Given maxLines of 1 and an offset of 5, the editable will be // scrolled by 5 pixels to the left. - maxLines: 1, offset: ViewportOffset.fixed(5.0), textSelectionDelegate: delegate, selection: const TextSelection.collapsed( @@ -1696,10 +1688,8 @@ void main() { ), startHandleLayerLink: LayerLink(), endHandleLayerLink: LayerLink(), - textAlign: TextAlign.start, textDirection: TextDirection.ltr, locale: const Locale('en', 'US'), - forceLine: true, offset: ViewportOffset.fixed(10.0), textSelectionDelegate: delegate, selection: const TextSelection.collapsed(offset: 0), diff --git a/packages/flutter/test/rendering/flex_test.dart b/packages/flutter/test/rendering/flex_test.dart index f72a46e3de..733769a789 100644 --- a/packages/flutter/test/rendering/flex_test.dart +++ b/packages/flutter/test/rendering/flex_test.dart @@ -79,7 +79,6 @@ void main() { ); final RenderFlex flex = RenderFlex( direction: Axis.vertical, - verticalDirection: VerticalDirection.down, children: [ RenderConstrainedBox(additionalConstraints: const BoxConstraints.tightFor(height: 200.0)), flexible, @@ -101,7 +100,6 @@ void main() { additionalConstraints: const BoxConstraints.expand(), ); final RenderFlex flex = RenderFlex( - direction: Axis.horizontal, textDirection: TextDirection.ltr, children: [ RenderConstrainedBox(additionalConstraints: const BoxConstraints.tightFor(width: 200.0)), @@ -122,7 +120,6 @@ void main() { test('Vertical Flipped Constraints', () { final RenderFlex flex = RenderFlex( direction: Axis.vertical, - verticalDirection: VerticalDirection.down, children: [ RenderAspectRatio(aspectRatio: 1.0), ], @@ -161,9 +158,7 @@ void main() { final RenderDecoratedBox box2 = RenderDecoratedBox(decoration: const BoxDecoration()); final RenderFlex flex = RenderFlex(textDirection: TextDirection.ltr, children: [box1, box2]); layout(flex, constraints: const BoxConstraints( - minWidth: 0.0, maxWidth: 100.0, - minHeight: 0.0, maxHeight: 100.0, )); expect(box1.size.width, equals(0.0)); @@ -190,9 +185,7 @@ void main() { box2ParentData.flex = 2; flex.addAll([box1, box2]); layout(flex, constraints: const BoxConstraints( - minWidth: 0.0, maxWidth: 100.0, - minHeight: 0.0, maxHeight: 100.0, )); expect(box1.size.width, equals(0.0)); @@ -222,9 +215,7 @@ void main() { final RenderFlex flex = RenderFlex(textDirection: TextDirection.ltr, mainAxisAlignment: MainAxisAlignment.spaceEvenly); flex.addAll([box1, box2, box3]); layout(flex, constraints: const BoxConstraints( - minWidth: 0.0, maxWidth: 500.0, - minHeight: 0.0, maxHeight: 400.0, )); Offset getOffset(RenderBox box) { @@ -255,9 +246,7 @@ void main() { final RenderFlex flex = RenderFlex(textDirection: TextDirection.ltr, mainAxisAlignment: MainAxisAlignment.spaceBetween); flex.addAll([box1, box2, box3]); layout(flex, constraints: const BoxConstraints( - minWidth: 0.0, maxWidth: 500.0, - minHeight: 0.0, maxHeight: 400.0, )); Offset getOffset(RenderBox box) { @@ -310,9 +299,7 @@ void main() { ); flex.addAll([box1, box2, box3]); layout(flex, constraints: const BoxConstraints( - minWidth: 0.0, maxWidth: 500.0, - minHeight: 0.0, maxHeight: 400.0, )); Offset getOffset(RenderBox box) { @@ -434,7 +421,6 @@ void main() { final RenderConstrainedBox box3 = RenderConstrainedBox(additionalConstraints: square); final RenderFlex flex = RenderFlex( textDirection: TextDirection.ltr, - mainAxisSize: MainAxisSize.max, ); final RenderConstrainedOverflowBox parent = RenderConstrainedOverflowBox( minWidth: 0.0, diff --git a/packages/flutter/test/rendering/independent_layout_test.dart b/packages/flutter/test/rendering/independent_layout_test.dart index 0ffbe51013..87db55d535 100644 --- a/packages/flutter/test/rendering/independent_layout_test.dart +++ b/packages/flutter/test/rendering/independent_layout_test.dart @@ -34,7 +34,6 @@ class TestLayout { void main() { const ViewConfiguration testConfiguration = ViewConfiguration( size: Size(800.0, 600.0), - devicePixelRatio: 1.0, ); test('onscreen layout does not affect offscreen', () { diff --git a/packages/flutter/test/rendering/layer_annotations_test.dart b/packages/flutter/test/rendering/layer_annotations_test.dart index d78ec70e98..33a97ca2dc 100644 --- a/packages/flutter/test/rendering/layer_annotations_test.dart +++ b/packages/flutter/test/rendering/layer_annotations_test.dart @@ -524,7 +524,7 @@ void main() { final Layer root = _withBackgroundAnnotation( 1000, _Layers( - AnnotatedRegionLayer(1, opaque: false), + AnnotatedRegionLayer(1), children: [ _TestAnnotatedLayer(2, opaque: false), ], @@ -626,7 +626,7 @@ void main() { final Layer root = _withBackgroundAnnotation( 1000, _Layers( - AnnotatedRegionLayer(1, opaque: false, size: Size.zero), + AnnotatedRegionLayer(1, size: Size.zero), children: [ _TestAnnotatedLayer(2, opaque: true), ], @@ -651,7 +651,7 @@ void main() { final Layer root = _withBackgroundAnnotation( 1000, _Layers( - AnnotatedRegionLayer(1, opaque: false), + AnnotatedRegionLayer(1), children: [ _TestAnnotatedLayer(2, opaque: false), ], diff --git a/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart b/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart index 331b2a3624..b74224eba1 100644 --- a/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart +++ b/packages/flutter/test/rendering/mouse_tracker_cursor_test.dart @@ -251,7 +251,7 @@ void main() { ); annotations = [ - const TestAnnotationTarget(cursor: MouseCursor.defer), + const TestAnnotationTarget(), const TestAnnotationTarget(cursor: SystemMouseCursors.click), const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing), ]; @@ -279,8 +279,8 @@ void main() { ); annotations = [ - const TestAnnotationTarget(cursor: MouseCursor.defer), - const TestAnnotationTarget(cursor: MouseCursor.defer), + const TestAnnotationTarget(), + const TestAnnotationTarget(), const TestAnnotationTarget(cursor: SystemMouseCursors.grabbing), ]; ui.window.onPointerDataPacket!(ui.PointerDataPacket(data: [ diff --git a/packages/flutter/test/rendering/mouse_tracker_test.dart b/packages/flutter/test/rendering/mouse_tracker_test.dart index 8b2dec51d4..4d2a55727d 100644 --- a/packages/flutter/test/rendering/mouse_tracker_test.dart +++ b/packages/flutter/test/rendering/mouse_tracker_test.dart @@ -93,7 +93,7 @@ void main() { addTearDown(() => dispatchRemoveDevice()); expect(events, _equalToEventsOnCriticalFields([ - EventMatcher(const PointerEnterEvent(position: Offset.zero)), + EventMatcher(const PointerEnterEvent()), ])); expect(listenerLogs, [true]); events.clear(); @@ -145,7 +145,7 @@ void main() { _pointerData(PointerChange.hover, const Offset(0.0, 1.0)), ])); expect(events, _equalToEventsOnCriticalFields([ - EventMatcher(const PointerEnterEvent(position: Offset.zero)), + EventMatcher(const PointerEnterEvent()), EventMatcher(const PointerHoverEvent(position: Offset(0.0, 1.0))), ])); expect(_mouseTracker.mouseIsConnected, isTrue); diff --git a/packages/flutter/test/rendering/non_render_object_root_test.dart b/packages/flutter/test/rendering/non_render_object_root_test.dart index a87430772c..9d5054d93d 100644 --- a/packages/flutter/test/rendering/non_render_object_root_test.dart +++ b/packages/flutter/test/rendering/non_render_object_root_test.dart @@ -45,7 +45,6 @@ void main() { RenderPositionedBox child; final RealRoot root = RealRoot( child = RenderPositionedBox( - alignment: Alignment.center, child: RenderSizedBox(const Size(100.0, 100.0)), ), ); diff --git a/packages/flutter/test/rendering/paragraph_test.dart b/packages/flutter/test/rendering/paragraph_test.dart index b8e2cb08e2..d9664683a8 100644 --- a/packages/flutter/test/rendering/paragraph_test.dart +++ b/packages/flutter/test/rendering/paragraph_test.dart @@ -254,7 +254,6 @@ void main() { ), textDirection: TextDirection.ltr, maxLines: 1, - softWrap: true, ); void relayoutWith({ @@ -276,7 +275,7 @@ void main() { relayoutWith(maxLines: 3, softWrap: true, overflow: TextOverflow.clip); expect(paragraph.size.height, equals(3 * lineHeight)); - relayoutWith(maxLines: null, softWrap: true, overflow: TextOverflow.clip); + relayoutWith(softWrap: true, overflow: TextOverflow.clip); expect(paragraph.size.height, greaterThan(5 * lineHeight)); // Try again with ellipsis overflow. We can't test that the ellipsis are @@ -291,7 +290,7 @@ void main() { // infinite wrapping. However, if we did, we'd never know when to append an // ellipsis, so this really means "append ellipsis as soon as we exceed the // width". - relayoutWith(maxLines: null, softWrap: true, overflow: TextOverflow.ellipsis); + relayoutWith(softWrap: true, overflow: TextOverflow.ellipsis); expect(paragraph.size.height, equals(2 * lineHeight)); // Now with no soft wrapping. @@ -301,7 +300,7 @@ void main() { relayoutWith(maxLines: 3, softWrap: false, overflow: TextOverflow.clip); expect(paragraph.size.height, equals(2 * lineHeight)); - relayoutWith(maxLines: null, softWrap: false, overflow: TextOverflow.clip); + relayoutWith(softWrap: false, overflow: TextOverflow.clip); expect(paragraph.size.height, equals(2 * lineHeight)); relayoutWith(maxLines: 1, softWrap: false, overflow: TextOverflow.ellipsis); @@ -310,7 +309,7 @@ void main() { relayoutWith(maxLines: 3, softWrap: false, overflow: TextOverflow.ellipsis); expect(paragraph.size.height, equals(3 * lineHeight)); - relayoutWith(maxLines: null, softWrap: false, overflow: TextOverflow.ellipsis); + relayoutWith(softWrap: false, overflow: TextOverflow.ellipsis); expect(paragraph.size.height, equals(2 * lineHeight)); // Test presence of the fade effect. @@ -576,7 +575,6 @@ void main() { WidgetSpan(child: Text(sentence)), ], ), - textScaleFactor: 1.0, children: renderBoxes, textDirection: TextDirection.ltr, ); @@ -621,7 +619,6 @@ void main() { WidgetSpan(child: Text(sentence)), ], ), - textScaleFactor: 1.0, children: renderBoxes, textDirection: TextDirection.ltr, ); @@ -718,7 +715,6 @@ void main() { ], ), overflow: TextOverflow.ellipsis, - textScaleFactor: 1.0, children: renderBoxes, textDirection: TextDirection.ltr, ); diff --git a/packages/flutter/test/rendering/proxy_box_test.dart b/packages/flutter/test/rendering/proxy_box_test.dart index 6733cce245..7a832420c9 100644 --- a/packages/flutter/test/rendering/proxy_box_test.dart +++ b/packages/flutter/test/rendering/proxy_box_test.dart @@ -17,7 +17,6 @@ void main() { test('RenderFittedBox handles applying paint transform and hit-testing with empty size', () { final RenderFittedBox fittedBox = RenderFittedBox( child: RenderCustomPaint( - preferredSize: Size.zero, painter: TestCallbackPainter(onPaint: () {}), ), ); @@ -276,7 +275,6 @@ void main() { test('RenderOpacity does composite if it is opaque', () { final RenderOpacity renderOpacity = RenderOpacity( - opacity: 1.0, child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter ); @@ -297,7 +295,6 @@ void main() { )..value = 0.0; final RenderAnimatedOpacity renderAnimatedOpacity = RenderAnimatedOpacity( - alwaysIncludeSemantics: false, opacity: opacityAnimation, child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter ); @@ -312,7 +309,6 @@ void main() { )..value = 1.0; final RenderAnimatedOpacity renderAnimatedOpacity = RenderAnimatedOpacity( - alwaysIncludeSemantics: false, opacity: opacityAnimation, child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter ); @@ -433,7 +429,6 @@ void main() { void _testFittedBoxWithClipRectLayer() { _testLayerReuse(RenderFittedBox( - alignment: Alignment.center, fit: BoxFit.cover, clipBehavior: Clip.hardEdge, // Inject opacity under the clip to force compositing. @@ -446,7 +441,6 @@ void main() { void _testFittedBoxWithTransformLayer() { _testLayerReuse(RenderFittedBox( - alignment: Alignment.center, fit: BoxFit.fill, // Inject opacity under the clip to force compositing. child: RenderOpacity( @@ -516,7 +510,6 @@ void main() { test('RenderFollowerLayer hit test without a leader layer and the showWhenUnlinked is true', () { final RenderFollowerLayer follower = RenderFollowerLayer( link: LayerLink(), - showWhenUnlinked: true, child: RenderSizedBox(const Size(1.0, 1.0)), ); layout(follower, constraints: BoxConstraints.tight(const Size(200.0, 200.0))); @@ -543,7 +536,6 @@ void main() { final RenderFollowerLayer follower = RenderFollowerLayer( link: link, - showWhenUnlinked: true, child: RenderSizedBox(const Size(1.0, 1.0)), ); layout(follower, constraints: BoxConstraints.tight(const Size(200.0, 200.0))); diff --git a/packages/flutter/test/rendering/proxy_sliver_test.dart b/packages/flutter/test/rendering/proxy_sliver_test.dart index a197f8292f..d2de69c6d9 100644 --- a/packages/flutter/test/rendering/proxy_sliver_test.dart +++ b/packages/flutter/test/rendering/proxy_sliver_test.dart @@ -18,7 +18,6 @@ void main() { ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -31,14 +30,12 @@ void main() { test('RenderSliverOpacity does composite if it is opaque', () { final RenderSliverOpacity renderSliverOpacity = RenderSliverOpacity( - opacity: 1.0, sliver: RenderSliverToBoxAdapter( child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter ), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -57,7 +54,6 @@ void main() { ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -83,7 +79,6 @@ void main() { )..value = 0.0; final RenderSliverAnimatedOpacity renderSliverAnimatedOpacity = RenderSliverAnimatedOpacity( - alwaysIncludeSemantics: false, opacity: opacityAnimation, sliver: RenderSliverToBoxAdapter( child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter @@ -91,7 +86,6 @@ void main() { ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -108,7 +102,6 @@ void main() { )..value = 1.0; final RenderSliverAnimatedOpacity renderSliverAnimatedOpacity = RenderSliverAnimatedOpacity( - alwaysIncludeSemantics: false, opacity: opacityAnimation, sliver: RenderSliverToBoxAdapter( child: RenderSizedBox(const Size(1.0, 1.0)), // size doesn't matter @@ -116,7 +109,6 @@ void main() { ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -140,7 +132,6 @@ void main() { ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, diff --git a/packages/flutter/test/rendering/reattach_test.dart b/packages/flutter/test/rendering/reattach_test.dart index 74c13216a0..d29b4fc8b5 100644 --- a/packages/flutter/test/rendering/reattach_test.dart +++ b/packages/flutter/test/rendering/reattach_test.dart @@ -84,7 +84,7 @@ void main() { test('objects can be detached and re-attached: layout', () { final TestTree testTree = TestTree(); // Lay out - layout(testTree.root, phase: EnginePhase.layout); + layout(testTree.root); expect(testTree.child.size, equals(const Size(20.0, 20.0))); // Remove testTree from the custom render view renderer.renderView.child = null; @@ -93,7 +93,7 @@ void main() { testTree.child.additionalConstraints = const BoxConstraints.tightFor(height: 5.0, width: 5.0); // Lay out again - layout(testTree.root, phase: EnginePhase.layout); + layout(testTree.root); expect(testTree.child.size, equals(const Size(5.0, 5.0))); }); test('objects can be detached and re-attached: compositingBits', () { diff --git a/packages/flutter/test/rendering/repaint_boundary_test.dart b/packages/flutter/test/rendering/repaint_boundary_test.dart index 7a12512bdb..5c23c2c3e8 100644 --- a/packages/flutter/test/rendering/repaint_boundary_test.dart +++ b/packages/flutter/test/rendering/repaint_boundary_test.dart @@ -11,14 +11,10 @@ void main() { test('nested repaint boundaries - smoke test', () { RenderOpacity a, b, c; a = RenderOpacity( - opacity: 1.0, child: RenderRepaintBoundary( child: b = RenderOpacity( - opacity: 1.0, child: RenderRepaintBoundary( - child: c = RenderOpacity( - opacity: 1.0, - ), + child: c = RenderOpacity(), ), ), ), @@ -55,7 +51,6 @@ void main() { test('Framework creates an OffsetLayer for a repaint boundary', () { final _TestRepaintBoundary repaintBoundary = _TestRepaintBoundary(); final RenderOpacity opacity = RenderOpacity( - opacity: 1.0, child: repaintBoundary, ); layout(opacity, phase: EnginePhase.flushSemantics); @@ -65,7 +60,6 @@ void main() { test('Framework does not create an OffsetLayer for a non-repaint boundary', () { final _TestNonCompositedBox nonCompositedBox = _TestNonCompositedBox(); final RenderOpacity opacity = RenderOpacity( - opacity: 1.0, child: nonCompositedBox, ); layout(opacity, phase: EnginePhase.flushSemantics); @@ -75,7 +69,6 @@ void main() { test('Framework allows a non-repaint boundary to create own layer', () { final _TestCompositedBox compositedBox = _TestCompositedBox(); final RenderOpacity opacity = RenderOpacity( - opacity: 1.0, child: compositedBox, ); layout(opacity, phase: EnginePhase.flushSemantics); @@ -85,7 +78,6 @@ void main() { test('Framework ensures repaint boundary layer is not overwritten', () { final _TestRepaintBoundaryThatOverwritesItsLayer faultyRenderObject = _TestRepaintBoundaryThatOverwritesItsLayer(); final RenderOpacity opacity = RenderOpacity( - opacity: 1.0, child: faultyRenderObject, ); diff --git a/packages/flutter/test/rendering/semantics_and_children_test.dart b/packages/flutter/test/rendering/semantics_and_children_test.dart index 740e973106..5371f58dbe 100644 --- a/packages/flutter/test/rendering/semantics_and_children_test.dart +++ b/packages/flutter/test/rendering/semantics_and_children_test.dart @@ -42,7 +42,6 @@ void main() { test('RenderOpacity and children and semantics', () { final AnimationController controller = AnimationController(vsync: const TestVSync()); final RenderAnimatedOpacity box = RenderAnimatedOpacity( - alwaysIncludeSemantics: false, opacity: controller, child: RenderParagraph( const TextSpan(), diff --git a/packages/flutter/test/rendering/sliver_cache_test.dart b/packages/flutter/test/rendering/sliver_cache_test.dart index 644962505c..b70a0fb83e 100644 --- a/packages/flutter/test/rendering/sliver_cache_test.dart +++ b/packages/flutter/test/rendering/sliver_cache_test.dart @@ -18,7 +18,6 @@ void main() { // Viewport is 800x600, can show 6 children at a time. final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -289,7 +288,6 @@ void main() { ); RenderSliverFixedExtentList inner; final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -389,7 +387,6 @@ void main() { ); RenderSliverList inner; final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -489,7 +486,6 @@ void main() { ); RenderSliverGrid inner; final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, @@ -597,7 +593,6 @@ void main() { final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 250.0, diff --git a/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart b/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart index 8b262e4e6d..3863b46b63 100644 --- a/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart +++ b/packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart @@ -18,7 +18,6 @@ void main() { children: children, ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0, diff --git a/packages/flutter/test/rendering/sliver_persistent_header_test.dart b/packages/flutter/test/rendering/sliver_persistent_header_test.dart index 6ad191beee..48f373fdff 100644 --- a/packages/flutter/test/rendering/sliver_persistent_header_test.dart +++ b/packages/flutter/test/rendering/sliver_persistent_header_test.dart @@ -12,7 +12,6 @@ void main() { test('RenderSliverFloatingPersistentHeader maxScrollObstructionExtent is 0', () { final TestRenderSliverFloatingPersistentHeader header = TestRenderSliverFloatingPersistentHeader(child: RenderSizedBox(const Size(400.0, 100.0))); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0, @@ -30,7 +29,6 @@ void main() { child: RenderSizedBox(const Size(400.0, 100.0)), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0, diff --git a/packages/flutter/test/rendering/slivers_block_test.dart b/packages/flutter/test/rendering/slivers_block_test.dart index 87f2257742..ccac4b7dc2 100644 --- a/packages/flutter/test/rendering/slivers_block_test.dart +++ b/packages/flutter/test/rendering/slivers_block_test.dart @@ -126,7 +126,6 @@ void main() { ], ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), cacheExtent: 0.0, @@ -278,7 +277,6 @@ void main() { ], ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), children: [ @@ -313,7 +311,6 @@ void main() { ); inner = childManager.createRenderObject(); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), children: [ diff --git a/packages/flutter/test/rendering/slivers_test.dart b/packages/flutter/test/rendering/slivers_test.dart index 67c6f2e944..a3505ce1bf 100644 --- a/packages/flutter/test/rendering/slivers_test.dart +++ b/packages/flutter/test/rendering/slivers_test.dart @@ -701,7 +701,6 @@ void main() { expect( const SliverGeometry( scrollExtent: 100.0, - paintExtent: 0.0, layoutExtent: 20.0, ).toString(), equals( @@ -717,7 +716,6 @@ void main() { child: RenderSizedBox(const Size(400.0, height)), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), children: [ @@ -760,7 +758,6 @@ void main() { child: RenderSizedBox(const Size(viewportWidth, 150.0)), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), children: [ @@ -784,7 +781,6 @@ void main() { child: RenderSizedBox(const Size(viewportWidth, 150.0)), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.zero(), children: [ @@ -811,7 +807,6 @@ void main() { child: RenderSizedBox(const Size(viewportWidth, 150.0)), ); final RenderViewport root = RenderViewport( - axisDirection: AxisDirection.down, crossAxisDirection: AxisDirection.right, offset: ViewportOffset.fixed(100.0), children: [ diff --git a/packages/flutter/test/rendering/table_border_test.dart b/packages/flutter/test/rendering/table_border_test.dart index 12056612bc..304902a50a 100644 --- a/packages/flutter/test/rendering/table_border_test.dart +++ b/packages/flutter/test/rendering/table_border_test.dart @@ -8,16 +8,16 @@ import 'package:flutter_test/flutter_test.dart'; void main() { test('TableBorder constructor', () { const TableBorder border1 = TableBorder( - left: BorderSide(width: 1.0), + left: BorderSide(), right: BorderSide(color: Color(0xFF00FF00)), verticalInside: BorderSide(), ); expect(border1.top, BorderSide.none); expect(border1.right, const BorderSide(color: Color(0xFF00FF00))); expect(border1.bottom, BorderSide.none); - expect(border1.left, const BorderSide(width: 1.0)); + expect(border1.left, const BorderSide()); expect(border1.horizontalInside, BorderSide.none); - expect(border1.verticalInside, const BorderSide(width: 1.0, color: Color(0xFF000000))); + expect(border1.verticalInside, const BorderSide()); expect(border1.dimensions, const EdgeInsets.symmetric(horizontal: 1.0)); expect(border1.isUniform, isFalse); expect(border1.scale(2.0), const TableBorder( @@ -57,13 +57,12 @@ void main() { expect(border3.dimensions, const EdgeInsets.symmetric(horizontal: 1.0, vertical: 1.0)); expect(border3.isUniform, isFalse); expect(border3.scale(0.0), TableBorder.symmetric( - inside: BorderSide.none, outside: const BorderSide(width: 0.0, color: Color(0xFFFF0000), style: BorderStyle.none), )); }); test('TableBorder.lerp', () { - const BorderSide side1 = BorderSide(width: 1.0, color: Color(0x00000001)); + const BorderSide side1 = BorderSide(color: Color(0x00000001)); const BorderSide side2 = BorderSide(width: 2.0, color: Color(0x00000002)); const BorderSide side3 = BorderSide(width: 3.0, color: Color(0x00000003)); const BorderSide side4 = BorderSide(width: 4.0, color: Color(0x00000004)); @@ -111,7 +110,7 @@ void main() { test('TableBorder.lerp with nulls', () { final TableBorder table2 = TableBorder.all(width: 2.0); - final TableBorder table1 = TableBorder.all(width: 1.0); + final TableBorder table1 = TableBorder.all(); expect(TableBorder.lerp(table2, null, 0.5), table1); expect(TableBorder.lerp(null, table2, 0.5), table1); expect(TableBorder.lerp(null, null, 0.5), null); diff --git a/packages/flutter/test/rendering/table_test.dart b/packages/flutter/test/rendering/table_test.dart index 6a0a7c7b5d..1b1ef2a7b0 100644 --- a/packages/flutter/test/rendering/table_test.dart +++ b/packages/flutter/test/rendering/table_test.dart @@ -240,7 +240,7 @@ void main() { ), ], columnWidths: const { - 0: FlexColumnWidth(1.0), + 0: FlexColumnWidth(), 1: FlexColumnWidth(0.123), 2: FlexColumnWidth(0.123), 3: FlexColumnWidth(0.123), diff --git a/packages/flutter/test/rendering/viewport_caching_test.dart b/packages/flutter/test/rendering/viewport_caching_test.dart index 8f36caa263..ea29851d88 100644 --- a/packages/flutter/test/rendering/viewport_caching_test.dart +++ b/packages/flutter/test/rendering/viewport_caching_test.dart @@ -66,7 +66,6 @@ void main() { () => RenderViewport( crossAxisDirection: AxisDirection.left, offset: ViewportOffset.zero(), - cacheExtent: null, cacheExtentStyle: CacheExtentStyle.viewport, children: children, ), diff --git a/packages/flutter/test/rendering/viewport_test.dart b/packages/flutter/test/rendering/viewport_test.dart index 2cfe466f96..e5b9a51a3d 100644 --- a/packages/flutter/test/rendering/viewport_test.dart +++ b/packages/flutter/test/rendering/viewport_test.dart @@ -582,7 +582,7 @@ void main() { testWidgets('Nested Viewports showOnScreen', (WidgetTester tester) async { final List controllersX = List.generate(10, (int i) => ScrollController(initialScrollOffset: 400.0)); - final ScrollController controllerY = ScrollController(initialScrollOffset: 400.0); + final ScrollController controllerY = ScrollController(initialScrollOffset: 400.0); final List> children = List>.generate(10, (int y) { return List.generate(10, (int x) { return SizedBox( @@ -943,8 +943,8 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/20893. List slivers; - final ScrollController controllerX = ScrollController(initialScrollOffset: 0.0); - final ScrollController controllerY = ScrollController(initialScrollOffset: 0.0); + final ScrollController controllerX = ScrollController(); + final ScrollController controllerY = ScrollController(); await tester.pumpWidget( Directionality( @@ -993,8 +993,8 @@ void main() { testWidgets('Nested Viewports showOnScreen on Sliver with allowImplicitScrolling=false for inner viewport', (WidgetTester tester) async { Widget sliver; - final ScrollController controllerX = ScrollController(initialScrollOffset: 0.0); - final ScrollController controllerY = ScrollController(initialScrollOffset: 0.0); + final ScrollController controllerX = ScrollController(); + final ScrollController controllerY = ScrollController(); await tester.pumpWidget( Directionality( @@ -1130,7 +1130,6 @@ void main() { return i == 10 ? SliverPersistentHeader( pinned: true, - floating: false, delegate: _TestSliverPersistentHeaderDelegate( minExtent: 100, maxExtent: 300, @@ -1284,7 +1283,7 @@ void main() { key: headerKey, pinned: true, floating: true, - delegate: _TestSliverPersistentHeaderDelegate(minExtent: 100, maxExtent: 300, child: null, vsync: vsync), + delegate: _TestSliverPersistentHeaderDelegate(minExtent: 100, maxExtent: 300, vsync: vsync), ), ), ); @@ -1486,8 +1485,8 @@ void main() { } group('Floating header showOnScreen', () { - testFloatingHeaderShowOnScreen(animated: true, axis: Axis.vertical); - testFloatingHeaderShowOnScreen(animated: true, axis: Axis.horizontal); + testFloatingHeaderShowOnScreen(); + testFloatingHeaderShowOnScreen(axis: Axis.horizontal); }); group('RenderViewport getOffsetToReveal renderBox to sliver coordinates conversion', () { @@ -1525,7 +1524,7 @@ void main() { } testWidgets('up, forward growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: true, reverseGrowth: false)); + await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 5', skipOffstage: false)); @@ -1543,7 +1542,7 @@ void main() { }); testWidgets('right, forward growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: false, reverseGrowth: false)); + await tester.pumpWidget(buildList(axis: Axis.horizontal)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 5', skipOffstage: false)); @@ -1552,7 +1551,7 @@ void main() { }); testWidgets('right, reverse growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: false, reverseGrowth: true)); + await tester.pumpWidget(buildList(axis: Axis.horizontal, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 0', skipOffstage: false)); @@ -1561,7 +1560,7 @@ void main() { }); testWidgets('down, forward growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: false, reverseGrowth: false)); + await tester.pumpWidget(buildList(axis: Axis.vertical)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 5', skipOffstage: false)); @@ -1570,7 +1569,7 @@ void main() { }); testWidgets('down, reverse growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.vertical, reverse: false, reverseGrowth: true)); + await tester.pumpWidget(buildList(axis: Axis.vertical, reverseGrowth: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 0', skipOffstage: false)); @@ -1579,7 +1578,7 @@ void main() { }); testWidgets('left, forward growth', (WidgetTester tester) async { - await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: true, reverseGrowth: false)); + await tester.pumpWidget(buildList(axis: Axis.horizontal, reverse: true)); final RenderAbstractViewport viewport = tester.allRenderObjects.whereType().first; final RenderObject target = tester.renderObject(find.text('Tile 5', skipOffstage: false)); @@ -1698,7 +1697,7 @@ void main() { testWidgets('Horizontal viewport was given unbounded width', (WidgetTester tester) async { await expectFlutterError( - widget: buildNestedWidget(Axis.horizontal, Axis.horizontal), + widget: buildNestedWidget(Axis.horizontal), tester: tester, message: 'FlutterError\n' diff --git a/packages/flutter/test/semantics/semantics_test.dart b/packages/flutter/test/semantics/semantics_test.dart index 9a1cb5dd1b..33e9f54201 100644 --- a/packages/flutter/test/semantics/semantics_test.dart +++ b/packages/flutter/test/semantics/semantics_test.dart @@ -241,13 +241,10 @@ void main() { isSemanticBoundary: true, child: TestRender( hasLongPressAction: true, - isSemanticBoundary: false, child: middle = TestRender( hasScrollLeftAction: true, - isSemanticBoundary: false, child: TestRender( hasScrollRightAction: true, - isSemanticBoundary: false, child: TestRender( hasScrollUpAction: true, isSemanticBoundary: true, @@ -292,7 +289,7 @@ void main() { expect(child2.transform, isNull); expect( - root.toStringDeep(childOrder: DebugSemanticsDumpOrder.traversalOrder), + root.toStringDeep(), 'SemanticsNode#3\n' ' │ STALE\n' ' │ owner: null\n' @@ -378,7 +375,7 @@ void main() { childrenInInversePaintOrder: [child1, child2], ); expect( - root.toStringDeep(childOrder: DebugSemanticsDumpOrder.traversalOrder), + root.toStringDeep(), 'SemanticsNode#3\n' ' │ STALE\n' ' │ owner: null\n' @@ -433,7 +430,7 @@ void main() { ); expect( - rootComplex.toStringDeep(childOrder: DebugSemanticsDumpOrder.traversalOrder), + rootComplex.toStringDeep(), 'SemanticsNode#7\n' ' │ STALE\n' ' │ owner: null\n' @@ -555,7 +552,7 @@ void main() { final SemanticsNode allProperties = SemanticsNode() ..rect = const Rect.fromLTWH(50.0, 10.0, 20.0, 30.0) ..transform = Matrix4.translation(Vector3(10.0, 10.0, 0.0)) - ..updateWith(config: config, childrenInInversePaintOrder: null); + ..updateWith(config: config); expect( allProperties.toStringDeep(), equalsIgnoringHashCodes( diff --git a/packages/flutter/test/services/default_binary_messenger_test.dart b/packages/flutter/test/services/default_binary_messenger_test.dart index 9d26f60d99..6576ffc221 100644 --- a/packages/flutter/test/services/default_binary_messenger_test.dart +++ b/packages/flutter/test/services/default_binary_messenger_test.dart @@ -51,7 +51,7 @@ void main() { }); test('can check the mock handler', () { - Future handler(ByteData? call) => Future.value(null); + Future handler(ByteData? call) => Future.value(); final TestDefaultBinaryMessenger messenger = TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger; expect(messenger.checkMockMessageHandler('test_channel', null), true); diff --git a/packages/flutter/test/services/message_codecs_test.dart b/packages/flutter/test/services/message_codecs_test.dart index c7193e746f..e8d0dc50b1 100644 --- a/packages/flutter/test/services/message_codecs_test.dart +++ b/packages/flutter/test/services/message_codecs_test.dart @@ -80,7 +80,6 @@ void main() { test('should allow null error message,', () { final ByteData errorData = method.encodeErrorEnvelope( code: 'errorCode', - message: null, details: 'errorDetails', ); expect( diff --git a/packages/flutter/test/services/platform_channel_test.dart b/packages/flutter/test/services/platform_channel_test.dart index 9e08660323..86a3e86301 100644 --- a/packages/flutter/test/services/platform_channel_test.dart +++ b/packages/flutter/test/services/platform_channel_test.dart @@ -217,7 +217,7 @@ void main() { test('can handle method call with expressive error result', () async { channel.setMethodCallHandler((MethodCall call) async { - throw PlatformException(code: 'bad', message: 'sayHello failed', details: null); + throw PlatformException(code: 'bad', message: 'sayHello failed'); }); final ByteData call = jsonMethod.encodeMethodCall(const MethodCall('sayHello', 'hello')); ByteData? envelope; @@ -256,7 +256,7 @@ void main() { }); test('can check the mock handler', () async { - Future handler(MethodCall call) => Future.value(null); + Future handler(MethodCall call) => Future.value(); const MethodChannel channel = MethodChannel('test_handler'); expect(TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.checkMockMessageHandler(channel.name, null), true); diff --git a/packages/flutter/test/services/raw_keyboard_test.dart b/packages/flutter/test/services/raw_keyboard_test.dart index bb1ca4abe3..aec3be993a 100644 --- a/packages/flutter/test/services/raw_keyboard_test.dart +++ b/packages/flutter/test/services/raw_keyboard_test.dart @@ -204,7 +204,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'macos', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -229,7 +228,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'ios', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -254,7 +252,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'windows', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -279,7 +276,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'android', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -304,7 +300,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'fuchsia', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -329,7 +324,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'linux', - isDown: true, ); // Change the modifiers so that they show the shift key as already down // when this event is received, but it's not in keysPressed yet. @@ -362,7 +356,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'web', - isDown: true, ); data['metaState'] = (data['metaState'] as int) | RawKeyEventDataWeb.modifierShift; // Dispatch the modified data. @@ -406,7 +399,6 @@ void main() { final Map data3 = KeyEventSimulator.getKeyData( LogicalKeyboardKey.shiftRight, platform: 'web', - isDown: true, ); data['metaState'] = (data['metaState'] as int) | RawKeyEventDataWeb.modifierShift; // Dispatch the modified data. @@ -450,7 +442,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'android', - isDown: true, ); // Set only the generic "down" modifier, without setting a side. data['metaState'] = (data['metaState'] as int) | @@ -488,7 +479,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'macos', - isDown: true, ); // Set only the generic "shift down" modifier, without setting a side. data['modifiers'] = (data['modifiers'] as int) | @@ -526,7 +516,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'ios', - isDown: true, ); // Set only the generic "shift down" modifier, without setting a side. data['modifiers'] = (data['modifiers'] as int) | @@ -564,7 +553,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'windows', - isDown: true, ); // Set only the generic "shift down" modifier, without setting a side. // Windows doesn't have a concept of "either" for the Windows (meta) key. @@ -600,7 +588,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'linux', - isDown: true, ); // Set only the generic "shift down" modifier, without setting a side. // Windows doesn't have a concept of "either" for the Windows (meta) key. @@ -639,7 +626,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'web', - isDown: true, ); // Set only the generic "shift down" modifier, without setting a side. data['metaState'] = (data['metaState'] as int) | @@ -1008,7 +994,6 @@ void main() { final Map data = KeyEventSimulator.getKeyData( LogicalKeyboardKey.keyA, platform: 'android', - isDown: true, ); Map? message; await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.handlePlatformMessage( @@ -1077,12 +1062,10 @@ void main() { 'source': 0x101, // Keyboard source. 'repeatCount': 42, }).data, const RawKeyEventDataAndroid( - flags: 0, codePoint: 65, plainCodePoint: 97, keyCode: 29, scanCode: 30, - metaState: 0, )); expect(RawKeyEvent.fromMessage(const { diff --git a/packages/flutter/test/services/text_formatter_test.dart b/packages/flutter/test/services/text_formatter_test.dart index ab168ea358..088fc281e9 100644 --- a/packages/flutter/test/services/text_formatter_test.dart +++ b/packages/flutter/test/services/text_formatter_test.dart @@ -232,7 +232,6 @@ void main() { test('test length limiting formatter with zero-length string', () { testNewValue = const TextEditingValue( - text: '', selection: TextSelection( baseOffset: 0, extentOffset: 0, @@ -245,7 +244,6 @@ void main() { // Expecting the empty string. expect(actualValue, const TextEditingValue( - text: '', selection: TextSelection( baseOffset: 0, extentOffset: 0, @@ -356,8 +354,6 @@ void main() { test('Removes characters from the end', () async { const TextEditingValue value = TextEditingValue( text: '01234567890', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); final TextEditingValue truncated = LengthLimitingTextInputFormatter .truncate(value, 10); @@ -371,7 +367,6 @@ void main() { // Put the cursor at the end of the overflowing string to test if it // ends up at the end of the new string after truncation. selection: TextSelection.collapsed(offset: stringOverflowing.length), - composing: TextRange.empty, ); final TextEditingValue truncated = LengthLimitingTextInputFormatter .truncate(value, 10); @@ -388,7 +383,6 @@ void main() { // Put the cursor at the end of the overflowing string to test if it // ends up at the end of the new string after truncation. selection: TextSelection.collapsed(offset: stringOverflowing.length), - composing: TextRange.empty, ); final TextEditingValue truncated = LengthLimitingTextInputFormatter .truncate(value, 10); @@ -405,13 +399,9 @@ void main() { test('Passes through when under limit', () async { const TextEditingValue oldValue = TextEditingValue( text: 'aaa', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); const TextEditingValue newValue = TextEditingValue( text: 'aaab', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); final LengthLimitingTextInputFormatter formatter = LengthLimitingTextInputFormatter(maxLength); @@ -425,13 +415,9 @@ void main() { test('Uses old value when at the limit', () async { const TextEditingValue oldValue = TextEditingValue( text: 'aaaaaaaaaa', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); const TextEditingValue newValue = TextEditingValue( text: 'aaaaabbbbbaaaaa', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); final LengthLimitingTextInputFormatter formatter = LengthLimitingTextInputFormatter(maxLength); @@ -445,13 +431,9 @@ void main() { test('Truncates newValue when oldValue already over limit', () async { const TextEditingValue oldValue = TextEditingValue( text: 'aaaaaaaaaaaaaaaaaaaa', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); const TextEditingValue newValue = TextEditingValue( text: 'bbbbbbbbbbbbbbbbbbbb', - selection: TextSelection.collapsed(offset: -1), - composing: TextRange.empty, ); final LengthLimitingTextInputFormatter formatter = LengthLimitingTextInputFormatter(maxLength); @@ -726,7 +708,7 @@ void main() { // AAA | BBB | CCC => AAA | CCC expect( - FilteringTextInputFormatter.deny('BBB', replacementString: '').formatEditUpdate( + FilteringTextInputFormatter.deny('BBB').formatEditUpdate( oldValue, newValue.copyWith( selection: const TextSelection(baseOffset: 6, extentOffset: 3), @@ -736,7 +718,7 @@ void main() { ); expect( - FilteringTextInputFormatter.deny('BBB', replacementString: '').formatEditUpdate( + FilteringTextInputFormatter.deny('BBB').formatEditUpdate( oldValue, newValue.copyWith( selection: const TextSelection(baseOffset: 6, extentOffset: 3), @@ -797,7 +779,7 @@ void main() { // Overlapping matches: AAA | BBBBB | CCC => | BBB | expect( - FilteringTextInputFormatter.allow('BBB', replacementString: '').formatEditUpdate( + FilteringTextInputFormatter.allow('BBB').formatEditUpdate( oldValue, const TextEditingValue( text: 'AAABBBBBCCC', @@ -858,7 +840,7 @@ void main() { // AAA | BBB | CCC => | AAA CCC expect( - FilteringTextInputFormatter.deny('BBB', replacementString: '').formatEditUpdate( + FilteringTextInputFormatter.deny('BBB').formatEditUpdate( oldValue, newValue.copyWith( composing: const TextRange(start: 3, end: 6), diff --git a/packages/flutter/test/services/text_input_test.dart b/packages/flutter/test/services/text_input_test.dart index e6efaaff9d..f24fa0f263 100644 --- a/packages/flutter/test/services/text_input_test.dart +++ b/packages/flutter/test/services/text_input_test.dart @@ -18,13 +18,11 @@ void main() { const TextSelection invalidSelection1 = TextSelection( baseOffset: -1, extentOffset: 0, - affinity: TextAffinity.downstream, isDirectional: true, ); const TextSelection invalidSelection2 = TextSelection(baseOffset: 123, extentOffset: -1, affinity: TextAffinity.upstream, - isDirectional: false, ); expect(invalidSelection1, invalidSelection2); expect(invalidSelection1.hashCode, invalidSelection2.hashCode); @@ -34,7 +32,6 @@ void main() { const TextSelection selection1 = TextSelection( baseOffset: 1, extentOffset: 2, - affinity: TextAffinity.downstream, ); const TextSelection selection2 = TextSelection( baseOffset: 1, @@ -66,7 +63,7 @@ void main() { MethodCall('TextInput.setClient', [1, client.configuration.toJson()]), ]); - fakeTextChannel.incoming!(const MethodCall('TextInputClient.requestExistingInputState', null)); + fakeTextChannel.incoming!(const MethodCall('TextInputClient.requestExistingInputState')); expect(fakeTextChannel.outgoingCalls.length, 3); fakeTextChannel.validateOutgoingMethodCalls([ @@ -85,7 +82,7 @@ void main() { MethodCall('TextInput.setClient', [1, client.configuration.toJson()]), ]); - fakeTextChannel.incoming!(const MethodCall('TextInputClient.requestExistingInputState', null)); + fakeTextChannel.incoming!(const MethodCall('TextInputClient.requestExistingInputState')); expect(fakeTextChannel.outgoingCalls.length, 3); fakeTextChannel.validateOutgoingMethodCalls([ @@ -129,7 +126,6 @@ void main() { test('text serializes to JSON', () async { const TextInputConfiguration configuration = TextInputConfiguration( - inputType: TextInputType.text, readOnly: true, obscureText: true, autocorrect: false, diff --git a/packages/flutter/test/widgets/absorb_pointer_test.dart b/packages/flutter/test/widgets/absorb_pointer_test.dart index 168448be17..59e53bbed4 100644 --- a/packages/flutter/test/widgets/absorb_pointer_test.dart +++ b/packages/flutter/test/widgets/absorb_pointer_test.dart @@ -19,9 +19,7 @@ void main() { ), ), const Expanded( - child: AbsorbPointer( - absorbing: true, - ), + child: AbsorbPointer(), ), ], ), @@ -34,7 +32,6 @@ void main() { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget( AbsorbPointer( - absorbing: true, child: Semantics( label: 'test', textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/actions_test.dart b/packages/flutter/test/widgets/actions_test.dart index 4838542054..d2c1f61da8 100644 --- a/packages/flutter/test/widgets/actions_test.dart +++ b/packages/flutter/test/widgets/actions_test.dart @@ -824,7 +824,7 @@ void main() { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); - await pumpTest(tester, enabled: true, key: containerKey); + await pumpTest(tester, key: containerKey); focusNode.requestFocus(); await tester.pump(); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -843,14 +843,14 @@ void main() { await tester.sendKeyEvent(LogicalKeyboardKey.enter); await tester.pump(); expect(invoked, isFalse); - await pumpTest(tester, enabled: true, key: containerKey); + await pumpTest(tester, key: containerKey); expect(focusing, isFalse); expect(hovering, isTrue); await pumpTest(tester, enabled: false, key: containerKey); expect(focusing, isFalse); expect(hovering, isFalse); await gesture.moveTo(Offset.zero); - await pumpTest(tester, enabled: true, key: containerKey); + await pumpTest(tester, key: containerKey); expect(hovering, isFalse); expect(focusing, isFalse); }); @@ -858,11 +858,11 @@ void main() { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); - await pumpTest(tester, enabled: true, key: containerKey); + await pumpTest(tester, key: containerKey); await tester.pump(); expect(focusing, isFalse); - await pumpTest(tester, enabled: true, key: containerKey); + await pumpTest(tester, key: containerKey); focusNode.requestFocus(); await tester.pump(); expect(focusing, isTrue); @@ -888,7 +888,7 @@ void main() { FocusManager.instance.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; final GlobalKey containerKey = GlobalKey(); - await pumpTest(tester, enabled: true, key: containerKey, supplyCallbacks: false); + await pumpTest(tester, key: containerKey, supplyCallbacks: false); focusNode.requestFocus(); await tester.pump(); final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); @@ -907,14 +907,14 @@ void main() { await tester.sendKeyEvent(LogicalKeyboardKey.enter); await tester.pump(); expect(invoked, isFalse); - await pumpTest(tester, enabled: true, key: containerKey, supplyCallbacks: false); + await pumpTest(tester, key: containerKey, supplyCallbacks: false); expect(focusing, isFalse); expect(hovering, isFalse); await pumpTest(tester, enabled: false, key: containerKey, supplyCallbacks: false); expect(focusing, isFalse); expect(hovering, isFalse); await gesture.moveTo(Offset.zero); - await pumpTest(tester, enabled: true, key: containerKey, supplyCallbacks: false); + await pumpTest(tester, key: containerKey, supplyCallbacks: false); expect(hovering, isFalse); expect(focusing, isFalse); }); @@ -927,7 +927,6 @@ void main() { await tester.pumpWidget( MaterialApp( home: FocusableActionDetector( - descendantsAreFocusable: true, child: MaterialButton( focusNode: buttonNode, child: const Text('Test'), @@ -1345,7 +1344,7 @@ void main() { builder: (BuildContext context1) { return Actions( actions: > { - LogIntent: Action.overridable(defaultAction: LogInvocationAction(actionName: 'action1', enabled: true), context: context1), + LogIntent: Action.overridable(defaultAction: LogInvocationAction(actionName: 'action1'), context: context1), }, child: Builder( builder: (BuildContext context2) { diff --git a/packages/flutter/test/widgets/align_test.dart b/packages/flutter/test/widgets/align_test.dart index 9e5464aeac..d89ec77b2b 100644 --- a/packages/flutter/test/widgets/align_test.dart +++ b/packages/flutter/test/widgets/align_test.dart @@ -16,7 +16,6 @@ void main() { await tester.pumpWidget( Align( - alignment: Alignment.center, child: Container(), ), ); @@ -93,7 +92,6 @@ void main() { SingleChildScrollView( child: Align( key: alignKey, - alignment: Alignment.center, child: const SizedBox( width: 10.0, height: 10.0, @@ -139,7 +137,6 @@ void main() { crossAxisAlignment: CrossAxisAlignment.start, children: const [ Align( - alignment: Alignment.center, heightFactor: 0.5, child: SizedBox( height: 100.0, diff --git a/packages/flutter/test/widgets/animated_list_test.dart b/packages/flutter/test/widgets/animated_list_test.dart index e570ccbc80..579377ba25 100644 --- a/packages/flutter/test/widgets/animated_list_test.dart +++ b/packages/flutter/test/widgets/animated_list_test.dart @@ -54,7 +54,7 @@ void main() { expect(find.text('removing item'), findsOneWidget); expect(find.text('item 2'), findsNothing); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('removing item'), findsNothing); }); @@ -105,7 +105,6 @@ void main() { itemBuilder: (BuildContext context, int index, Animation animation) { return SizeTransition( key: ValueKey(index), - axis: Axis.vertical, sizeFactor: animation, child: SizedBox( height: 100.0, @@ -185,7 +184,6 @@ void main() { Widget buildItem(BuildContext context, int item, Animation animation) { return SizeTransition( key: ValueKey(item), - axis: Axis.vertical, sizeFactor: animation, child: SizedBox( height: 100.0, diff --git a/packages/flutter/test/widgets/animated_switcher_test.dart b/packages/flutter/test/widgets/animated_switcher_test.dart index 634782cf3f..793c18eecc 100644 --- a/packages/flutter/test/widgets/animated_switcher_test.dart +++ b/packages/flutter/test/widgets/animated_switcher_test.dart @@ -13,8 +13,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: containerOne, color: const Color(0x00000000)), ), ); @@ -26,8 +24,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: containerTwo, color: const Color(0xff000000)), ), ); @@ -40,8 +36,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: containerThree, color: const Color(0xffff0000)), ), ); @@ -63,8 +57,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: container1), ), ); @@ -75,8 +67,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: container2), ), ); @@ -87,8 +77,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(key: container3), ), ); @@ -101,8 +89,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(color: const Color(0x00000000)), ), ); @@ -114,8 +100,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(color: const Color(0xff000000)), ), ); @@ -131,9 +115,6 @@ void main() { await tester.pumpWidget( const AnimatedSwitcher( duration: Duration(milliseconds: 100), - child: null, - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, ), ); @@ -142,8 +123,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(color: const Color(0xff000000)), ), ); @@ -156,8 +135,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: Container(color: const Color(0x00000000)), ), ); @@ -169,9 +146,6 @@ void main() { await tester.pumpWidget( const AnimatedSwitcher( duration: Duration(milliseconds: 100), - child: null, - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, ), ); @@ -182,9 +156,6 @@ void main() { await tester.pumpWidget( const AnimatedSwitcher( duration: Duration(milliseconds: 100), - child: null, - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, ), ); @@ -198,14 +169,13 @@ void main() { testWidgets("AnimatedSwitcher doesn't start any animations after dispose.", (WidgetTester tester) async { await tester.pumpWidget(AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, child: Container(color: const Color(0xff000000)), )); await tester.pump(const Duration(milliseconds: 50)); // Change the widget tree in the middle of the animation. await tester.pumpWidget(Container(color: const Color(0xffff0000))); - expect(await tester.pumpAndSettle(const Duration(milliseconds: 100)), equals(1)); + expect(await tester.pumpAndSettle(), equals(1)); }); testWidgets('AnimatedSwitcher uses custom layout.', (WidgetTester tester) async { @@ -221,7 +191,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, child: Container(color: const Color(0x00000000)), ), @@ -252,7 +221,6 @@ void main() { textDirection: TextDirection.rtl, child: AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, transitionBuilder: newTransitionBuilder, child: Container(color: const Color(0x00000000)), @@ -270,8 +238,6 @@ void main() { textDirection: TextDirection.rtl, child: AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: null, - switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, transitionBuilder: newTransitionBuilder, ), @@ -298,8 +264,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: StatefulTest(key: statefulOne), ), ); @@ -312,8 +276,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: StatefulTest(key: statefulTwo), ), ); @@ -327,8 +289,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: StatefulTest(key: statefulThree), ), ); @@ -352,8 +312,6 @@ void main() { textDirection: TextDirection.rtl, child: AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, child: child, ), ), @@ -392,8 +350,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, layoutBuilder: newLayoutBuilder, child: Container(key: containerOne, color: const Color(0xFFFF0000)), ), @@ -404,8 +360,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, layoutBuilder: newLayoutBuilder, child: Container(key: containerTwo, color: const Color(0xFF00FF00)), ), @@ -416,8 +370,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, layoutBuilder: newLayoutBuilder, child: Container(key: containerThree, color: const Color(0xFF0000FF)), ), @@ -446,7 +398,6 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, transitionBuilder: newTransitionBuilder, child: Container(color: const Color(0x00000000)), diff --git a/packages/flutter/test/widgets/app_test.dart b/packages/flutter/test/widgets/app_test.dart index a2403ecba6..dd81d71a46 100644 --- a/packages/flutter/test/widgets/app_test.dart +++ b/packages/flutter/test/widgets/app_test.dart @@ -465,7 +465,6 @@ void main() { late BuildContext capturedContext; await tester.pumpWidget( WidgetsApp( - useInheritedMediaQuery: false, builder: (BuildContext context, Widget? child) { capturedContext = context; return const Placeholder(); diff --git a/packages/flutter/test/widgets/async_test.dart b/packages/flutter/test/widgets/async_test.dart index f43705b0f2..367a268f5f 100644 --- a/packages/flutter/test/widgets/async_test.dart +++ b/packages/flutter/test/widgets/async_test.dart @@ -46,7 +46,7 @@ void main() { final Error error = Error(); expect( AsyncSnapshot.withError(ConnectionState.done, error), - AsyncSnapshot.withError(ConnectionState.done, error, StackTrace.empty), + AsyncSnapshot.withError(ConnectionState.done, error), ); }); }); @@ -76,7 +76,7 @@ void main() { testWidgets('gracefully handles transition from null future', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder( - key: key, future: null, builder: snapshotText, + key: key, builder: snapshotText, )); expect(find.text('AsyncSnapshot(ConnectionState.none, null, null, null)'), findsOneWidget); final Completer completer = Completer(); @@ -93,7 +93,7 @@ void main() { )); expect(find.text('AsyncSnapshot(ConnectionState.waiting, null, null, null)'), findsOneWidget); await tester.pumpWidget(FutureBuilder( - key: key, future: null, builder: snapshotText, + key: key, builder: snapshotText, )); expect(find.text('AsyncSnapshot(ConnectionState.none, null, null, null)'), findsOneWidget); completer.complete('hello'); @@ -141,7 +141,6 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder( key: key, - future: null, builder: snapshotText, initialData: 'I', )); @@ -151,7 +150,6 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget(FutureBuilder( key: key, - future: null, builder: snapshotText, initialData: 'I', )); @@ -188,7 +186,7 @@ void main() { testWidgets('gracefully handles transition from null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StreamBuilder( - key: key, stream: null, builder: snapshotText, + key: key, builder: snapshotText, )); expect(find.text('AsyncSnapshot(ConnectionState.none, null, null, null)'), findsOneWidget); final StreamController controller = StreamController(); @@ -205,7 +203,7 @@ void main() { )); expect(find.text('AsyncSnapshot(ConnectionState.waiting, null, null, null)'), findsOneWidget); await tester.pumpWidget(StreamBuilder( - key: key, stream: null, builder: snapshotText, + key: key, builder: snapshotText, )); expect(find.text('AsyncSnapshot(ConnectionState.none, null, null, null)'), findsOneWidget); }); @@ -258,7 +256,6 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget(StreamBuilder( key: key, - stream: null, builder: snapshotText, initialData: 'I', )); @@ -309,15 +306,15 @@ void main() { }); testWidgets('when Future is null', (WidgetTester tester) async { await tester.pumpWidget(Column(children: [ - FutureBuilder(future: null, builder: snapshotText), - StreamBuilder(stream: null, builder: snapshotText), + FutureBuilder(builder: snapshotText), + StreamBuilder(builder: snapshotText), ])); expect(find.text('AsyncSnapshot(ConnectionState.none, null, null, null)'), findsNWidgets(2)); }); testWidgets('when initialData is used with null Future and Stream', (WidgetTester tester) async { await tester.pumpWidget(Column(children: [ - FutureBuilder(future: null, builder: snapshotText, initialData: 'I'), - StreamBuilder(stream: null, builder: snapshotText, initialData: 'I'), + FutureBuilder(builder: snapshotText, initialData: 'I'), + StreamBuilder(builder: snapshotText, initialData: 'I'), ])); expect(find.text('AsyncSnapshot(ConnectionState.none, I, null, null)'), findsNWidgets(2)); }); @@ -336,7 +333,7 @@ void main() { group('StreamBuilderBase', () { testWidgets('gracefully handles transition from null stream', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); - await tester.pumpWidget(StringCollector(key: key, stream: null)); + await tester.pumpWidget(StringCollector(key: key)); expect(find.text(''), findsOneWidget); final StreamController controller = StreamController(); await tester.pumpWidget(StringCollector(key: key, stream: controller.stream)); @@ -347,7 +344,7 @@ void main() { final StreamController controller = StreamController(); await tester.pumpWidget(StringCollector(key: key, stream: controller.stream)); expect(find.text('conn'), findsOneWidget); - await tester.pumpWidget(StringCollector(key: key, stream: null)); + await tester.pumpWidget(StringCollector(key: key)); expect(find.text('conn, disc'), findsOneWidget); }); testWidgets('gracefully handles transition to other stream', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/autocomplete_test.dart b/packages/flutter/test/widgets/autocomplete_test.dart index 8c26983428..fdcee8e7d2 100644 --- a/packages/flutter/test/widgets/autocomplete_test.dart +++ b/packages/flutter/test/widgets/autocomplete_test.dart @@ -470,7 +470,6 @@ void main() { // optionsBuilder returns nothing for an empty field query. focusNode.requestFocus(); textEditingController.value = const TextEditingValue( - text: '', selection: TextSelection(baseOffset: 0, extentOffset: 0), ); await tester.pump(); diff --git a/packages/flutter/test/widgets/autofill_group_test.dart b/packages/flutter/test/widgets/autofill_group_test.dart index 6e7dc3fe78..8c42981807 100644 --- a/packages/flutter/test/widgets/autofill_group_test.dart +++ b/packages/flutter/test/widgets/autofill_group_test.dart @@ -161,13 +161,11 @@ void main() { List children = const [ AutofillGroup( key: group1, - onDisposeAction: AutofillContextAction.commit, child: AutofillGroup(child: placeholder), ), AutofillGroup(key: group2, onDisposeAction: AutofillContextAction.cancel, child: placeholder), AutofillGroup( key: group3, - onDisposeAction: AutofillContextAction.commit, child: AutofillGroup(child: placeholder), ), ]; @@ -198,7 +196,6 @@ void main() { AutofillGroup(key: group2, onDisposeAction: AutofillContextAction.cancel, child: placeholder), AutofillGroup( key: group3, - onDisposeAction: AutofillContextAction.commit, child: AutofillGroup(child: placeholder), ), ]; @@ -218,7 +215,6 @@ void main() { children = const [ AutofillGroup( key: group3, - onDisposeAction: AutofillContextAction.commit, child: AutofillGroup(child: placeholder), ), ]; @@ -238,7 +234,6 @@ void main() { children = const [ AutofillGroup( key: group3, - onDisposeAction: AutofillContextAction.commit, child: placeholder, ), ]; diff --git a/packages/flutter/test/widgets/automatic_keep_alive_test.dart b/packages/flutter/test/widgets/automatic_keep_alive_test.dart index c8bfa74518..bad30339dd 100644 --- a/packages/flutter/test/widgets/automatic_keep_alive_test.dart +++ b/packages/flutter/test/widgets/automatic_keep_alive_test.dart @@ -446,7 +446,7 @@ void main() { AutomaticKeepAlive( child: SizedBox( height: 400.0, - child: Stack(children: const []), + child: Stack(), ), ), AutomaticKeepAlive( diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart index debe8dbec3..ab1f3e19d4 100644 --- a/packages/flutter/test/widgets/basic_test.dart +++ b/packages/flutter/test/widgets/basic_test.dart @@ -160,7 +160,6 @@ void main() { Center( child: FractionalTranslation( translation: Offset.zero, - transformHitTests: true, child: Listener( onPointerDown: (PointerDownEvent event) { _pointerDown = true; @@ -190,7 +189,6 @@ void main() { Center( child: FractionalTranslation( translation: const Offset(0.5, 0.5), - transformHitTests: true, child: Listener( onPointerDown: (PointerDownEvent event) { _pointerDown = true; @@ -220,7 +218,6 @@ void main() { Center( child: FractionalTranslation( translation: const Offset(1.0, 1.0), - transformHitTests: true, child: Listener( onPointerDown: (PointerDownEvent event) { _pointerDown = true; @@ -258,7 +255,6 @@ void main() { child: FractionalTranslation( key: fractionalTranslationKey, translation: offset, - transformHitTests: true, child: GestureDetector( onTap: () { setState(() { @@ -869,10 +865,6 @@ void main() { Wrap( spacing: 8.0, // gap between adjacent Text widget runSpacing: 4.0, // gap between lines - direction: Axis.horizontal, - alignment: WrapAlignment.start, - runAlignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, children: const [ diff --git a/packages/flutter/test/widgets/box_decoration_test.dart b/packages/flutter/test/widgets/box_decoration_test.dart index 59e1d7554f..6328f12d00 100644 --- a/packages/flutter/test/widgets/box_decoration_test.dart +++ b/packages/flutter/test/widgets/box_decoration_test.dart @@ -248,15 +248,11 @@ Future main() async { ..drrect( outer: RRect.fromLTRBAndCorners( 350.0, 200.0, 450.0, 300.0, - topLeft: Radius.zero, topRight: const Radius.circular(10.0), - bottomRight: Radius.zero, - bottomLeft: Radius.zero, ), inner: RRect.fromLTRBAndCorners( 360.0, 210.0, 440.0, 290.0, topLeft: const Radius.circular(-10.0), - topRight: Radius.zero, bottomRight: const Radius.circular(-10.0), bottomLeft: const Radius.circular(-10.0), ), @@ -354,7 +350,7 @@ Future main() async { key: key, width: 100.0, height: 50.0, - decoration: BoxDecoration(border: border, shape: BoxShape.rectangle, borderRadius: const BorderRadius.all(Radius.circular(20.0))), + decoration: BoxDecoration(border: border, borderRadius: const BorderRadius.all(Radius.circular(20.0))), ), onTap: () { itemsTapped.add(1); @@ -397,7 +393,7 @@ Future main() async { key: key, width: width, height: height, - decoration: BoxDecoration(border: border, shape: BoxShape.rectangle,borderRadius: BorderRadius.circular(radius)), + decoration: BoxDecoration(border: border,borderRadius: BorderRadius.circular(radius)), ), onTap: () { itemsTapped.add(1); @@ -457,7 +453,7 @@ Future main() async { key: key, width: width, height: height, - decoration: BoxDecoration(border: border, shape: BoxShape.rectangle,borderRadius: BorderRadius.circular(radius)), + decoration: BoxDecoration(border: border,borderRadius: BorderRadius.circular(radius)), ), onTap: () { itemsTapped.add(1); @@ -505,7 +501,7 @@ Future main() async { key: key, width: width, height: height, - decoration: BoxDecoration(border: border, shape: BoxShape.rectangle,borderRadius: BorderRadius.circular(radius)), + decoration: BoxDecoration(border: border,borderRadius: BorderRadius.circular(radius)), ), onTap: () { itemsTapped.add(1); diff --git a/packages/flutter/test/widgets/clip_test.dart b/packages/flutter/test/widgets/clip_test.dart index af7aa65035..0f4861068b 100644 --- a/packages/flutter/test/widgets/clip_test.dart +++ b/packages/flutter/test/widgets/clip_test.dart @@ -395,7 +395,6 @@ void main() { width: 100.0, height: 100.0, child: ClipRect( - clipBehavior: Clip.hardEdge, child: Container( color: Colors.blue, ), diff --git a/packages/flutter/test/widgets/container_test.dart b/packages/flutter/test/widgets/container_test.dart index a08e6531ba..79d00f7197 100644 --- a/packages/flutter/test/widgets/container_test.dart +++ b/packages/flutter/test/widgets/container_test.dart @@ -119,7 +119,7 @@ void main() { ); expect( - box.toStringDeep(minLevel: DiagnosticLevel.debug), + box.toStringDeep(), equalsIgnoringHashCodes( 'RenderPadding#00000 relayoutBoundary=up1\n' ' │ creator: Padding ← Container ← Align ← [root]\n' @@ -518,9 +518,9 @@ void main() { }); testWidgets('giving clipBehaviour Clip.None, will not add a ClipPath to the tree', (WidgetTester tester) async { - await tester.pumpWidget(Container( - clipBehavior: Clip.none, - decoration: const BoxDecoration( + await tester.pumpWidget( + Container( + decoration: const BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(1)), ), child: const SizedBox(), @@ -642,7 +642,6 @@ void main() { boxShadow: [ BoxShadow( color: Colors.blue, - offset: Offset.zero, spreadRadius: 10, blurRadius: 20.0, ), diff --git a/packages/flutter/test/widgets/custom_paint_test.dart b/packages/flutter/test/widgets/custom_paint_test.dart index 124ddcc446..151a7a99ab 100644 --- a/packages/flutter/test/widgets/custom_paint_test.dart +++ b/packages/flutter/test/widgets/custom_paint_test.dart @@ -157,7 +157,7 @@ void main() { expect(target.currentContext!.size, const Size(800.0, 100.0)); await tester.pumpWidget(Center( - child: CustomPaint(key: target, size: Size.zero, child: Container()), + child: CustomPaint(key: target, child: Container()), )); expect(target.currentContext!.size, const Size(800.0, 600.0)); diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index f6b4433395..c2978e936b 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -32,9 +32,7 @@ void _defineTests() { )); expect(semanticsTester, hasSemantics( - TestSemantics.root( - children: const [], - ), + TestSemantics.root(), )); semanticsTester.dispose(); diff --git a/packages/flutter/test/widgets/default_text_editing_actions_test.dart b/packages/flutter/test/widgets/default_text_editing_actions_test.dart index 8718d710ce..ff674e88cd 100644 --- a/packages/flutter/test/widgets/default_text_editing_actions_test.dart +++ b/packages/flutter/test/widgets/default_text_editing_actions_test.dart @@ -54,7 +54,7 @@ void main() { EditableText( controller: controller, focusNode: focusNodeTarget, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), diff --git a/packages/flutter/test/widgets/default_text_height_behavior_test.dart b/packages/flutter/test/widgets/default_text_height_behavior_test.dart index 37e8bfd7e9..3817f8025e 100644 --- a/packages/flutter/test/widgets/default_text_height_behavior_test.dart +++ b/packages/flutter/test/widgets/default_text_height_behavior_test.dart @@ -12,7 +12,6 @@ void main() { applyHeightToFirstAscent: false, ); const TextHeightBehavior behavior2 = TextHeightBehavior( - applyHeightToLastDescent: true, applyHeightToFirstAscent: false, ); @@ -38,7 +37,6 @@ void main() { applyHeightToFirstAscent: false, ); const TextHeightBehavior behavior2 = TextHeightBehavior( - applyHeightToLastDescent: true, applyHeightToFirstAscent: false, ); diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart index b9d7444f30..eccd44cd78 100644 --- a/packages/flutter/test/widgets/dismissible_test.dart +++ b/packages/flutter/test/widgets/dismissible_test.dart @@ -231,10 +231,7 @@ void main() { testWidgets('Horizontal drag triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { await tester.pumpWidget( - buildTest( - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, - ), + buildTest(), ); expect(dismissedItems, isEmpty); @@ -251,10 +248,7 @@ void main() { testWidgets('Horizontal fling triggers dismiss scrollDirection=vertical', (WidgetTester tester) async { await tester.pumpWidget( - buildTest( - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, - ), + buildTest(), ); expect(dismissedItems, isEmpty); @@ -273,8 +267,6 @@ void main() { await tester.pumpWidget( buildTest( startToEndThreshold: 0.95, - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, ), ); expect(dismissedItems, isEmpty); @@ -321,7 +313,6 @@ void main() { testWidgets('drag-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.endToStart, ), ); @@ -341,7 +332,6 @@ void main() { testWidgets('drag-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.startToEnd, ), ); @@ -360,7 +350,6 @@ void main() { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.endToStart, ), ); @@ -380,7 +369,6 @@ void main() { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.startToEnd, ), ); @@ -400,7 +388,6 @@ void main() { testWidgets('fling-left with DismissDirection.endToStart triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.endToStart, ), ); @@ -420,7 +407,6 @@ void main() { testWidgets('fling-right with DismissDirection.startToEnd triggers dismiss (LTR)', (WidgetTester tester) async { await tester.pumpWidget( buildTest( - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.startToEnd, ), ); @@ -440,7 +426,6 @@ void main() { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.endToStart, ), ); @@ -459,7 +444,6 @@ void main() { await tester.pumpWidget( buildTest( textDirection: TextDirection.rtl, - scrollDirection: Axis.vertical, dismissDirection: DismissDirection.startToEnd, ), ); @@ -552,8 +536,6 @@ void main() { await tester.pumpWidget( buildTest( startToEndThreshold: 1.0, - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, ), ); expect(dismissedItems, isEmpty); @@ -571,8 +553,6 @@ void main() { await tester.pumpWidget( buildTest( startToEndThreshold: 1.0, - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, ), ); expect(dismissedItems, isEmpty); @@ -655,8 +635,6 @@ void main() { await tester.pumpWidget( buildTest( background: const Text('background'), - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, ), ); expect(dismissedItems, isEmpty); @@ -697,24 +675,24 @@ void main() { await tester.pumpWidget(buildTest(scrollDirection: Axis.horizontal)); expect(dismissedItems, isEmpty); - await checkFlingItemAfterMovement(tester, 0, gestureDirection: AxisDirection.left, mechanism: rollbackElement); + await checkFlingItemAfterMovement(tester, 0, gestureDirection: AxisDirection.left); expect(find.text('0'), findsOneWidget); expect(dismissedItems, isEmpty); - await checkFlingItemAfterMovement(tester, 1, gestureDirection: AxisDirection.right, mechanism: rollbackElement); + await checkFlingItemAfterMovement(tester, 1, gestureDirection: AxisDirection.right); expect(find.text('1'), findsOneWidget); expect(dismissedItems, isEmpty); }); testWidgets('Vertical fling less than threshold', (WidgetTester tester) async { - await tester.pumpWidget(buildTest(scrollDirection: Axis.vertical)); + await tester.pumpWidget(buildTest()); expect(dismissedItems, isEmpty); - await checkFlingItemAfterMovement(tester, 0, gestureDirection: AxisDirection.left, mechanism: rollbackElement); + await checkFlingItemAfterMovement(tester, 0, gestureDirection: AxisDirection.left); expect(find.text('0'), findsOneWidget); expect(dismissedItems, isEmpty); - await checkFlingItemAfterMovement(tester, 1, gestureDirection: AxisDirection.right, mechanism: rollbackElement); + await checkFlingItemAfterMovement(tester, 1, gestureDirection: AxisDirection.right); expect(find.text('1'), findsOneWidget); expect(dismissedItems, isEmpty); }); @@ -724,8 +702,6 @@ void main() { Widget buildFrame(bool? confirmDismissValue) { return buildTest( - scrollDirection: Axis.vertical, - dismissDirection: DismissDirection.horizontal, confirmDismiss: (BuildContext context, DismissDirection dismissDirection) { confirmDismissDirection = dismissDirection; return Future.value(confirmDismissValue); @@ -893,7 +869,6 @@ void main() { child: Dismissible( dragStartBehavior: DragStartBehavior.down, key: UniqueKey(), - direction: DismissDirection.horizontal, resizeDuration: null, onDismissed: (DismissDirection direction) { dismissed = true; @@ -917,22 +892,17 @@ void main() { }); testWidgets('setState that does not remove the Dismissible from tree should throw Error', (WidgetTester tester) async { - const Axis scrollDirection = Axis.vertical; - const DismissDirection dismissDirection = DismissDirection.horizontal; - await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return ListView( dragStartBehavior: DragStartBehavior.down, - scrollDirection: scrollDirection, itemExtent: 100.0, children: [ Dismissible( dragStartBehavior: DragStartBehavior.down, key: const ValueKey(1), - direction: dismissDirection, onDismissed: (DismissDirection direction) { setState(() { reportedDismissDirection = direction; @@ -940,7 +910,6 @@ void main() { dismissedItems.add(1); }); }, - dismissThresholds: const {}, crossAxisEndOffset: crossAxisEndOffset, child: SizedBox( width: 100.0, diff --git a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart index 67cffa1064..ce9b0b38a5 100644 --- a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart +++ b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart @@ -81,7 +81,6 @@ void main() { const Key key = ValueKey('container'); await tester.pumpWidget(_boilerplate( null, - maxChildSize: 1.0, initialChildSize: .25, itemExtent: 25.0, containerKey: key, diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 23b1b7561a..7e190f224c 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -3063,7 +3063,6 @@ void main() { home: Column( children: const [ Draggable( - hitTestBehavior: hitTestBehavior, feedback: SizedBox(height: 50.0, child: Text('Draggable')), child: SizedBox(height: 50.0, child: Text('Target')), ), @@ -3103,7 +3102,7 @@ void main() { expect(const LongPressDraggable(child: widget1, feedback: widget2), isA>()); expect(const LongPressDraggable(child: widget1, feedback: widget2).child, widget1); expect(const LongPressDraggable(child: widget1, feedback: widget2).feedback, widget2); - expect(const LongPressDraggable(child: widget1, feedback: widget2, dragAnchor: DragAnchor.child).dragAnchor, DragAnchor.child); + expect(const LongPressDraggable(child: widget1, feedback: widget2).dragAnchor, DragAnchor.child); expect(const LongPressDraggable(child: widget1, feedback: widget2, dragAnchor: DragAnchor.pointer).dragAnchor, DragAnchor.pointer); expect(LongPressDraggable(child: widget1, feedback: widget2, dragAnchorStrategy: dummyStrategy).dragAnchorStrategy, dummyStrategy); }); diff --git a/packages/flutter/test/widgets/editable_text_cursor_test.dart b/packages/flutter/test/widgets/editable_text_cursor_test.dart index 94f8609944..96a257f55d 100644 --- a/packages/flutter/test/widgets/editable_text_cursor_test.dart +++ b/packages/flutter/test/widgets/editable_text_cursor_test.dart @@ -32,7 +32,7 @@ void main() { testWidgets('cursor has expected width, height, and radius', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( @@ -68,7 +68,7 @@ void main() { key: editableTextKey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -121,7 +121,7 @@ void main() { key: editableTextKey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -345,10 +345,8 @@ void main() { controller: controller, focusNode: FocusNode(), style: const TextStyle(fontSize: 20.0), - maxLines: 1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, - cursorOpacityAnimates: false, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, textAlign: TextAlign.left, @@ -465,7 +463,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -560,7 +558,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -617,7 +615,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -662,7 +660,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -729,7 +727,7 @@ void main() { controller.text = text; await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( diff --git a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart index 8d5ddd07cd..0603ece943 100644 --- a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart +++ b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart @@ -233,7 +233,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -383,12 +383,11 @@ void main() { height: 600.0, width: 600.0, child: CustomScrollView( - controller: controller = ScrollController(initialScrollOffset: 0), + controller: controller = ScrollController(), slivers: List.generate(50, (int i) { return i == 10 ? SliverPersistentHeader( pinned: true, - floating: false, delegate: _TestSliverPersistentHeaderDelegate( minExtent: 50, maxExtent: 50, @@ -446,12 +445,11 @@ void main() { height: 600.0, width: 600.0, child: CustomScrollView( - controller: controller = ScrollController(initialScrollOffset: 0), + controller: controller = ScrollController(), slivers: List.generate(50, (int i) { return i == 10 ? SliverPersistentHeader( pinned: true, - floating: false, delegate: _TestSliverPersistentHeaderDelegate( minExtent: 50, maxExtent: 50, diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index a9e4ff2758..9261be9d36 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -78,7 +78,7 @@ void main() { }) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -120,7 +120,6 @@ void main() { backgroundCursorColor: Colors.blue, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, ), @@ -164,7 +163,7 @@ void main() { testWidgets('has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( @@ -194,7 +193,7 @@ void main() { testWidgets('text keyboard is requested when maxLines is default', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -333,7 +332,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -372,7 +371,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -405,7 +404,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -440,7 +439,7 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -473,7 +472,7 @@ void main() { testWidgets('multiline keyboard is requested when set explicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -509,7 +508,7 @@ void main() { controller.value = value; await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( @@ -543,7 +542,7 @@ void main() { testWidgets('visiblePassword keyboard is requested when set explicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -576,7 +575,7 @@ void main() { const bool enableSuggestions = false; await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -606,7 +605,7 @@ void main() { const bool enableIMEPersonalizedLearning = false; await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -638,7 +637,7 @@ void main() { const SmartQuotesType smartQuotesType = SmartQuotesType.disabled; await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -669,7 +668,7 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -681,7 +680,6 @@ void main() { focusNode: focusNode, style: textStyle, cursorColor: cursorColor, - obscureText: false, ), ), ), @@ -699,7 +697,7 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -791,7 +789,7 @@ void main() { final Key key2 = UniqueKey(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -834,7 +832,7 @@ void main() { // Updates the style. await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -872,7 +870,7 @@ void main() { testWidgets('Multiline keyboard with newline action is requested when maxLines = null', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -903,7 +901,7 @@ void main() { testWidgets('Text keyboard is requested when explicitly set and maxLines = null', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -935,7 +933,7 @@ void main() { testWidgets('Correct keyboard is requested when set explicitly and maxLines > 1', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -967,7 +965,7 @@ void main() { testWidgets('multiline keyboard is requested when set implicitly', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -998,7 +996,7 @@ void main() { testWidgets('single line inputs have correct default keyboard', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -1008,7 +1006,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, ), @@ -1029,7 +1026,7 @@ void main() { testWidgets('connection is closed when TextInputClient.onConnectionClosed message received', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -1039,7 +1036,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, ), @@ -1073,7 +1069,7 @@ void main() { testWidgets('closed connection reopened when user focused', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -1083,7 +1079,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, ), @@ -1147,7 +1142,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -1454,9 +1449,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(text: 'blah blah'), focusNode: focusNode, - toolbarOptions: const ToolbarOptions( - selectAll: false, - ), + toolbarOptions: const ToolbarOptions(), style: textStyle, cursorColor: cursorColor, selectionControls: cupertinoTextSelectionControls, @@ -1487,7 +1480,6 @@ void main() { focusNode: focusNode, toolbarOptions: const ToolbarOptions( copy: true, - selectAll: false, ), style: textStyle, cursorColor: cursorColor, @@ -1522,12 +1514,6 @@ void main() { controller: TextEditingController(text: 'blah blah'), focusNode: focusNode, readOnly: true, - toolbarOptions: const ToolbarOptions( - paste: true, - cut: true, - selectAll: true, - copy: true, - ), style: textStyle, cursorColor: cursorColor, selectionControls: materialTextSelectionControls, @@ -1631,7 +1617,6 @@ void main() { const TextEditingValue( text: 'Lorem ipsum dolor sit amet', selection: TextSelection(baseOffset: 0, extentOffset: 3), - composing: TextRange.empty, ), ); } @@ -1722,7 +1707,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1800,7 +1785,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1846,7 +1831,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1883,7 +1868,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, onEditingComplete: () { onEditingCompleteCalled = true; @@ -1923,7 +1908,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, onEditingComplete: () { onEditingCompleteCalled = true; @@ -1963,9 +1948,8 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, - maxLines: 1, onEditingComplete: () { onEditingCompleteCalled = true; assert(!onSubmittedCalled); @@ -2003,7 +1987,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, maxLines: 3, onEditingComplete: () { @@ -2039,7 +2023,7 @@ void main() { Widget widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, focusNode: focusNode, controller: controller, @@ -2063,7 +2047,7 @@ void main() { widget = MaterialApp( home: EditableText( backgroundCursorColor: Colors.grey, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, focusNode: focusNode, controller: controller, @@ -2134,9 +2118,8 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, - autocorrect: true, autocorrectionTextRectColor: rectColor, showCursor: false, onEditingComplete: () { }, @@ -2192,7 +2175,7 @@ void main() { setState = setter; return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -2201,7 +2184,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: currentController, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android) + style: Typography.material2018() .black .subtitle1!, cursorColor: Colors.blue, @@ -2268,7 +2251,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -2308,7 +2291,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -2320,7 +2303,6 @@ void main() { focusNode: focusNode, style: textStyle, cursorColor: cursorColor, - maxLines: 1, ), ), ), @@ -2334,7 +2316,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -2373,7 +2355,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -3385,7 +3367,6 @@ void main() { SemanticsAction.setSelection, SemanticsAction.setText, ], - value: '', textSelection: TextSelection.collapsed(offset: controller.text.length), textDirection: TextDirection.ltr, ), @@ -3434,7 +3415,7 @@ void main() { }); final TextEditingController controller = TextEditingController(); final MediaQuery mediaQuery = MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: EditableText( controller: controller, backgroundCursorColor: Colors.red, @@ -3481,15 +3462,13 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - devicePixelRatio: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -3512,15 +3491,13 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - devicePixelRatio: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -3553,20 +3530,17 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - devicePixelRatio: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Column( - mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ EditableText( key: ValueKey(controller1.text), controller: controller1, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -3575,7 +3549,7 @@ void main() { key: ValueKey(controller2.text), controller: controller2, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, minLines: 10, @@ -3679,7 +3653,7 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: EditableText( textDirection: TextDirection.rtl, controller: controller, @@ -3730,7 +3704,7 @@ void main() { setState = setter; return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -3785,7 +3759,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -3886,7 +3860,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -3993,15 +3967,13 @@ void main() { final TextEditingController controller = TextEditingController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData( - devicePixelRatio: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, keyboardAppearance: Brightness.dark, @@ -4078,7 +4050,7 @@ void main() { showSelectionHandles: true, controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -4247,7 +4219,7 @@ void main() { controller: controller, showSelectionHandles: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -4384,7 +4356,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -4555,7 +4527,6 @@ void main() { const TextSelection( baseOffset: 20, extentOffset: 20, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4577,7 +4548,6 @@ void main() { const TextSelection( baseOffset: 20, extentOffset: 39, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4602,7 +4572,6 @@ void main() { const TextSelection( baseOffset: 20, extentOffset: testText.length, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4624,7 +4593,6 @@ void main() { const TextSelection( baseOffset: 20, extentOffset: 57, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4713,7 +4681,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 0, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4725,7 +4692,6 @@ void main() { [ LogicalKeyboardKey.arrowDown, ], - shift: false, lineModifier: true, targetPlatform: defaultTargetPlatform, ); @@ -4735,7 +4701,6 @@ void main() { equals( const TextSelection.collapsed( offset: testText.length, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4748,7 +4713,6 @@ void main() { [ LogicalKeyboardKey.arrowUp, ], - shift: false, lineModifier: true, targetPlatform: defaultTargetPlatform, ); @@ -4773,8 +4737,6 @@ void main() { LogicalKeyboardKey.arrowRight, LogicalKeyboardKey.arrowRight, ], - shift: false, - lineModifier: false, targetPlatform: defaultTargetPlatform, ); @@ -4783,7 +4745,6 @@ void main() { equals( const TextSelection.collapsed( offset: 3, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4806,7 +4767,6 @@ void main() { const TextSelection( baseOffset: 3, extentOffset: testText.length, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -4841,8 +4801,6 @@ void main() { [ LogicalKeyboardKey.arrowUp, ], - shift: false, - lineModifier: false, targetPlatform: defaultTargetPlatform, ); @@ -5077,7 +5035,7 @@ void main() { controller: controller, autofocus: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -5257,7 +5215,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -5292,7 +5250,6 @@ void main() { equals( const TextSelection.collapsed( offset: 23, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5334,7 +5291,6 @@ void main() { equals( TextSelection.collapsed( offset: afterHomeOffset, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5387,7 +5343,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -5422,7 +5378,6 @@ void main() { equals( const TextSelection.collapsed( offset: 23, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5443,7 +5398,6 @@ void main() { // Move back to position 23. controller.selection = const TextSelection.collapsed( offset: 23, - affinity: TextAffinity.downstream, ); await tester.pump(); @@ -5470,7 +5424,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 23, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5481,7 +5434,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 23, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5496,7 +5448,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 20, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5522,7 +5473,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 20, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5533,7 +5483,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 35, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5559,7 +5508,6 @@ void main() { const TextSelection( baseOffset: 23, extentOffset: 72, - affinity: TextAffinity.downstream, ), ), reason: 'on $platform', @@ -5756,7 +5704,7 @@ void main() { maxLines: 2, controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -5888,7 +5836,6 @@ void main() { MaterialApp( home: EditableText( controller: TextEditingController(text: 'A' * 1000), - maxLines: 1, focusNode: FocusNode(), style: textStyle, cursorColor: Colors.blue, @@ -5906,7 +5853,6 @@ void main() { MaterialApp( home: EditableText( controller: TextEditingController(text: 'A' * 1000), - maxLines: 1, focusNode: FocusNode(), style: textStyle, cursorColor: Colors.blue, @@ -5924,7 +5870,6 @@ void main() { MaterialApp( home: EditableText( controller: TextEditingController(text: 'A' * 1000), - maxLines: 1, focusNode: FocusNode(), style: textStyle, cursorColor: Colors.blue, @@ -5941,7 +5886,6 @@ void main() { MaterialApp( home: EditableText( controller: TextEditingController(text: 'A' * 1000), - maxLines: 1, focusNode: FocusNode(), style: textStyle, cursorColor: Colors.blue, @@ -5988,7 +5932,6 @@ void main() { controller: controller, cursorColor: cursorColor, focusNode: focusNode, - maxLines: 1, obscureText: true, style: textStyle, ); @@ -6020,7 +5963,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -6118,7 +6061,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, inputFormatters: [LengthLimitingTextInputFormatter(6)], onChanged: (String s) => controller.text += ' onChanged', @@ -6217,7 +6160,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, inputFormatters: [LengthLimitingTextInputFormatter(6)], ), @@ -6261,7 +6204,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -6305,7 +6248,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -6353,7 +6296,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -6413,7 +6356,7 @@ void main() { setState = setter; return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -6536,7 +6479,7 @@ void main() { builder: (BuildContext context, StateSetter setter) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -6612,7 +6555,7 @@ void main() { builder: (BuildContext context, StateSetter setter) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -6689,7 +6632,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -6733,7 +6676,7 @@ void main() { builder: (BuildContext context, StateSetter setter) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -6804,7 +6747,7 @@ void main() { home: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -6866,7 +6809,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -6886,7 +6829,7 @@ void main() { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -6896,7 +6839,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, inputFormatters: [formatter], @@ -6959,7 +6901,7 @@ void main() { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -6969,7 +6911,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, inputFormatters: [formatter], @@ -7041,7 +6982,7 @@ void main() { final MockTextFormatter formatter = MockTextFormatter(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7051,7 +6992,6 @@ void main() { backgroundCursorColor: Colors.grey, controller: controller, focusNode: focusNode, - maxLines: 1, // Sets text keyboard implicitly. style: textStyle, cursorColor: cursorColor, inputFormatters: [formatter], @@ -7082,7 +7022,7 @@ void main() { testWidgets('EditableText changes mouse cursor when hovered', (WidgetTester tester) async { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7114,7 +7054,7 @@ void main() { // Test default cursor await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7144,7 +7084,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -7165,7 +7105,7 @@ void main() { testWidgets('EditableText can set and update clipBehavior', (WidgetTester tester) async { await tester.pumpWidget(MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7185,7 +7125,7 @@ void main() { expect(renderObject.clipBehavior, equals(Clip.hardEdge)); await tester.pumpWidget(MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7207,11 +7147,10 @@ void main() { testWidgets('EditableText inherits DefaultTextHeightBehavior', (WidgetTester tester) async { const TextHeightBehavior customTextHeightBehavior = TextHeightBehavior( - applyHeightToLastDescent: true, applyHeightToFirstAscent: false, ); await tester.pumpWidget(MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7236,7 +7175,6 @@ void main() { testWidgets('EditableText defaultTextHeightBehavior is used over inherited widget', (WidgetTester tester) async { const TextHeightBehavior inheritedTextHeightBehavior = TextHeightBehavior( - applyHeightToLastDescent: true, applyHeightToFirstAscent: false, ); const TextHeightBehavior customTextHeightBehavior = TextHeightBehavior( @@ -7244,7 +7182,7 @@ void main() { applyHeightToFirstAscent: false, ); await tester.pumpWidget(MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FocusScope( @@ -7712,7 +7650,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, selectionControls: materialTextSelectionControls, onSelectionChanged: (TextSelection selection, SelectionChangedCause? cause) { @@ -7739,7 +7677,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, onChanged: (String text) { throw FlutterError(errorText); @@ -7765,7 +7703,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, onEditingComplete: () { throw FlutterError(errorText); @@ -7796,7 +7734,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, onSubmitted: (String text) { throw FlutterError(errorText); @@ -7832,7 +7770,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018().black.subtitle1!.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ), )); @@ -7855,7 +7793,7 @@ void main() { final UnsettableController unsettableController = UnsettableController(); await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: EditableText( @@ -7911,7 +7849,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -7967,7 +7905,7 @@ void main() { controller: controller, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, keyboardType: TextInputType.text, @@ -8106,7 +8044,7 @@ void main() { controller: controller, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, keyboardType: TextInputType.text, @@ -8252,7 +8190,7 @@ void main() { controller: controller, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, keyboardType: TextInputType.text, @@ -8363,7 +8301,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -8433,7 +8371,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -8474,7 +8412,7 @@ void main() { setState = setter; return EditableText( focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: enableInteractiveSelection ? materialTextSelectionControls : null, @@ -8535,7 +8473,6 @@ void main() { home: EditableText( autofocus: true, controller: TextEditingController(text: 'A'), - maxLines: 1, focusNode: focusNode, style: textStyle, cursorColor: Colors.blue, @@ -8580,7 +8517,7 @@ void main() { child: EditableText( key: key, focusNode: focusNode, - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, controller: controller, @@ -8812,13 +8749,10 @@ class _TransformedEditableTextState extends State { @override Widget build(BuildContext context) { return MediaQuery( - data: const MediaQueryData( - devicePixelRatio: 1.0, - ), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Column( - mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Transform.translate( @@ -8826,7 +8760,7 @@ class _TransformedEditableTextState extends State { child: EditableText( controller: TextEditingController(), focusNode: FocusNode(), - style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1!, + style: Typography.material2018().black.subtitle1!, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), diff --git a/packages/flutter/test/widgets/editable_text_utils.dart b/packages/flutter/test/widgets/editable_text_utils.dart index 03628e8aa8..4d95a83a31 100644 --- a/packages/flutter/test/widgets/editable_text_utils.dart +++ b/packages/flutter/test/widgets/editable_text_utils.dart @@ -59,7 +59,6 @@ class OverflowWidgetTextEditingController extends TextEditingController { children: [ const TextSpan(text: 'Hi'), WidgetSpan( - alignment: PlaceholderAlignment.bottom, child: Container( color: Colors.redAccent, height: 100.0, diff --git a/packages/flutter/test/widgets/ensure_visible_test.dart b/packages/flutter/test/widgets/ensure_visible_test.dart index 2c54de04ea..e4155acc54 100644 --- a/packages/flutter/test/widgets/ensure_visible_test.dart +++ b/packages/flutter/test/widgets/ensure_visible_test.dart @@ -247,7 +247,6 @@ void main() { child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: SingleChildScrollView( - scrollDirection: Axis.vertical, child: Column( children: rows, ), diff --git a/packages/flutter/test/widgets/fitted_box_test.dart b/packages/flutter/test/widgets/fitted_box_test.dart index 76321c8f46..a5b1cdc52b 100644 --- a/packages/flutter/test/widgets/fitted_box_test.dart +++ b/packages/flutter/test/widgets/fitted_box_test.dart @@ -346,7 +346,6 @@ void main() { width: 100.0, height: 10.0, child: FittedBox( - fit: BoxFit.contain, child: SizedBox( width: 50.0, height: 50.0, @@ -452,7 +451,6 @@ void main() { width: 100.0, height: 100.0, child: FittedBox( - fit: BoxFit.contain, alignment: FractionalOffset.center, child: SizedBox( width: 1000.0, diff --git a/packages/flutter/test/widgets/focus_manager_test.dart b/packages/flutter/test/widgets/focus_manager_test.dart index 2bc0afe385..c7c1d3d655 100644 --- a/packages/flutter/test/widgets/focus_manager_test.dart +++ b/packages/flutter/test/widgets/focus_manager_test.dart @@ -480,7 +480,7 @@ void main() { testWidgets('canRequestFocus affects children.', (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); - final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope', canRequestFocus: true); + final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); final FocusAttachment scopeAttachment = scope.attach(context); final FocusNode parent1 = FocusNode(debugLabel: 'Parent 1'); final FocusAttachment parent1Attachment = parent1.attach(context); @@ -516,7 +516,7 @@ void main() { testWidgets("skipTraversal doesn't affect children.", (WidgetTester tester) async { final BuildContext context = await setupWidget(tester); - final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope', skipTraversal: false); + final FocusScopeNode scope = FocusScopeNode(debugLabel: 'Scope'); final FocusAttachment scopeAttachment = scope.attach(context); final FocusNode parent1 = FocusNode(debugLabel: 'Parent 1'); final FocusAttachment parent1Attachment = parent1.attach(context); @@ -801,7 +801,7 @@ void main() { expect(scope1.focusedChild, equals(child1)); expect(scope2.focusedChild, equals(child3)); - child1.unfocus(disposition: UnfocusDisposition.scope); + child1.unfocus(); await tester.pump(); // Focused child doesn't change. expect(scope1.focusedChild, isNull); @@ -823,7 +823,7 @@ void main() { expect(child3.hasPrimaryFocus, isFalse); // The same thing happens when unfocusing a second time. - child1.unfocus(disposition: UnfocusDisposition.scope); + child1.unfocus(); await tester.pump(); expect(scope1.focusedChild, isNull); expect(scope2.focusedChild, equals(child3)); @@ -836,7 +836,7 @@ void main() { // gets focus, but it doesn't mess with the focused children. child1.requestFocus(); await tester.pump(); - scope1.unfocus(disposition: UnfocusDisposition.scope); + scope1.unfocus(); await tester.pump(); expect(scope1.focusedChild, equals(child1)); expect(scope2.focusedChild, equals(child3)); @@ -892,7 +892,7 @@ void main() { expect(scope2.focusedChild, equals(child3)); expect(child3.hasPrimaryFocus, isTrue); - child1.unfocus(disposition: UnfocusDisposition.scope); + child1.unfocus(); await tester.pump(); expect(child3.hasPrimaryFocus, isTrue); expect(scope1.focusedChild, equals(child1)); diff --git a/packages/flutter/test/widgets/focus_scope_test.dart b/packages/flutter/test/widgets/focus_scope_test.dart index 979e75f170..a8b05f9722 100644 --- a/packages/flutter/test/widgets/focus_scope_test.dart +++ b/packages/flutter/test/widgets/focus_scope_test.dart @@ -81,7 +81,7 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget( - TestFocus(key: key, name: 'a'), + TestFocus(key: key), ); expect(key.currentState!.focusNode.hasFocus, isFalse); @@ -99,7 +99,7 @@ void main() { await tester.pumpWidget( Column( children: [ - TestFocus(key: keyA, name: 'a'), + TestFocus(key: keyA), TestFocus(key: keyB, name: 'b'), ], ), @@ -134,7 +134,7 @@ void main() { await tester.pumpWidget( Column( children: [ - TestFocus(key: keyA, name: 'a'), + TestFocus(key: keyA), TestFocus(key: keyB, name: 'b', autofocus: true), ], ), @@ -157,7 +157,6 @@ void main() { children: [ TestFocus( key: keyA, - name: 'a', autofocus: true, ), TestFocus( @@ -211,7 +210,6 @@ void main() { children: [ TestFocus( key: key, - name: 'a', debugLabel: 'Child', ), ], @@ -363,7 +361,6 @@ void main() { children: [ TestFocus( key: keyA, - name: 'a', autofocus: true, debugLabel: 'Child A', ), @@ -454,7 +451,6 @@ void main() { children: [ TestFocus( key: keyA, - name: 'a', ), TestFocus( key: keyB, @@ -552,7 +548,6 @@ void main() { TestFocus( debugLabel: 'Widget A', key: keyA, - name: 'a', ), TestFocus( debugLabel: 'Widget B', @@ -616,7 +611,6 @@ void main() { TestFocus( debugLabel: 'Child A', key: keyA, - name: 'a', ), ], ), @@ -679,7 +673,6 @@ void main() { TestFocus( debugLabel: 'Child A', key: keyA, - name: 'a', ), ], ), @@ -763,7 +756,6 @@ void main() { TestFocus( debugLabel: 'Child A', key: keyA, - name: 'a', ), ], ), @@ -842,7 +834,6 @@ void main() { children: [ TestFocus( key: keyA, - name: 'a', ), ], ), @@ -893,7 +884,6 @@ void main() { children: [ TestFocus( key: keyA, - name: 'a', ), ], ), @@ -926,7 +916,6 @@ void main() { TestFocus( debugLabel: 'Child A', key: keyA, - name: 'a', ), ], ), @@ -969,7 +958,6 @@ void main() { TestFocus( debugLabel: 'Child A', key: keyA, - name: 'a', ), ], ), @@ -1409,7 +1397,7 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget( - TestFocus(key: key, name: 'a'), + TestFocus(key: key), ); final SemanticsNode semantics = tester.getSemantics(find.byKey(key)); @@ -1437,7 +1425,7 @@ void main() { testWidgets('Setting canRequestFocus on focus node causes update.', (WidgetTester tester) async { final GlobalKey key = GlobalKey(); - final TestFocus testFocus = TestFocus(key: key, name: 'a'); + final TestFocus testFocus = TestFocus(key: key); await tester.pumpWidget( testFocus, ); @@ -1832,7 +1820,6 @@ void main() { bool? gotFocus; await tester.pumpWidget( ExcludeFocus( - excluding: true, child: Focus( onFocusChange: (bool focused) => gotFocus = focused, child: Focus( @@ -1907,7 +1894,6 @@ void main() { // Now turn off the focus for the subtree. await tester.pumpWidget( ExcludeFocus( - excluding: true, child: Focus( focusNode: parentFocusNode, child: Column( diff --git a/packages/flutter/test/widgets/focus_traversal_test.dart b/packages/flutter/test/widgets/focus_traversal_test.dart index 8fc023d99d..af77ebd029 100644 --- a/packages/flutter/test/widgets/focus_traversal_test.dart +++ b/packages/flutter/test/widgets/focus_traversal_test.dart @@ -1372,7 +1372,6 @@ void main() { child: FocusScope( debugLabel: 'Scope', child: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, @@ -1693,7 +1692,6 @@ void main() { Focus(focusNode: topNode, child: Container(height: 100)), Expanded( child: ListView( - scrollDirection: Axis.vertical, controller: controller, children: items.map((int item) { return Focus( diff --git a/packages/flutter/test/widgets/form_test.dart b/packages/flutter/test/widgets/form_test.dart index eb47fa9d18..8861d58777 100644 --- a/packages/flutter/test/widgets/form_test.dart +++ b/packages/flutter/test/widgets/form_test.dart @@ -14,7 +14,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -53,7 +53,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -91,7 +91,7 @@ void main() { Widget builder(AutovalidateMode autovalidateMode) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -147,7 +147,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -194,7 +194,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -241,7 +241,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -289,7 +289,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -334,7 +334,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -381,7 +381,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -433,7 +433,7 @@ void main() { setState = setter; return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -533,7 +533,7 @@ void main() { Widget builder(bool remove) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -588,7 +588,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -624,7 +624,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -740,7 +740,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -773,7 +773,7 @@ void main() { return MaterialApp( theme: ThemeData(), home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -813,7 +813,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Form( @@ -832,7 +832,7 @@ void main() { Widget builder() { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: FormField( @@ -856,7 +856,7 @@ void main() { final Widget widget = MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -894,7 +894,7 @@ void main() { Widget builder({required bool autovalidate}) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -937,7 +937,7 @@ void main() { Widget builder({required bool autovalidate}) { return MaterialApp( home: MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Center( diff --git a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart index c71254ae65..389e2a9b93 100644 --- a/packages/flutter/test/widgets/gesture_detector_semantics_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_semantics_test.dart @@ -287,7 +287,6 @@ void main() { Center( child: RawGestureDetector( key: detectorKey, - gestures: const {}, semantics: _TestSemanticsGestureDelegate( onTap: () { logs.add('tap'); }, onLongPress: () { logs.add('longPress'); }, diff --git a/packages/flutter/test/widgets/gesture_detector_test.dart b/packages/flutter/test/widgets/gesture_detector_test.dart index e8acdb3647..6ba520e86a 100644 --- a/packages/flutter/test/widgets/gesture_detector_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_test.dart @@ -515,10 +515,8 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.3, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStart, 0); @@ -528,10 +526,8 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStart, 1); @@ -541,31 +537,23 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.6, pressureMin: 0, - pressureMax: 1, )); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.7, pressureMin: 0, - pressureMax: 1, )); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.2, pressureMin: 0, - pressureMax: 1, )); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.3, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStart, 1); @@ -575,10 +563,8 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.9, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStart, 1); @@ -695,10 +681,8 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.3, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStart, 0); @@ -713,10 +697,8 @@ void main() { // Failed attempt to trigger the force press. await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); expect(horizontalDragStart, 1); @@ -784,7 +766,6 @@ void main() { final GlobalKey key = GlobalKey(); await tester.pumpWidget(RawGestureDetector( key: key, - gestures: const {}, semantics: _EmptySemanticsGestureDelegate(), excludeFromSemantics: true, child: Container(), diff --git a/packages/flutter/test/widgets/gesture_disambiguation_test.dart b/packages/flutter/test/widgets/gesture_disambiguation_test.dart index e3d9a36e20..0788d5a5c1 100644 --- a/packages/flutter/test/widgets/gesture_disambiguation_test.dart +++ b/packages/flutter/test/widgets/gesture_disambiguation_test.dart @@ -12,7 +12,6 @@ void main() { final Widget widget = GestureDetector( child: Column( - mainAxisAlignment: MainAxisAlignment.start, children: [ GestureDetector( onTap: () { detector1TapCount += 1; }, diff --git a/packages/flutter/test/widgets/grid_view_test.dart b/packages/flutter/test/widgets/grid_view_test.dart index c70f4fd586..77a206a695 100644 --- a/packages/flutter/test/widgets/grid_view_test.dart +++ b/packages/flutter/test/widgets/grid_view_test.dart @@ -19,7 +19,6 @@ void main() { child: GridView.count( dragStartBehavior: DragStartBehavior.down, crossAxisCount: 4, - children: const [], ), ), ); diff --git a/packages/flutter/test/widgets/heroes_test.dart b/packages/flutter/test/widgets/heroes_test.dart index 99df4acf85..d60ad87827 100644 --- a/packages/flutter/test/widgets/heroes_test.dart +++ b/packages/flutter/test/widgets/heroes_test.dart @@ -1308,7 +1308,6 @@ Future main() async { ), '/two': (BuildContext context) => Material( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( height: 200.0, @@ -1423,7 +1422,6 @@ Future main() async { ), '/two': (BuildContext context) => Material( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( height: 200.0, @@ -2719,7 +2717,6 @@ Future main() async { child: Column( children: [ HeroMode( - enabled: true, child: Card( child: Hero( tag: 'a', diff --git a/packages/flutter/test/widgets/hit_testing_test.dart b/packages/flutter/test/widgets/hit_testing_test.dart index a73a465ad7..5ddf736a40 100644 --- a/packages/flutter/test/widgets/hit_testing_test.dart +++ b/packages/flutter/test/widgets/hit_testing_test.dart @@ -42,7 +42,7 @@ void main() { ); final TestGesture gesture = - await tester.startGesture(tester.getCenter(find.byType(_HitTestCounter)), kind: PointerDeviceKind.touch); + await tester.startGesture(tester.getCenter(find.byType(_HitTestCounter))); await gesture.moveBy(const Offset(1, 1)); await gesture.up(); diff --git a/packages/flutter/test/widgets/image_resolution_test.dart b/packages/flutter/test/widgets/image_resolution_test.dart index b5c067d4d7..8a286af0f0 100644 --- a/packages/flutter/test/widgets/image_resolution_test.dart +++ b/packages/flutter/test/widgets/image_resolution_test.dart @@ -108,7 +108,6 @@ Widget buildImageAtRatio(String imageName, Key key, double ratio, bool inferSize data: MediaQueryData( size: const Size(windowSize, windowSize), devicePixelRatio: ratio, - padding: EdgeInsets.zero, ), child: DefaultAssetBundle( bundle: bundle ?? TestAssetBundle(), diff --git a/packages/flutter/test/widgets/image_rtl_test.dart b/packages/flutter/test/widgets/image_rtl_test.dart index 2666bd3e5e..6d574d524e 100644 --- a/packages/flutter/test/widgets/image_rtl_test.dart +++ b/packages/flutter/test/widgets/image_rtl_test.dart @@ -542,7 +542,6 @@ void main() { child: Image( image: TestImageProvider(testImage), alignment: Alignment.centerRight, - matchTextDirection: false, ), ), Duration.zero, @@ -566,7 +565,6 @@ void main() { child: Image( image: TestImageProvider(testImage), alignment: Alignment.centerRight, - matchTextDirection: false, ), ), Duration.zero, diff --git a/packages/flutter/test/widgets/image_test.dart b/packages/flutter/test/widgets/image_test.dart index 458b9cc095..04c7cafae2 100644 --- a/packages/flutter/test/widgets/image_test.dart +++ b/packages/flutter/test/widgets/image_test.dart @@ -210,13 +210,11 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -237,13 +235,11 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -275,7 +271,6 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -287,7 +282,6 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Container(width: 100.0), ), @@ -305,7 +299,6 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Container(width: 100.0), ), @@ -313,7 +306,6 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -343,13 +335,11 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: MediaQuery( key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -370,13 +360,11 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: MediaQuery( key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -408,7 +396,6 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -420,7 +407,6 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Container(width: 100.0), ), @@ -438,7 +424,6 @@ void main() { key: mediaQueryKey2, data: const MediaQueryData( devicePixelRatio: 5.0, - padding: EdgeInsets.zero, ), child: Container(width: 100.0), ), @@ -446,7 +431,6 @@ void main() { key: mediaQueryKey1, data: const MediaQueryData( devicePixelRatio: 10.0, - padding: EdgeInsets.zero, ), child: Image( excludeFromSemantics: true, @@ -1745,7 +1729,6 @@ void main() { await tester.pumpWidget(RepaintBoundary( key: key, child: Row( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround, textDirection: TextDirection.ltr, children: [ @@ -1801,7 +1784,6 @@ void main() { final _TestImageStreamCompleter streamCompleter = _TestImageStreamCompleter( ImageInfo( image: image, - scale: 1.0, debugLabel: 'test.png', ), ); @@ -1831,7 +1813,7 @@ void main() { }); testWidgets('Disposes image handle when disposed', (WidgetTester tester) async { - final ui.Image image = (await tester.runAsync(() => createTestImage(width: 1, height: 1, cache: false)))!; + final ui.Image image = (await tester.runAsync(() => createTestImage(cache: false)))!; expect(image.debugGetOpenHandleStackTraces()!.length, 1); @@ -1840,7 +1822,6 @@ void main() { Future.value( ImageInfo( image: image, - scale: 1.0, debugLabel: '_TestImage', ), ), @@ -1873,7 +1854,7 @@ void main() { testWidgets('Keeps stream alive when ticker mode is disabled', (WidgetTester tester) async { imageCache!.maximumSize = 0; - final ui.Image image = (await tester.runAsync(() => createTestImage(width: 1, height: 1, cache: false)))!; + final ui.Image image = (await tester.runAsync(() => createTestImage(cache: false)))!; final _TestImageProvider provider = _TestImageProvider(); provider.complete(image); diff --git a/packages/flutter/test/widgets/implicit_semantics_test.dart b/packages/flutter/test/widgets/implicit_semantics_test.dart index 6c7985f10b..18455bede7 100644 --- a/packages/flutter/test/widgets/implicit_semantics_test.dart +++ b/packages/flutter/test/widgets/implicit_semantics_test.dart @@ -17,7 +17,6 @@ void main() { textDirection: TextDirection.ltr, child: Semantics( container: true, - explicitChildNodes: false, child: Column( children: const [ Text('Michael Goderbauer'), @@ -139,7 +138,6 @@ void main() { textDirection: TextDirection.ltr, child: Semantics( container: true, - explicitChildNodes: false, child: Semantics( label: 'Signed in as', child: Column( @@ -182,7 +180,6 @@ void main() { textDirection: TextDirection.ltr, child: Semantics( container: true, - explicitChildNodes: false, child: Column( children: [ Semantics( diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart index c6b96506c2..362acd7786 100644 --- a/packages/flutter/test/widgets/inherited_test.dart +++ b/packages/flutter/test/widgets/inherited_test.dart @@ -78,7 +78,7 @@ void main() { expect(log, equals([first])); - final TestInherited third = TestInherited(shouldNotify: true, child: builder); + final TestInherited third = TestInherited(child: builder); await tester.pumpWidget(third); expect(log, equals([first, third])); @@ -471,7 +471,6 @@ void main() { expect(buildCount, equals(2)); await tester.pumpWidget(ChangeNotifierInherited( - notifier: null, child: builder, )); expect(buildCount, equals(3)); diff --git a/packages/flutter/test/widgets/interactive_viewer_test.dart b/packages/flutter/test/widgets/interactive_viewer_test.dart index 871a2310f1..a10aa9d3f5 100644 --- a/packages/flutter/test/widgets/interactive_viewer_test.dart +++ b/packages/flutter/test/widgets/interactive_viewer_test.dart @@ -68,14 +68,12 @@ void main() { testWidgets('boundary slightly bigger than child', (WidgetTester tester) async { final TransformationController transformationController = TransformationController(); const double boundaryMargin = 10.0; - const double minScale = 0.8; await tester.pumpWidget( MaterialApp( home: Scaffold( body: Center( child: InteractiveViewer( boundaryMargin: const EdgeInsets.all(boundaryMargin), - minScale: minScale, transformationController: transformationController, child: const SizedBox(width: 200.0, height: 200.0), ), @@ -246,7 +244,6 @@ void main() { body: Center( child: InteractiveViewer( boundaryMargin: const EdgeInsets.all(double.infinity), - minScale: minScale, transformationController: transformationController, child: const SizedBox(width: 200.0, height: 200.0), ), @@ -378,14 +375,12 @@ void main() { testWidgets('inertia fling and boundary sliding', (WidgetTester tester) async { final TransformationController transformationController = TransformationController(); const double boundaryMargin = 50.0; - const double minScale = 0.8; await tester.pumpWidget( MaterialApp( home: Scaffold( body: Center( child: InteractiveViewer( boundaryMargin: const EdgeInsets.all(boundaryMargin), - minScale: minScale, transformationController: transformationController, child: const SizedBox(width: 200.0, height: 200.0), ), diff --git a/packages/flutter/test/widgets/keyboard_listener_test.dart b/packages/flutter/test/widgets/keyboard_listener_test.dart index 128b7be3b4..985e5dd3f9 100644 --- a/packages/flutter/test/widgets/keyboard_listener_test.dart +++ b/packages/flutter/test/widgets/keyboard_listener_test.dart @@ -9,8 +9,8 @@ import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Can dispose without keyboard', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); - await tester.pumpWidget(KeyboardListener(focusNode: focusNode, onKeyEvent: null, child: Container())); - await tester.pumpWidget(KeyboardListener(focusNode: focusNode, onKeyEvent: null, child: Container())); + await tester.pumpWidget(KeyboardListener(focusNode: focusNode, child: Container())); + await tester.pumpWidget(KeyboardListener(focusNode: focusNode, child: Container())); await tester.pumpWidget(Container()); }); @@ -58,7 +58,7 @@ void main() { focusNode.requestFocus(); await tester.idle(); - await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web'); + await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft); await tester.idle(); expect(events.length, 2); diff --git a/packages/flutter/test/widgets/list_body_test.dart b/packages/flutter/test/widgets/list_body_test.dart index 0f6ba928b5..1949518c01 100644 --- a/packages/flutter/test/widgets/list_body_test.dart +++ b/packages/flutter/test/widgets/list_body_test.dart @@ -163,7 +163,6 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: ListBody( - mainAxis: Axis.vertical, children: children, ), ), diff --git a/packages/flutter/test/widgets/list_view_misc_test.dart b/packages/flutter/test/widgets/list_view_misc_test.dart index 0e9cc758b7..d20a5c5296 100644 --- a/packages/flutter/test/widgets/list_view_misc_test.dart +++ b/packages/flutter/test/widgets/list_view_misc_test.dart @@ -104,7 +104,7 @@ void main() { expect(first, equals(0)); expect(second, equals(1)); - await tester.pumpWidget(buildBlock(reverse: false)); + await tester.pumpWidget(buildBlock()); await tester.tapAt(target); expect(first, equals(1)); diff --git a/packages/flutter/test/widgets/list_view_relayout_test.dart b/packages/flutter/test/widgets/list_view_relayout_test.dart index a2a759b393..7d0ff9bb14 100644 --- a/packages/flutter/test/widgets/list_view_relayout_test.dart +++ b/packages/flutter/test/widgets/list_view_relayout_test.dart @@ -96,9 +96,7 @@ void main() { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, - child: ListView( - children: const [], - ), + child: ListView(), ), ); expect(list.geometry!.scrollExtent, equals(0.0)); @@ -137,9 +135,7 @@ void main() { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, - child: ListView( - children: const [], - ), + child: ListView(), ), ); diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index a4b06431a3..7d1a9922f9 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -327,7 +327,7 @@ void main() { ), ), ); - expect(tester.getSemantics(find.text('Text 5')), matchesSemantics(isHidden: false)); + expect(tester.getSemantics(find.text('Text 5')), matchesSemantics()); expect(tester.getSemantics(find.text('Text 6', skipOffstage: false)), matchesSemantics(isHidden: true)); expect(tester.getSemantics(find.text('Text 7', skipOffstage: false)), matchesSemantics(isHidden: true)); expect(tester.getSemantics(find.text('Text 8', skipOffstage: false)), matchesSemantics(isHidden: true)); @@ -353,7 +353,7 @@ void main() { ); // Scrollable maybe be marked dirty after layout. await tester.pumpAndSettle(); - expect(tester.getSemantics(find.text('Text 5')), matchesSemantics(isHidden: false)); + expect(tester.getSemantics(find.text('Text 5')), matchesSemantics()); expect(tester.getSemantics(find.text('Text 6', skipOffstage: false)), matchesSemantics(isHidden: true)); expect(tester.getSemantics(find.text('Text 7', skipOffstage: false)), matchesSemantics(isHidden: true)); expect(tester.getSemantics(find.text('Text 8', skipOffstage: false)), matchesSemantics(isHidden: true)); diff --git a/packages/flutter/test/widgets/list_view_vertical_test.dart b/packages/flutter/test/widgets/list_view_vertical_test.dart index 5642be78c3..73b0910b0a 100644 --- a/packages/flutter/test/widgets/list_view_vertical_test.dart +++ b/packages/flutter/test/widgets/list_view_vertical_test.dart @@ -12,7 +12,6 @@ Widget buildFrame() { textDirection: TextDirection.ltr, child: ListView( itemExtent: 290.0, - scrollDirection: Axis.vertical, children: items.map((int item) { return Text('$item'); }).toList(), @@ -71,7 +70,6 @@ void main() { child: ListView( itemExtent: 290.0, padding: const EdgeInsets.only(top: 250.0), - scrollDirection: Axis.vertical, children: items.map((int item) { return Text('$item'); }).toList(), diff --git a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart index ce0f94770a..395b56ada2 100644 --- a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart +++ b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart @@ -121,7 +121,6 @@ void main() { expect( () { ListWheelScrollView( - overAndUnderCenterOpacity: 1, itemExtent: 20.0, children: [Container()], ); diff --git a/packages/flutter/test/widgets/listener_test.dart b/packages/flutter/test/widgets/listener_test.dart index 8547d8996a..d1e33fbd10 100644 --- a/packages/flutter/test/widgets/listener_test.dart +++ b/packages/flutter/test/widgets/listener_test.dart @@ -272,7 +272,7 @@ void main() { final Matrix4 expectedTransform = Matrix4.identity() ..scale(1 / scaleFactor, 1 / scaleFactor, 1.0) - ..translate(-topLeft.dx, -topLeft.dy, 0); + ..translate(-topLeft.dx, -topLeft.dy); expect(center, isNot(const Offset(50, 50))); @@ -350,7 +350,7 @@ void main() { const Offset offset = Offset((800 - 100) / 2, (600 - 100) / 2); final Matrix4 expectedTransform = Matrix4.identity() ..rotateZ(-math.pi / 2) - ..translate(-offset.dx, -offset.dy, 0.0); + ..translate(-offset.dx, -offset.dy); final Offset localDownPosition = const Offset(50, 50) + const Offset(5, -10); expect(down.localPosition, within(distance: 0.001, from: localDownPosition)); diff --git a/packages/flutter/test/widgets/modal_barrier_test.dart b/packages/flutter/test/widgets/modal_barrier_test.dart index 050941dd4a..0470031997 100644 --- a/packages/flutter/test/widgets/modal_barrier_test.dart +++ b/packages/flutter/test/widgets/modal_barrier_test.dart @@ -380,7 +380,6 @@ void main() { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: ModalBarrier( - dismissible: true, semanticsLabel: 'Dismiss', ), )); @@ -402,7 +401,7 @@ void main() { testWidgets('Dismissible ModalBarrier is hidden on Android (back button is used to dismiss)', (WidgetTester tester) async { final SemanticsTester semantics = SemanticsTester(tester); - await tester.pumpWidget(const ModalBarrier(dismissible: true)); + await tester.pumpWidget(const ModalBarrier()); final TestSemantics expectedSemantics = TestSemantics.root(); expect(semantics, hasSemantics(expectedSemantics)); @@ -448,7 +447,6 @@ class SecondWidget extends StatelessWidget { Widget build(BuildContext context) { return const ModalBarrier( key: ValueKey('barrier'), - dismissible: true, ); } } @@ -461,7 +459,6 @@ class SecondWidgetWithCompetence extends StatelessWidget { children: [ const ModalBarrier( key: ValueKey('barrier'), - dismissible: true, ), GestureDetector( onVerticalDragStart: (_) {}, diff --git a/packages/flutter/test/widgets/mouse_region_test.dart b/packages/flutter/test/widgets/mouse_region_test.dart index 6ade4bbef3..8a09b8bec4 100644 --- a/packages/flutter/test/widgets/mouse_region_test.dart +++ b/packages/flutter/test/widgets/mouse_region_test.dart @@ -91,7 +91,7 @@ void main() { ), )); - final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse, buttons: kPrimaryMouseButton); + final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.mouse); await gesture.addPointer(location: Offset.zero); await gesture.down(Offset.zero); // Press the mouse button. addTearDown(gesture.removePointer); @@ -415,7 +415,7 @@ void main() { onExit: (PointerExitEvent details) => exit = details, ), )); - final TestGesture gesture = await tester.createGesture(kind: PointerDeviceKind.touch); + final TestGesture gesture = await tester.createGesture(); await gesture.addPointer(location: Offset.zero); addTearDown(gesture.removePointer); await tester.pump(); @@ -456,7 +456,6 @@ void main() { await tester.pumpWidget( Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ MouseRegion( onEnter: (PointerEnterEvent details) => enter1.add(details), @@ -533,7 +532,6 @@ void main() { await tester.pumpWidget( Column( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ MouseRegion( key: key1, @@ -1325,7 +1323,6 @@ void main() { testWidgets('opaque should default to true', (WidgetTester tester) async { final List logs = []; await tester.pumpWidget(tripleRegions( - opaqueC: null, addLog: (String log) => logs.add(log), )); @@ -1366,7 +1363,7 @@ void main() { ), ), ), - const MouseRegion(opaque: true), + const MouseRegion(), ], ), ), @@ -1455,19 +1452,16 @@ void main() { await gesture.addPointer(location: const Offset(5, 5)); addTearDown(gesture.removePointer); - void onHover(PointerHoverEvent _) {} - void onPaintChild() { logs.add('paint'); } + void _handleHover(PointerHoverEvent _) {} + void _handlePaintChild() { logs.add('paint'); } await tester.pumpWidget(_Scaffold( topLeft: SizedBox( height: 10, width: 10, child: MouseRegion( - opaque: true, - // Dummy callback so that MouseRegion stays affective after opaque - // turns false. - onHover: onHover, - child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), + onHover: _handleHover, + child: CustomPaint(painter: _DelegatedPainter(onPaint: _handlePaintChild)), ), ), background: MouseRegion(onEnter: (_) { logs.add('hover-enter'); }), @@ -1484,8 +1478,10 @@ void main() { width: 10, child: MouseRegion( opaque: false, - onHover: onHover, - child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), + // Dummy callback so that MouseRegion stays affective after opaque + // turns false. + onHover: _handleHover, + child: CustomPaint(painter: _DelegatedPainter(onPaint: _handlePaintChild)), ), ), background: MouseRegion(onEnter: (_) { logs.add('hover-enter'); }), @@ -1511,7 +1507,6 @@ void main() { child: MouseRegion( cursor: SystemMouseCursors.forbidden, onEnter: (_) { logEnters.add('enter'); }, - opaque: true, child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), ), ), @@ -1531,7 +1526,6 @@ void main() { child: MouseRegion( cursor: SystemMouseCursors.text, onEnter: (_) { logEnters.add('enter'); }, - opaque: true, child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), ), ), @@ -1583,7 +1577,6 @@ void main() { child: MouseRegion( cursor: SystemMouseCursors.forbidden, child: MouseRegion( - cursor: MouseCursor.defer, onEnter: (_) { logEnters.add('enter'); }, child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), ), @@ -1605,7 +1598,6 @@ void main() { cursor: SystemMouseCursors.forbidden, child: MouseRegion( cursor: SystemMouseCursors.text, - opaque: true, child: CustomPaint(painter: _DelegatedPainter(onPaint: onPaintChild)), ), ), @@ -1874,7 +1866,6 @@ class _ColumnContainer extends StatelessWidget { return Directionality( textDirection: TextDirection.ltr, child: Column( - mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: children, ), diff --git a/packages/flutter/test/widgets/navigator_restoration_test.dart b/packages/flutter/test/widgets/navigator_restoration_test.dart index f1794de036..5462834359 100644 --- a/packages/flutter/test/widgets/navigator_restoration_test.dart +++ b/packages/flutter/test/widgets/navigator_restoration_test.dart @@ -812,9 +812,7 @@ void main() { // Move navigator into restoration scope. await tester.pumpWidget(const RootRestorationScope( restorationId: 'root', - child: TestWidget( - restorationId: 'app', - ), + child: TestWidget(), )); expect(findRoute('Foo'), findsOneWidget); diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart index 780d00c4ed..0c84e28773 100644 --- a/packages/flutter/test/widgets/navigator_test.dart +++ b/packages/flutter/test/widgets/navigator_test.dart @@ -2990,13 +2990,11 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless1'), - settings: null, ), ); navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless2'), - settings: null, ), ); await tester.pumpAndSettle(); @@ -3026,7 +3024,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('third-pageless1'), - settings: null, ), ); await tester.pumpAndSettle(); @@ -3123,7 +3120,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('initial-pageless1'), - settings: null, ), ).then((_) => initialPageless1Completed = true); await tester.pumpAndSettle(); @@ -3141,7 +3137,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless1'), - settings: null, ), ).then((_) => secondPageless1Completed = true); await tester.pumpAndSettle(); @@ -3149,7 +3144,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless2'), - settings: null, ), ).then((_) => secondPageless2Completed = true); await tester.pumpAndSettle(); @@ -3168,7 +3162,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('third-pageless1'), - settings: null, ), ).then((_) => thirdPageless1Completed = true); await tester.pumpAndSettle(); @@ -3239,7 +3232,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('initial-pageless1'), - settings: null, ), ).then((_) => initialPageless1Completed = true); await tester.pumpAndSettle(); @@ -3261,7 +3253,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless1'), - settings: null, ), ).then((_) => secondPageless1Completed = true); await tester.pumpAndSettle(); @@ -3269,7 +3260,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('second-pageless2'), - settings: null, ), ).then((_) => secondPageless2Completed = true); await tester.pumpAndSettle(); @@ -3292,7 +3282,6 @@ void main() { navigator.currentState!.push( MaterialPageRoute( builder: (BuildContext context) => const Text('third-pageless1'), - settings: null, ), ).then((_) => thirdPageless1Completed = true); await tester.pumpAndSettle(); diff --git a/packages/flutter/test/widgets/opacity_test.dart b/packages/flutter/test/widgets/opacity_test.dart index 23af74d472..60a00bce8b 100644 --- a/packages/flutter/test/widgets/opacity_test.dart +++ b/packages/flutter/test/widgets/opacity_test.dart @@ -76,7 +76,6 @@ void main() { await tester.pumpWidget( const Opacity( opacity: 0.0, - alwaysIncludeSemantics: false, child: Text('a', textDirection: TextDirection.rtl), ), ); @@ -110,7 +109,6 @@ void main() { await tester.pumpWidget( const Opacity( opacity: 0.1, - alwaysIncludeSemantics: false, child: Text('a', textDirection: TextDirection.rtl), ), ); diff --git a/packages/flutter/test/widgets/overflow_bar_test.dart b/packages/flutter/test/widgets/overflow_bar_test.dart index 31ffbae12a..229f1b1126 100644 --- a/packages/flutter/test/widgets/overflow_bar_test.dart +++ b/packages/flutter/test/widgets/overflow_bar_test.dart @@ -162,7 +162,7 @@ void main() { expect(tester.getRect(find.byKey(child3Key)), const Rect.fromLTRB(100.0 - 32, 112, 100, 144)); // Children are right aligned - await tester.pumpWidget(buildFrame(overflowAlignment: OverflowBarAlignment.start, textDirection: TextDirection.rtl)); + await tester.pumpWidget(buildFrame(textDirection: TextDirection.rtl)); expect(tester.getRect(find.byKey(child1Key)), const Rect.fromLTRB(100.0 - 48, 0, 100, 48)); expect(tester.getRect(find.byKey(child2Key)), const Rect.fromLTRB(100.0 - 64, 48, 100, 112)); expect(tester.getRect(find.byKey(child3Key)), const Rect.fromLTRB(100.0 - 32, 112, 100, 144)); diff --git a/packages/flutter/test/widgets/page_route_builder_test.dart b/packages/flutter/test/widgets/page_route_builder_test.dart index b24f918da1..f550073a91 100644 --- a/packages/flutter/test/widgets/page_route_builder_test.dart +++ b/packages/flutter/test/widgets/page_route_builder_test.dart @@ -34,7 +34,6 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { void _presentModalPage() { Navigator.of(context).push(PageRouteBuilder( - transitionDuration: const Duration(milliseconds: 300), barrierColor: Colors.black54, opaque: false, pageBuilder: (BuildContext context, _, __) { diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index de7ab628c5..7ac4b1f1f2 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -11,8 +11,6 @@ import '../rendering/rendering_tester.dart'; import 'semantics_tester.dart'; import 'states.dart'; -const Duration _frameDuration = Duration(milliseconds: 100); - void main() { testWidgets('PageView resize from zero-size viewport should not lose state', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/88956 @@ -141,13 +139,13 @@ void main() { expect(find.text('Alaska'), findsOneWidget); expect(find.text('Arizona'), findsNothing); - await tester.pumpAndSettle(_frameDuration); + await tester.pumpAndSettle(); expect(find.text('Alabama'), findsOneWidget); expect(find.text('Alaska'), findsNothing); await tester.drag(find.byType(PageView), const Offset(-401.0, 0.0)); - await tester.pumpAndSettle(_frameDuration); + await tester.pumpAndSettle(); expect(find.text('Alabama'), findsNothing); expect(find.text('Alaska'), findsOneWidget); @@ -158,14 +156,14 @@ void main() { log.clear(); await tester.fling(find.byType(PageView), const Offset(-200.0, 0.0), 1000.0); - await tester.pumpAndSettle(_frameDuration); + await tester.pumpAndSettle(); expect(find.text('Alabama'), findsNothing); expect(find.text('Alaska'), findsNothing); expect(find.text('Arizona'), findsOneWidget); await tester.fling(find.byType(PageView), const Offset(200.0, 0.0), 1000.0); - await tester.pumpAndSettle(_frameDuration); + await tester.pumpAndSettle(); expect(find.text('Alabama'), findsNothing); expect(find.text('Alaska'), findsOneWidget); @@ -225,7 +223,7 @@ void main() { expect(find.text('California'), findsOneWidget); controller.nextPage(duration: const Duration(milliseconds: 150), curve: Curves.ease); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Colorado'), findsOneWidget); @@ -246,7 +244,7 @@ void main() { expect(find.text('Colorado'), findsOneWidget); controller.previousPage(duration: const Duration(milliseconds: 150), curve: Curves.ease); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('California'), findsOneWidget); }); @@ -268,7 +266,7 @@ void main() { expect(find.text('Alabama'), findsOneWidget); await tester.drag(find.byType(PageView), const Offset(-1250.0, 0.0)); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(find.text('Arizona'), findsOneWidget); @@ -732,7 +730,7 @@ void main() { 'All visible pages are able to receive touch events', (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/23873. - final PageController controller = PageController(viewportFraction: 1/4, initialPage: 0); + final PageController controller = PageController(viewportFraction: 1/4); late int tappedIndex; Widget build() { @@ -1083,9 +1081,7 @@ void main() { // PageView() defaults to true. await tester.pumpWidget(Directionality( textDirection: TextDirection.ltr, - child: PageView( - children: const [], - ), + child: PageView(), )); expect(tester.widget(viewportFinder()).padEnds, true); @@ -1095,7 +1091,6 @@ void main() { textDirection: TextDirection.ltr, child: PageView( padEnds: false, - children: const [], ), )); diff --git a/packages/flutter/test/widgets/pageable_list_test.dart b/packages/flutter/test/widgets/pageable_list_test.dart index 555e15fbc7..3cab09a14c 100644 --- a/packages/flutter/test/widgets/pageable_list_test.dart +++ b/packages/flutter/test/widgets/pageable_list_test.dart @@ -25,7 +25,6 @@ Widget buildFrame({ required TextDirection textDirection, }) { final PageView child = PageView( - scrollDirection: Axis.horizontal, reverse: reverse, onPageChanged: (int page) { currentPage = page; }, children: pages.map(buildPage).toList(), diff --git a/packages/flutter/test/widgets/physical_model_test.dart b/packages/flutter/test/widgets/physical_model_test.dart index 06357f0dde..ccd8698b1c 100644 --- a/packages/flutter/test/widgets/physical_model_test.dart +++ b/packages/flutter/test/widgets/physical_model_test.dart @@ -48,7 +48,6 @@ void main() { await tester.pumpWidget( MaterialApp( home: PhysicalModel( - shape: BoxShape.rectangle, color: Colors.grey, shadowColor: Colors.red, elevation: 1.0, @@ -73,7 +72,7 @@ void main() { await tester.pumpWidget( MediaQuery( key: key, - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: Padding( diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index b2c9890638..9f691a081d 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -421,7 +421,6 @@ void main() { height: 100.0, child: AndroidView( viewType: 'webview', - hitTestBehavior: PlatformViewHitTestBehavior.opaque, layoutDirection: TextDirection.ltr, ), ), @@ -1573,7 +1572,6 @@ void main() { height: 100.0, child: UiKitView( viewType: 'webview', - hitTestBehavior: PlatformViewHitTestBehavior.opaque, layoutDirection: TextDirection.ltr, ), ), diff --git a/packages/flutter/test/widgets/raw_keyboard_listener_test.dart b/packages/flutter/test/widgets/raw_keyboard_listener_test.dart index 906fcba5d0..3bbfcbc35f 100644 --- a/packages/flutter/test/widgets/raw_keyboard_listener_test.dart +++ b/packages/flutter/test/widgets/raw_keyboard_listener_test.dart @@ -9,8 +9,8 @@ import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Can dispose without keyboard', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); - await tester.pumpWidget(RawKeyboardListener(focusNode: focusNode, onKey: null, child: Container())); - await tester.pumpWidget(RawKeyboardListener(focusNode: focusNode, onKey: null, child: Container())); + await tester.pumpWidget(RawKeyboardListener(focusNode: focusNode, child: Container())); + await tester.pumpWidget(RawKeyboardListener(focusNode: focusNode, child: Container())); await tester.pumpWidget(Container()); }); @@ -62,7 +62,7 @@ void main() { focusNode.requestFocus(); await tester.idle(); - await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web'); + await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web'); // ignore: avoid_redundant_argument_values await tester.idle(); expect(events.length, 2); diff --git a/packages/flutter/test/widgets/restoration_mixin_test.dart b/packages/flutter/test/widgets/restoration_mixin_test.dart index 0cc419e03a..237b1bbdae 100644 --- a/packages/flutter/test/widgets/restoration_mixin_test.dart +++ b/packages/flutter/test/widgets/restoration_mixin_test.dart @@ -170,9 +170,7 @@ void main() { await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, - child: const _TestRestorableWidget( - restorationId: null, - ), + child: const _TestRestorableWidget(), ), ); final _TestRestorableWidgetState state = tester.state(find.byType(_TestRestorableWidget)); @@ -213,9 +211,7 @@ void main() { await tester.pumpWidget( UnmanagedRestorationScope( bucket: root, - child: const _TestRestorableWidget( - restorationId: null, - ), + child: const _TestRestorableWidget(), ), ); manager.doSerialization(); diff --git a/packages/flutter/test/widgets/restoration_scope_test.dart b/packages/flutter/test/widgets/restoration_scope_test.dart index 989f4b0aee..e9550ef9bc 100644 --- a/packages/flutter/test/widgets/restoration_scope_test.dart +++ b/packages/flutter/test/widgets/restoration_scope_test.dart @@ -42,7 +42,6 @@ void main() { testWidgets('null bucket disables restoration', (WidgetTester tester) async { await tester.pumpWidget( const UnmanagedRestorationScope( - bucket: null, child: BucketSpy(), ), ); diff --git a/packages/flutter/test/widgets/rich_text_test.dart b/packages/flutter/test/widgets/rich_text_test.dart index 8ea17fd612..5cae15358c 100644 --- a/packages/flutter/test/widgets/rich_text_test.dart +++ b/packages/flutter/test/widgets/rich_text_test.dart @@ -26,23 +26,15 @@ void main() { children: [ matchesSemantics( label: 'root', - hasTapAction: false, - hasLongPressAction: false, ), matchesSemantics( label: 'one', - hasTapAction: false, - hasLongPressAction: false, ), matchesSemantics( label: 'two', - hasTapAction: false, - hasLongPressAction: false, ), matchesSemantics( label: 'three', - hasTapAction: false, - hasLongPressAction: false, ), ], )); diff --git a/packages/flutter/test/widgets/safe_area_test.dart b/packages/flutter/test/widgets/safe_area_test.dart index 6456b33269..2b3494648b 100644 --- a/packages/flutter/test/widgets/safe_area_test.dart +++ b/packages/flutter/test/widgets/safe_area_test.dart @@ -76,7 +76,6 @@ void main() { data: MediaQueryData(padding: EdgeInsets.only( left: 100.0, top: 30.0, - right: 0.0, bottom: 40.0, )), child: child, @@ -88,7 +87,6 @@ void main() { testWidgets('SafeArea - properties', (WidgetTester tester) async { final SafeArea child = SafeArea( - left: true, right: false, bottom: false, child: Container(), @@ -197,7 +195,6 @@ void main() { textDirection: TextDirection.ltr, child: Viewport( offset: ViewportOffset.fixed(0.0), - axisDirection: AxisDirection.down, slivers: [ const SliverToBoxAdapter(child: SizedBox(width: 800.0, height: 100.0, child: Text('before'))), sliver, @@ -300,7 +297,6 @@ void main() { const EdgeInsets.only( left: 100.0, top: 30.0, - right: 0.0, bottom: 40.0, ), sliver, @@ -316,7 +312,6 @@ void main() { testWidgets('SliverSafeArea - properties', (WidgetTester tester) async { const SliverSafeArea child = SliverSafeArea( - left: true, right: false, bottom: false, sliver: SliverToBoxAdapter(child: SizedBox(width: 800.0, height: 100.0, child: Text('padded'))), diff --git a/packages/flutter/test/widgets/scroll_activity_test.dart b/packages/flutter/test/widgets/scroll_activity_test.dart index c229f4df11..088eb591d8 100644 --- a/packages/flutter/test/widgets/scroll_activity_test.dart +++ b/packages/flutter/test/widgets/scroll_activity_test.dart @@ -197,7 +197,7 @@ class _Carousel62209State extends State { void initState() { super.initState(); _pages = widget.pages.toList(); - _pageController = PageController(initialPage: 0, keepPage: false); + _pageController = PageController(keepPage: false); } @override diff --git a/packages/flutter/test/widgets/scroll_controller_test.dart b/packages/flutter/test/widgets/scroll_controller_test.dart index 101be9a0ec..be7935251c 100644 --- a/packages/flutter/test/widgets/scroll_controller_test.dart +++ b/packages/flutter/test/widgets/scroll_controller_test.dart @@ -44,7 +44,7 @@ void main() { expect(realOffset(), equals(controller.offset)); controller.animateTo(326.0, duration: const Duration(milliseconds: 300), curve: Curves.ease); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); expect(controller.offset, equals(326.0)); expect(realOffset(), equals(controller.offset)); diff --git a/packages/flutter/test/widgets/scroll_position_test.dart b/packages/flutter/test/widgets/scroll_position_test.dart index e5d8e349d6..a2c1b3b26b 100644 --- a/packages/flutter/test/widgets/scroll_position_test.dart +++ b/packages/flutter/test/widgets/scroll_position_test.dart @@ -168,7 +168,6 @@ void main() { await tester.pumpWidget( MaterialApp( home: ListView( - scrollDirection: Axis.vertical, controller: controller, children: items.map((int item) { return Focus( diff --git a/packages/flutter/test/widgets/scroll_view_test.dart b/packages/flutter/test/widgets/scroll_view_test.dart index f9ac95bc1f..2a6f900d45 100644 --- a/packages/flutter/test/widgets/scroll_view_test.dart +++ b/packages/flutter/test/widgets/scroll_view_test.dart @@ -415,7 +415,6 @@ void main() { await tester.pumpWidget(textFieldBoilerplate( child: ListView( padding: EdgeInsets.zero, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, children: focusNodes.map((FocusNode focusNode) { return Container( height: 50, @@ -448,7 +447,6 @@ void main() { await tester.pumpWidget(textFieldBoilerplate( child: ListView.builder( padding: EdgeInsets.zero, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, itemCount: focusNodes.length, itemBuilder: (BuildContext context,int index) { return Container( @@ -482,7 +480,6 @@ void main() { await tester.pumpWidget(textFieldBoilerplate( child: ListView.custom( padding: EdgeInsets.zero, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, childrenDelegate: SliverChildBuilderDelegate( (BuildContext context,int index) { return Container( @@ -518,7 +515,6 @@ void main() { await tester.pumpWidget(textFieldBoilerplate( child: ListView.separated( padding: EdgeInsets.zero, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, itemCount: focusNodes.length, separatorBuilder: (BuildContext context, int index) => const Divider(), itemBuilder: (BuildContext context,int index) { @@ -554,7 +550,6 @@ void main() { child: GridView( padding: EdgeInsets.zero, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount:2), - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, children: focusNodes.map((FocusNode focusNode) { return Container( height: 50, @@ -588,7 +583,6 @@ void main() { child: GridView.builder( padding: EdgeInsets.zero, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount:2), - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, itemCount: focusNodes.length, itemBuilder: (BuildContext context, int index) { return Container( @@ -623,7 +617,6 @@ void main() { child: GridView.count( padding: EdgeInsets.zero, crossAxisCount: 2, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, children: focusNodes.map((FocusNode focusNode) { return Container( height: 50, @@ -657,7 +650,6 @@ void main() { child: GridView.extent( padding: EdgeInsets.zero, maxCrossAxisExtent: 300, - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, children: focusNodes.map((FocusNode focusNode) { return Container( height: 50, @@ -691,7 +683,6 @@ void main() { child: GridView.custom( padding: EdgeInsets.zero, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount:2), - keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.manual, childrenDelegate: SliverChildBuilderDelegate( (BuildContext context,int index) { return Container( @@ -745,7 +736,7 @@ void main() { await tester.pump(const Duration(milliseconds: 10)); await tester.pump(const Duration(milliseconds: 10)); await tester.pump(const Duration(milliseconds: 10)); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); final Viewport viewport = tester.widget(find.byType(Viewport)); expect(viewport.offset.pixels, equals(2400.0)); @@ -897,18 +888,17 @@ void main() { }); testWidgets('Vertical CustomScrollViews are primary by default', (WidgetTester tester) async { - const CustomScrollView view = CustomScrollView(scrollDirection: Axis.vertical); + const CustomScrollView view = CustomScrollView(); expect(view.primary, isTrue); }); testWidgets('Vertical ListViews are primary by default', (WidgetTester tester) async { - final ListView view = ListView(scrollDirection: Axis.vertical); + final ListView view = ListView(); expect(view.primary, isTrue); }); testWidgets('Vertical GridViews are primary by default', (WidgetTester tester) async { final GridView view = GridView.count( - scrollDirection: Axis.vertical, crossAxisCount: 1, ); expect(view.primary, isTrue); @@ -935,7 +925,6 @@ void main() { testWidgets('CustomScrollViews with controllers are non-primary by default', (WidgetTester tester) async { final CustomScrollView view = CustomScrollView( controller: ScrollController(), - scrollDirection: Axis.vertical, ); expect(view.primary, isFalse); }); @@ -943,7 +932,6 @@ void main() { testWidgets('ListViews with controllers are non-primary by default', (WidgetTester tester) async { final ListView view = ListView( controller: ScrollController(), - scrollDirection: Axis.vertical, ); expect(view.primary, isFalse); }); @@ -951,7 +939,6 @@ void main() { testWidgets('GridViews with controllers are non-primary by default', (WidgetTester tester) async { final GridView view = GridView.count( controller: ScrollController(), - scrollDirection: Axis.vertical, crossAxisCount: 1, ); expect(view.primary, isFalse); @@ -1043,7 +1030,7 @@ void main() { }); testWidgets('Defaulting-to-primary ListViews are always scrollable', (WidgetTester tester) async { - final ListView view = ListView(scrollDirection: Axis.vertical); + final ListView view = ListView(); expect(view.physics, isA()); }); @@ -1064,7 +1051,6 @@ void main() { }, child: ListView( primary: true, - children: const [], ), ), ), @@ -1085,7 +1071,6 @@ void main() { }, child: ListView( primary: false, - children: const [], ), ), ), @@ -1107,7 +1092,6 @@ void main() { child: ListView( primary: false, physics: const AlwaysScrollableScrollPhysics(), - children: const [], ), ), ), @@ -1129,7 +1113,6 @@ void main() { child: ListView( primary: true, physics: const ScrollPhysics(), - children: const [], ), ), ), diff --git a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart index b3eee56473..e956f34bd9 100644 --- a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart +++ b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart @@ -62,7 +62,6 @@ void main() { child: ListView( dragStartBehavior: DragStartBehavior.down, itemExtent: 290.0, - scrollDirection: Axis.vertical, children: items.map((int item) { return GestureDetector( onTap: () { tapped.add(item); }, diff --git a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart index c69f51df30..57ed2578a7 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_traversal_order_test.dart @@ -176,7 +176,6 @@ void main() { ), ], ), - childOrder: DebugSemanticsDumpOrder.traversalOrder, ignoreId: true, ignoreTransform: true, ignoreRect: true, @@ -316,7 +315,6 @@ void main() { ), ], ), - childOrder: DebugSemanticsDumpOrder.traversalOrder, ignoreId: true, ignoreTransform: true, ignoreRect: true, @@ -445,7 +443,6 @@ void main() { ), ], ), - childOrder: DebugSemanticsDumpOrder.traversalOrder, ignoreId: true, ignoreTransform: true, ignoreRect: true, @@ -582,7 +579,6 @@ void main() { ), ], ), - childOrder: DebugSemanticsDumpOrder.traversalOrder, ignoreId: true, ignoreTransform: true, ignoreRect: true, @@ -715,7 +711,6 @@ void main() { ), ], ), - childOrder: DebugSemanticsDumpOrder.traversalOrder, ignoreId: true, ignoreTransform: true, ignoreRect: true, diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart index b0d6b4864e..1e21d2ba87 100644 --- a/packages/flutter/test/widgets/scrollable_test.dart +++ b/packages/flutter/test/widgets/scrollable_test.dart @@ -335,10 +335,10 @@ void main() { // Create a hover event so that |testPointer| has a location when generating the scroll. testPointer.hover(scrollEventLocation); await tester.sendEventToBinding(testPointer.scroll(const Offset(0.0, 20.0))); - expect(getScrollOffset(tester, last: true), 20.0); + expect(getScrollOffset(tester), 20.0); // Pointer signals should not cause overscroll. await tester.sendEventToBinding(testPointer.scroll(const Offset(0.0, -30.0))); - expect(getScrollOffset(tester, last: true), 0.0); + expect(getScrollOffset(tester), 0.0); }); testWidgets('Scroll pointer signals are ignored when scrolling is disabled', (WidgetTester tester) async { @@ -1187,7 +1187,6 @@ void main() { controller: outerController, child: Row( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, children: [ Column( children: [ @@ -1295,7 +1294,7 @@ void main() { }, variant: const TargetPlatformVariant({ TargetPlatform.iOS, TargetPlatform.macOS, TargetPlatform.android })); testWidgets('Does scroll with mouse pointer drag when behavior is not configured to ignore them', (WidgetTester tester) async { - await pumpTest(tester, debugDefaultTargetPlatformOverride, enableMouseDrag: true); + await pumpTest(tester, debugDefaultTargetPlatformOverride); final TestGesture gesture = await tester.startGesture(tester.getCenter(find.byType(Scrollable), warnIfMissed: true), kind: ui.PointerDeviceKind.mouse); await gesture.moveBy(const Offset(0.0, -200)); diff --git a/packages/flutter/test/widgets/scrollbar_test.dart b/packages/flutter/test/widgets/scrollbar_test.dart index 22d4fe7d32..d84467343a 100644 --- a/packages/flutter/test/widgets/scrollbar_test.dart +++ b/packages/flutter/test/widgets/scrollbar_test.dart @@ -259,7 +259,6 @@ void main() { viewportDimension: viewportDimension, ); const Size size = Size(600, viewportDimension); - const double margin = 0; for (final ScrollbarOrientation scrollbarOrientation in ScrollbarOrientation.values) { final AxisDirection axisDirection; @@ -269,7 +268,6 @@ void main() { axisDirection = AxisDirection.right; painter = _buildPainter( - crossAxisMargin: margin, scrollMetrics: startingMetrics, scrollbarOrientation: scrollbarOrientation, ); @@ -319,14 +317,11 @@ void main() { viewportDimension: viewportDimension, ); const Size size = Size(600, viewportDimension); - const double margin = 0; Rect rect; // Vertical scroll with TextDirection.ltr painter = _buildPainter( - crossAxisMargin: margin, scrollMetrics: startingMetrics, - textDirection: TextDirection.ltr, ); painter.update( startingMetrics.copyWith(axisDirection: AxisDirection.down), @@ -341,7 +336,6 @@ void main() { // Vertical scroll with TextDirection.rtl painter = _buildPainter( - crossAxisMargin: margin, scrollMetrics: startingMetrics, textDirection: TextDirection.rtl, ); @@ -358,7 +352,6 @@ void main() { // Horizontal scroll painter = _buildPainter( - crossAxisMargin: margin, scrollMetrics: startingMetrics, ); painter.update( diff --git a/packages/flutter/test/widgets/selectable_text_test.dart b/packages/flutter/test/widgets/selectable_text_test.dart index 3e2dc24a63..92400bc21c 100644 --- a/packages/flutter/test/widgets/selectable_text_test.dart +++ b/packages/flutter/test/widgets/selectable_text_test.dart @@ -277,7 +277,7 @@ void main() { testWidgets('Rich selectable text has expected defaults', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(devicePixelRatio: 1.0), + data: MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: SelectableText.rich( @@ -322,7 +322,7 @@ void main() { testWidgets('Rich selectable text only support TextSpan', (WidgetTester tester) async { await tester.pumpWidget( const MediaQuery( - data: MediaQueryData(devicePixelRatio: 1.0), + data: MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: SelectableText.rich( @@ -710,7 +710,6 @@ void main() { child: const SelectableText( 'a selectable text', toolbarOptions: ToolbarOptions( - copy: false, selectAll: true, ), ), @@ -1579,7 +1578,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: SelectableText( text, maxLines: 3, @@ -1713,7 +1711,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: const SelectableText( testValue, maxLines: 3, @@ -1762,7 +1759,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: const SelectableText( testValue, maxLines: 3, @@ -1798,7 +1794,6 @@ void main() { home: Material( child: RawKeyboardListener( focusNode: focusNode, - onKey: null, child: SelectableText( testValue, maxLines: 3, @@ -2000,7 +1995,6 @@ void main() { overlay( child: const SelectableText( 'x', - maxLines: null, ), ), ); @@ -3278,7 +3272,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 7, - affinity: TextAffinity.downstream, ), ); // Cursor move doesn't trigger a toolbar initially. @@ -3293,7 +3286,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 12, - affinity: TextAffinity.downstream, ), ); // Still no toolbar. @@ -3308,7 +3300,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 23, - affinity: TextAffinity.downstream, ), ); // Still no toolbar. @@ -3323,7 +3314,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 23, - affinity: TextAffinity.downstream, ), ); // The toolbar now shows up. @@ -3360,7 +3350,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 7, - affinity: TextAffinity.downstream, ), ); // Cursor move doesn't trigger a toolbar initially. @@ -3375,7 +3364,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 8, - affinity: TextAffinity.downstream, ), ); // Still no toolbar. @@ -3390,7 +3378,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 12, - affinity: TextAffinity.downstream, ), ); // Still no toolbar. @@ -3405,7 +3392,6 @@ void main() { const TextSelection( baseOffset: 0, extentOffset: 12, - affinity: TextAffinity.downstream, ), ); // The toolbar now shows up. @@ -3462,7 +3448,6 @@ void main() { const TextSelection( baseOffset: 13, extentOffset: 66, - affinity: TextAffinity.downstream, ), ); // Keep moving out. @@ -3473,7 +3458,6 @@ void main() { const TextSelection( baseOffset: 13, extentOffset: 66, - affinity: TextAffinity.downstream, ), ); await gesture.moveBy(const Offset(1, 0)); @@ -3483,7 +3467,6 @@ void main() { const TextSelection( baseOffset: 13, extentOffset: 66, - affinity: TextAffinity.downstream, ), ); expect(find.byType(CupertinoButton), findsNothing); @@ -3497,7 +3480,6 @@ void main() { const TextSelection( baseOffset: 13, extentOffset: 66, - affinity: TextAffinity.downstream, ), ); // The toolbar now shows up. @@ -3692,7 +3674,7 @@ void main() { // First tap moved the cursor. expect( controller.selection, - const TextSelection.collapsed(offset: 0, affinity: TextAffinity.downstream), + const TextSelection.collapsed(offset: 0), ); await tester.tapAt(selectableTextStart + const Offset(10.0, 5.0)); await tester.pump(const Duration(milliseconds: 50)); @@ -3743,7 +3725,7 @@ void main() { pressureMin: 0.0, ), ); - await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: offset + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0, pressureMax: 1)); + await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: offset + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0)); final EditableText editableTextWidget = tester.widget(find.byType(EditableText).first); final TextEditingController controller = editableTextWidget.controller; @@ -3781,7 +3763,7 @@ void main() { ), ); - await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: selectableTextStart + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0, pressureMax: 1)); + await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: selectableTextStart + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0)); final EditableText editableTextWidget = tester.widget(find.byType(EditableText).first); final TextEditingController controller = editableTextWidget.controller; @@ -3823,7 +3805,7 @@ void main() { ), ); - await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: selectableTextStart + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0, pressureMax: 1)); + await gesture.updateWithCustomEvent(PointerMoveEvent(pointer: pointerValue, position: selectableTextStart + const Offset(150.0, 5.0), pressure: 0.5, pressureMin: 0)); await gesture.up(); final EditableText editableTextWidget = tester.widget(find.byType(EditableText).first); @@ -4943,7 +4925,6 @@ void main() { ), key: Key('field0'), selectionHeightStyle: ui.BoxHeightStyle.includeLineSpacingBottom, - selectionWidthStyle: ui.BoxWidthStyle.tight, ), ], ), diff --git a/packages/flutter/test/widgets/semantics_1_test.dart b/packages/flutter/test/widgets/semantics_1_test.dart index 4ec238d2e8..20c62a4d49 100644 --- a/packages/flutter/test/widgets/semantics_1_test.dart +++ b/packages/flutter/test/widgets/semantics_1_test.dart @@ -54,7 +54,6 @@ void main() { SizedBox( height: 10.0, child: IgnorePointer( - ignoring: true, child: Semantics( label: 'child1', textDirection: TextDirection.ltr, @@ -150,7 +149,6 @@ void main() { SizedBox( height: 10.0, child: IgnorePointer( - ignoring: true, child: Semantics( label: 'child2', textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/semantics_2_test.dart b/packages/flutter/test/widgets/semantics_2_test.dart index 21988a6667..7a2d5912c6 100644 --- a/packages/flutter/test/widgets/semantics_2_test.dart +++ b/packages/flutter/test/widgets/semantics_2_test.dart @@ -88,7 +88,6 @@ void main() { SizedBox( height: 10.0, child: IgnorePointer( - ignoring: true, child: Semantics( label: 'child2', textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/widgets/semantics_traversal_test.dart b/packages/flutter/test/widgets/semantics_traversal_test.dart index d02ab63275..a509ab2d2c 100644 --- a/packages/flutter/test/widgets/semantics_traversal_test.dart +++ b/packages/flutter/test/widgets/semantics_traversal_test.dart @@ -336,7 +336,6 @@ class TraversalTester { ignoreTransform: true, ignoreRect: true, ignoreId: true, - childOrder: DebugSemanticsDumpOrder.traversalOrder, )); } diff --git a/packages/flutter/test/widgets/shader_mask_test.dart b/packages/flutter/test/widgets/shader_mask_test.dart index 905b09f15f..77df57fd6a 100644 --- a/packages/flutter/test/widgets/shader_mask_test.dart +++ b/packages/flutter/test/widgets/shader_mask_test.dart @@ -33,7 +33,6 @@ void main() { } final Widget widget = Align( - alignment: Alignment.center, child: SizedBox( width: 400.0, height: 400.0, @@ -60,7 +59,6 @@ void main() { alignment: Alignment.bottomRight, child: ShaderMask( shaderCallback: (Rect bounds) => const RadialGradient( - center: Alignment.center, radius: 0.05, colors: [Color(0xFFFF0000), Color(0xFF00FF00)], tileMode: TileMode.mirror, @@ -90,7 +88,6 @@ void main() { alignment: Alignment.topLeft, child: ShaderMask( shaderCallback: (Rect bounds) => const RadialGradient( - center: Alignment.center, radius: 0.05, colors: [Color(0xFFFF0000), Color(0xFF00FF00)], tileMode: TileMode.mirror, diff --git a/packages/flutter/test/widgets/shape_decoration_test.dart b/packages/flutter/test/widgets/shape_decoration_test.dart index bc84498ec6..0173bb66de 100644 --- a/packages/flutter/test/widgets/shape_decoration_test.dart +++ b/packages/flutter/test/widgets/shape_decoration_test.dart @@ -22,8 +22,8 @@ Future main() async { MaterialApp( home: DecoratedBox( decoration: ShapeDecoration( - shape: Border.all(width: 1.0, color: Colors.white) + - Border.all(width: 1.0, color: Colors.black), + shape: Border.all(color: Colors.white) + + Border.all(), image: DecorationImage( image: image, ), @@ -45,8 +45,8 @@ Future main() async { MaterialApp( home: DecoratedBox( decoration: ShapeDecoration( - shape: Border.all(width: 1.0, color: Colors.white) + - Border.all(width: 1.0, color: Colors.black), + shape: Border.all(color: Colors.white) + + Border.all(), color: Colors.blue, ), ), diff --git a/packages/flutter/test/widgets/single_child_scroll_view_test.dart b/packages/flutter/test/widgets/single_child_scroll_view_test.dart index e942aa4e9c..f92c2fab91 100644 --- a/packages/flutter/test/widgets/single_child_scroll_view_test.dart +++ b/packages/flutter/test/widgets/single_child_scroll_view_test.dart @@ -44,7 +44,6 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: SingleChildScrollView( - scrollDirection: Axis.vertical, child: Container(height: 600.0), ), ), @@ -64,7 +63,6 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: SingleChildScrollView( - scrollDirection: Axis.vertical, child: Container(height: 600.1), ), ), @@ -216,7 +214,7 @@ void main() { }); testWidgets('Vertical SingleChildScrollViews are primary by default', (WidgetTester tester) async { - const SingleChildScrollView view = SingleChildScrollView(scrollDirection: Axis.vertical); + const SingleChildScrollView view = SingleChildScrollView(); expect(view.primary, isTrue); }); @@ -228,7 +226,6 @@ void main() { testWidgets('SingleChildScrollViews with controllers are non-primary by default', (WidgetTester tester) async { final SingleChildScrollView view = SingleChildScrollView( controller: ScrollController(), - scrollDirection: Axis.vertical, ); expect(view.primary, isFalse); }); diff --git a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart index a0f6673ea3..76c50d41bf 100644 --- a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart +++ b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart @@ -259,7 +259,6 @@ void main() { key: key, color: Colors.blue[300], child: Align( - alignment: Alignment.center, child: Padding( padding: const EdgeInsets.all(50.0), child: ElevatedButton( @@ -296,7 +295,6 @@ void main() { mainAxisSize: MainAxisSize.min, children: [ const Flexible( - fit: FlexFit.loose, child: Center(child: FlutterLogo(size: 100)), ), ElevatedButton( @@ -448,7 +446,6 @@ void main() { key: key, color: Colors.blue[300], child: Align( - alignment: Alignment.center, child: Padding( padding: const EdgeInsets.all(50.0), child: ElevatedButton( @@ -568,7 +565,6 @@ void main() { mainAxisSize: MainAxisSize.min, children: [ const Flexible( - fit: FlexFit.loose, child: Center(child: FlutterLogo(size: 100)), ), ElevatedButton( @@ -728,7 +724,6 @@ void main() { key: key, color: Colors.blue[300], child: Align( - alignment: Alignment.center, child: Padding( padding: const EdgeInsets.all(50.0), child: ElevatedButton( diff --git a/packages/flutter/test/widgets/sliver_fill_viewport_test.dart b/packages/flutter/test/widgets/sliver_fill_viewport_test.dart index 896145bd8c..f636dc535a 100644 --- a/packages/flutter/test/widgets/sliver_fill_viewport_test.dart +++ b/packages/flutter/test/widgets/sliver_fill_viewport_test.dart @@ -173,7 +173,6 @@ void main() { child: CustomScrollView( slivers: [ SliverFillViewport( - padEnds: true, viewportFraction: 0.5, delegate: delegate, ), diff --git a/packages/flutter/test/widgets/sliver_visibility_test.dart b/packages/flutter/test/widgets/sliver_visibility_test.dart index 0e30a9f24c..9a484d4490 100644 --- a/packages/flutter/test/widgets/sliver_visibility_test.dart +++ b/packages/flutter/test/widgets/sliver_visibility_test.dart @@ -129,7 +129,6 @@ void main() { await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, replacementSliver: const SliverToBoxAdapter(child: Placeholder()), - visible: true, ))); expect(find.byType(Text, skipOffstage: false), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); @@ -148,7 +147,6 @@ void main() { // visible: true, maintain all await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, - visible: true, maintainState: true, maintainAnimation: true, maintainSize: true, @@ -293,7 +291,7 @@ void main() { maintainAnimation: true, ))); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), paintsNothing); @@ -313,7 +311,7 @@ void main() { maintainState: true, ))); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), paintsNothing); @@ -332,7 +330,6 @@ void main() { // visible: true, maintain state await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, - visible: true, maintainState: true, ))); expect(find.byType(Text), findsOneWidget); @@ -356,7 +353,7 @@ void main() { maintainState: true, ))); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), paintsNothing); @@ -372,7 +369,6 @@ void main() { // visible: true, maintain state. await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, - visible: true, maintainState: true, ))); expect(find.byType(Text), findsOneWidget); @@ -396,7 +392,7 @@ void main() { maintainState: true, ))); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), findsOneWidget); expect(find.byType(SliverVisibility, skipOffstage: false), paintsNothing); @@ -431,7 +427,6 @@ void main() { // visible: true. await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, - visible: true, ))); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); @@ -467,7 +462,6 @@ void main() { // visible: true. await tester.pumpWidget(_boilerPlate(SliverVisibility( sliver: testChild, - visible: true, ))); expect(find.byType(Text), findsOneWidget); expect(find.text('a true', skipOffstage: false), findsOneWidget); diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart index 23adceea69..5306450e89 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart @@ -391,7 +391,6 @@ void main() { physics: const BouncingScrollPhysics(), slivers: [ const SliverAppBar( - pinned: false, floating: true, expandedHeight: 100.0, ), @@ -426,7 +425,6 @@ void main() { slivers: [ const SliverAppBar( pinned: true, - floating: false, expandedHeight: 100.0, ), SliverToBoxAdapter(child: Container(key: anchor, color: Colors.red, height: 100)), diff --git a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart index 3ef9c5f078..3639d64094 100644 --- a/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_pinned_test.dart @@ -146,7 +146,7 @@ void main() { verifyPaintPosition(key4, const Offset(0.0, 950.0), false); verifyPaintPosition(key5, const Offset(0.0, 1500.0), false); position.animateTo(550.0, curve: Curves.linear, duration: const Duration(minutes: 1)); - await tester.pumpAndSettle(const Duration(milliseconds: 100)); + await tester.pumpAndSettle(); verifyPaintPosition(key1, Offset.zero, false); verifyPaintPosition(key2, Offset.zero, true); verifyPaintPosition(key3, const Offset(0.0, 200.0), true); diff --git a/packages/flutter/test/widgets/slivers_evil_test.dart b/packages/flutter/test/widgets/slivers_evil_test.dart index eec0b3a918..50f0bd4aae 100644 --- a/packages/flutter/test/widgets/slivers_evil_test.dart +++ b/packages/flutter/test/widgets/slivers_evil_test.dart @@ -83,11 +83,9 @@ void main() { behavior: const TestBehavior(), child: Scrollbar( child: Scrollable( - axisDirection: AxisDirection.down, physics: const TestScrollPhysics(), viewportBuilder: (BuildContext context, ViewportOffset offset) { return Viewport( - axisDirection: AxisDirection.down, anchor: 0.25, offset: offset, center: centerKey, diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart index fe074f9776..c1562b153a 100644 --- a/packages/flutter/test/widgets/slivers_padding_test.dart +++ b/packages/flutter/test/widgets/slivers_padding_test.dart @@ -320,7 +320,6 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: Viewport( - axisDirection: AxisDirection.down, offset: ViewportOffset.fixed(0.0), slivers: const [ SliverPadding(padding: EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), diff --git a/packages/flutter/test/widgets/slivers_test.dart b/packages/flutter/test/widgets/slivers_test.dart index 19b7f66e27..606d7fc9d6 100644 --- a/packages/flutter/test/widgets/slivers_test.dart +++ b/packages/flutter/test/widgets/slivers_test.dart @@ -665,7 +665,6 @@ void main() { final SemanticsTester semantics = SemanticsTester(tester); await tester.pumpWidget(_boilerPlate( const SliverOffstage( - offstage: true, sliver: SliverToBoxAdapter( child: Text('a'), ), @@ -763,7 +762,6 @@ void main() { ), ), opacity: 0.0, - alwaysIncludeSemantics: false, ), )); @@ -796,7 +794,6 @@ void main() { ), ), opacity: 0.1, - alwaysIncludeSemantics: false, ), )); @@ -830,7 +827,6 @@ void main() { final List events = []; await tester.pumpWidget(_boilerPlate( SliverIgnorePointer( - ignoring: true, ignoringSemantics: false, sliver: SliverToBoxAdapter( child: GestureDetector( @@ -874,7 +870,6 @@ void main() { final List events = []; await tester.pumpWidget(_boilerPlate( SliverIgnorePointer( - ignoring: true, ignoringSemantics: true, sliver: SliverToBoxAdapter( child: GestureDetector( diff --git a/packages/flutter/test/widgets/spacer_test.dart b/packages/flutter/test/widgets/spacer_test.dart index dc287f04c3..93810d5ff7 100644 --- a/packages/flutter/test/widgets/spacer_test.dart +++ b/packages/flutter/test/widgets/spacer_test.dart @@ -21,7 +21,7 @@ void main() { testWidgets('Spacer takes up space proportional to flex.', (WidgetTester tester) async { const Spacer spacer1 = Spacer(); - const Spacer spacer2 = Spacer(flex: 1); + const Spacer spacer2 = Spacer(); const Spacer spacer3 = Spacer(flex: 2); const Spacer spacer4 = Spacer(flex: 4); await tester.pumpWidget(Row( diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index 00bb7e0d04..d23e76b806 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -381,7 +381,7 @@ void main() { final RenderStack renderObject = tester.allRenderObjects.whereType().first; expect(renderObject.clipBehavior, equals(Clip.hardEdge)); - await tester.pumpWidget(Stack(textDirection: TextDirection.ltr, clipBehavior: Clip.hardEdge)); + await tester.pumpWidget(Stack(textDirection: TextDirection.ltr)); expect(renderObject.clipBehavior, equals(Clip.hardEdge)); }); @@ -421,7 +421,6 @@ void main() { textDirection: TextDirection.ltr, child: Center( child: Stack( - clipBehavior: Clip.hardEdge, children: const [ SizedBox( width: 100.0, @@ -629,7 +628,6 @@ void main() { ); await tester.pumpWidget( Stack( - alignment: AlignmentDirectional.topStart, textDirection: TextDirection.rtl, ), ); diff --git a/packages/flutter/test/widgets/table_test.dart b/packages/flutter/test/widgets/table_test.dart index a6dd613233..accb83b3ba 100644 --- a/packages/flutter/test/widgets/table_test.dart +++ b/packages/flutter/test/widgets/table_test.dart @@ -386,7 +386,7 @@ void main() { textDirection: TextDirection.ltr, child: Table( columnWidths: const { - 0: FlexColumnWidth(1.0), + 0: FlexColumnWidth(), 1: FlexColumnWidth(0.123), 2: FlexColumnWidth(0.123), 3: FlexColumnWidth(0.123), diff --git a/packages/flutter/test/widgets/text_editing_action_target_test.dart b/packages/flutter/test/widgets/text_editing_action_target_test.dart index 387c5315c3..99363055a7 100644 --- a/packages/flutter/test/widgets/text_editing_action_target_test.dart +++ b/packages/flutter/test/widgets/text_editing_action_target_test.dart @@ -40,7 +40,6 @@ class _FakeEditableTextState with TextSelectionDelegate, TextEditingActionTarget endHandleLayerLink: LayerLink(), text: textSpan, selection: textEditingValue.selection, - textAlign: TextAlign.start, ); return _renderEditable!; } @@ -1739,7 +1738,6 @@ void main() { ), textEditingValue: const TextEditingValue( text: text, - selection: TextSelection.collapsed(offset: -1), ), ); final RenderEditable editable = editableTextState.renderEditable; diff --git a/packages/flutter/test/widgets/text_golden_test.dart b/packages/flutter/test/widgets/text_golden_test.dart index ce2fd45079..5db8aee82f 100644 --- a/packages/flutter/test/widgets/text_golden_test.dart +++ b/packages/flutter/test/widgets/text_golden_test.dart @@ -531,7 +531,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', @@ -624,7 +624,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'My name is: ', @@ -670,7 +670,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'outer', @@ -799,7 +799,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', @@ -906,7 +906,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', @@ -1013,7 +1013,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', @@ -1120,7 +1120,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', @@ -1227,7 +1227,7 @@ void main() { color: Color(0xff00ff00), ), child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 0, maxWidth: 200, minHeight: 0, maxHeight: 100), + constraints: const BoxConstraints(maxWidth: 200, maxHeight: 100), child: const Text.rich( TextSpan( text: 'C ', diff --git a/packages/flutter/test/widgets/text_selection_test.dart b/packages/flutter/test/widgets/text_selection_test.dart index 46606fcd1c..ba3b28fb85 100644 --- a/packages/flutter/test/widgets/text_selection_test.dart +++ b/packages/flutter/test/widgets/text_selection_test.dart @@ -215,10 +215,8 @@ void main() { await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); await gesture.up(); await tester.pumpAndSettle(); @@ -235,10 +233,8 @@ void main() { ); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); await gesture.up(); await tester.pump(const Duration(milliseconds: 20)); @@ -255,10 +251,8 @@ void main() { ); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); await gesture.up(); await tester.pump(const Duration(milliseconds: 20)); @@ -275,10 +269,8 @@ void main() { ); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); await gesture.up(); @@ -305,10 +297,8 @@ void main() { await gesture.updateWithCustomEvent( PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.0, pressureMin: 0, - pressureMax: 1, ), ); await tester.pump(const Duration(milliseconds: 50)); @@ -327,10 +317,8 @@ void main() { ); await gesture.updateWithCustomEvent(PointerMoveEvent( pointer: pointerValue, - position: Offset.zero, pressure: 0.5, pressureMin: 0, - pressureMax: 1, )); expect(forcePressStartCount, 1); @@ -349,7 +337,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: pointerValue, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await tester.pump(const Duration(seconds: 2)); @@ -387,7 +374,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: pointerValue, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await tester.pump(); @@ -452,7 +438,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: 0, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await tester.pump(const Duration(seconds: 2)); @@ -513,7 +498,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: 0, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await gesture.up(); @@ -530,7 +514,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: 0, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await tester.pump(const Duration(milliseconds: 50)); @@ -553,7 +536,6 @@ void main() { await gesture.downWithCustomEvent( const Offset(200.0, 200.0), const PointerDownEvent( - pointer: 0, position: Offset(200.0, 200.0), pressure: 3.0, pressureMax: 6.0, @@ -562,9 +544,7 @@ void main() { ); await gesture.updateWithCustomEvent( const PointerUpEvent( - pointer: 0, position: Offset(200.0, 200.0), - pressure: 0.0, pressureMax: 6.0, pressureMin: 0.0, ), @@ -645,7 +625,6 @@ void main() { final TestGesture gesture = await tester.startGesture( const Offset(200.0, 200.0), pointer: 0, - kind: PointerDeviceKind.touch, ); addTearDown(gesture.removePointer); await tester.pump(const Duration(seconds: 2)); @@ -682,7 +661,6 @@ void main() { await gesture.downWithCustomEvent( const Offset(200.0, 200.0), const PointerDownEvent( - pointer: 0, position: Offset(200.0, 200.0), pressure: 3.0, pressureMax: 6.0, diff --git a/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart b/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart index e01685358f..1fc67c761d 100644 --- a/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart +++ b/packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart @@ -14,7 +14,7 @@ void main() { await tester.pumpWidget( MediaQuery( - data: const MediaQueryData(devicePixelRatio: 1.0), + data: const MediaQueryData(), child: Directionality( textDirection: TextDirection.ltr, child: StatefulBuilder( diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart index 0acef5ffd7..cd7d011f0b 100644 --- a/packages/flutter/test/widgets/text_test.dart +++ b/packages/flutter/test/widgets/text_test.dart @@ -1045,7 +1045,7 @@ void main() { ), ], ))); - }, semanticsEnabled: true, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 testWidgets('WidgetSpans with no semantic information are elided from semantics - case 2', (WidgetTester tester) async { @@ -1091,7 +1091,7 @@ void main() { ignoreRect: true, ignoreTransform: true, )); - }, semanticsEnabled: true, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 testWidgets('WidgetSpans with no semantic information are elided from semantics - case 3', (WidgetTester tester) async { @@ -1149,7 +1149,7 @@ void main() { ignoreRect: true, ignoreTransform: true, )); - }, semanticsEnabled: true, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 // Regression test for https://github.com/flutter/flutter/issues/69787 testWidgets('WidgetSpans with no semantic information are elided from semantics - case 4', (WidgetTester tester) async { @@ -1215,7 +1215,7 @@ void main() { ignoreRect: true, ignoreTransform: true, )); - }, semanticsEnabled: true, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 + }, skip: isBrowser); // https://github.com/flutter/flutter/issues/87877 testWidgets('RenderParagraph intrinsic width', (WidgetTester tester) async { await tester.pumpWidget( diff --git a/packages/flutter/test/widgets/texture_test.dart b/packages/flutter/test/widgets/texture_test.dart index cf654a67c8..4a5b1b774a 100644 --- a/packages/flutter/test/widgets/texture_test.dart +++ b/packages/flutter/test/widgets/texture_test.dart @@ -94,7 +94,7 @@ void main() { testWidgets('Texture with FilterQuality.low', (WidgetTester tester) async { await tester.pumpWidget( - const Center(child: Texture(textureId: 1, filterQuality: FilterQuality.low)), + const Center(child: Texture(textureId: 1)), ); final Texture texture = tester.firstWidget(find.byType(Texture)); diff --git a/packages/flutter/test/widgets/transitions_test.dart b/packages/flutter/test/widgets/transitions_test.dart index f27ac4804c..a419517728 100644 --- a/packages/flutter/test/widgets/transitions_test.dart +++ b/packages/flutter/test/widgets/transitions_test.dart @@ -23,12 +23,9 @@ void main() { begin: BoxDecoration( color: const Color(0xFFFFFFFF), border: Border.all( - color: const Color(0xFF000000), - style: BorderStyle.solid, width: 4.0, ), borderRadius: BorderRadius.zero, - shape: BoxShape.rectangle, boxShadow: const [BoxShadow( color: Color(0x66000000), blurRadius: 10.0, @@ -39,11 +36,8 @@ void main() { color: const Color(0xFF000000), border: Border.all( color: const Color(0xFF202020), - style: BorderStyle.solid, - width: 1.0, ), borderRadius: const BorderRadius.all(Radius.circular(10.0)), - shape: BoxShape.rectangle, // No shadow. ), ); @@ -249,7 +243,6 @@ void main() { final Widget widget = Directionality( textDirection: TextDirection.ltr, child: SizeTransition( - axis: Axis.vertical, sizeFactor: animation, child: const Text('Ready'), ), diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart index 7f8da4afc9..342481961a 100644 --- a/packages/flutter/test/widgets/visibility_test.dart +++ b/packages/flutter/test/widgets/visibility_test.dart @@ -125,7 +125,6 @@ void main() { child: Visibility( child: testChild, replacement: const Placeholder(), - visible: true, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -141,7 +140,6 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - visible: true, maintainState: true, maintainAnimation: true, maintainSize: true, @@ -254,7 +252,7 @@ void main() { ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a true', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); @@ -273,7 +271,7 @@ void main() { ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); @@ -288,7 +286,6 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - visible: true, maintainState: true, child: testChild, ), @@ -312,7 +309,7 @@ void main() { ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); @@ -325,7 +322,6 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - visible: true, maintainState: true, child: testChild, ), @@ -349,7 +345,7 @@ void main() { ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); - expect(find.byType(Text, skipOffstage: true), findsNothing); + expect(find.byType(Text), findsNothing); expect(find.text('a false', skipOffstage: false), findsOneWidget); expect(find.byType(Placeholder), findsNothing); expect(find.byType(Visibility), paintsNothing); @@ -380,7 +376,6 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - visible: true, child: testChild, ), )); @@ -413,7 +408,6 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - visible: true, child: testChild, ), )); diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart index 2f08f20456..47a6ef8b13 100644 --- a/packages/flutter/test/widgets/widget_inspector_test.dart +++ b/packages/flutter/test/widgets/widget_inspector_test.dart @@ -498,7 +498,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { child: Overlay( initialEntries: [ OverlayEntry( - opaque: false, maintainState: true, builder: (BuildContext _) => createSubtree(width: 94.0), ), @@ -508,7 +507,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { builder: (BuildContext _) => createSubtree(width: 95.0), ), OverlayEntry( - opaque: false, maintainState: true, builder: (BuildContext _) => createSubtree(width: 96.0, key: clickTarget), ), @@ -817,9 +815,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { elementA.toDiagnosticsNode().toJsonMap( InspectorSerializationDelegate( service: service, - summaryTree: false, includeProperties: true, - addAdditionalPropertiesCallback: null, ), ), isNotNull, @@ -2931,7 +2927,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { final InspectorSerializationDelegate delegate = InspectorSerializationDelegate( service: service, - summaryTree: false, includeProperties: true, addAdditionalPropertiesCallback: (DiagnosticsNode node, InspectorSerializationDelegate delegate) { @@ -2960,7 +2955,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { final InspectorSerializationDelegate emptyDelegate = InspectorSerializationDelegate( service: service, - summaryTree: false, includeProperties: true, addAdditionalPropertiesCallback: (DiagnosticsNode node, InspectorSerializationDelegate delegate) { @@ -2970,9 +2964,7 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService { final InspectorSerializationDelegate defaultDelegate = InspectorSerializationDelegate( service: service, - summaryTree: false, includeProperties: true, - addAdditionalPropertiesCallback: null, ); expect(node.toJsonMap(emptyDelegate), node.toJsonMap(defaultDelegate)); }); diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart index 8d096aee18..1d32f6cf46 100644 --- a/packages/flutter/test/widgets/wrap_test.dart +++ b/packages/flutter/test/widgets/wrap_test.dart @@ -19,7 +19,6 @@ void main() { testWidgets('Basic Wrap test (LTR)', (WidgetTester tester) async { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, textDirection: TextDirection.ltr, children: const [ SizedBox(width: 300.0, height: 100.0), @@ -76,8 +75,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, children: const [ SizedBox(width: 300.0, height: 50.0), @@ -96,7 +93,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.center, textDirection: TextDirection.ltr, children: const [ @@ -116,7 +112,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, children: const [ @@ -139,7 +134,6 @@ void main() { testWidgets('Basic Wrap test (RTL)', (WidgetTester tester) async { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, textDirection: TextDirection.rtl, children: const [ SizedBox(width: 300.0, height: 100.0), @@ -196,8 +190,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, children: const [ @@ -217,7 +209,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.center, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, @@ -238,7 +229,6 @@ void main() { await tester.pumpWidget( Wrap( - alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, @@ -638,8 +628,6 @@ void main() { alignment: Alignment.topLeft, child: Wrap( runSpacing: 10.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, children: const [ SizedBox(width: 500.0, height: 10.0), @@ -667,8 +655,6 @@ void main() { direction: Axis.vertical, spacing: 10.0, runSpacing: 15.0, - alignment: WrapAlignment.start, - crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, children: const [ SizedBox(width: 10.0, height: 250.0), @@ -695,7 +681,6 @@ void main() { Align( alignment: Alignment.topLeft, child: Wrap( - direction: Axis.horizontal, spacing: 12.0, runSpacing: 8.0, textDirection: TextDirection.ltr, @@ -834,7 +819,6 @@ void main() { testWidgets('Spacing with slight overflow', (WidgetTester tester) async { await tester.pumpWidget(Wrap( - direction: Axis.horizontal, textDirection: TextDirection.ltr, spacing: 10.0, runSpacing: 10.0, @@ -860,7 +844,6 @@ void main() { Column( children: [ Wrap( - direction: Axis.horizontal, textDirection: TextDirection.ltr, spacing: 10.0, runSpacing: 10.0, @@ -879,7 +862,6 @@ void main() { Column( children: [ Wrap( - direction: Axis.horizontal, textDirection: TextDirection.ltr, spacing: 10.0, runSpacing: 10.0, diff --git a/packages/flutter_driver/lib/src/common/handler_factory.dart b/packages/flutter_driver/lib/src/common/handler_factory.dart index 41ccd3a0d7..ef822791e6 100644 --- a/packages/flutter_driver/lib/src/common/handler_factory.dart +++ b/packages/flutter_driver/lib/src/common/handler_factory.dart @@ -367,7 +367,7 @@ mixin CommandHandlerFactory { final Duration pause = scrollCommand.duration ~/ totalMoves; final Offset startLocation = _prober.getCenter(target); Offset currentLocation = startLocation; - final TestPointer pointer = TestPointer(1); + final TestPointer pointer = TestPointer(); _prober.binding.handlePointerEvent(pointer.down(startLocation)); await Future.value(); // so that down and move don't happen in the same microtask for (int moves = 0; moves < totalMoves; moves += 1) { diff --git a/packages/flutter_driver/lib/src/driver/vmservice_driver.dart b/packages/flutter_driver/lib/src/driver/vmservice_driver.dart index cbe460441f..a11bfd4b81 100644 --- a/packages/flutter_driver/lib/src/driver/vmservice_driver.dart +++ b/packages/flutter_driver/lib/src/driver/vmservice_driver.dart @@ -556,7 +556,6 @@ Future _waitAndConnect(String url, Map? headers) final vms.VmService service = vms.VmService( controller.stream, socket.add, - log: null, disposeHandler: () => socket!.close(), streamClosed: streamClosedCompleter.future ); diff --git a/packages/flutter_driver/test/src/real_tests/extension_test.dart b/packages/flutter_driver/test/src/real_tests/extension_test.dart index b3d7a83bb4..d613ead1f7 100644 --- a/packages/flutter_driver/test/src/real_tests/extension_test.dart +++ b/packages/flutter_driver/test/src/real_tests/extension_test.dart @@ -848,7 +848,7 @@ void main() { ); // Widget - Map result = await getDiagnosticsTree(DiagnosticsType.widget, ByValueKey('Text'), depth: 0); + Map result = await getDiagnosticsTree(DiagnosticsType.widget, ByValueKey('Text')); expect(result['children'], isNull); // depth: 0 expect(result['widgetRuntimeType'], 'Text'); @@ -857,7 +857,7 @@ void main() { expect(stringProperty['description'], '"Hello World"'); expect(stringProperty['propertyType'], 'String'); - result = await getDiagnosticsTree(DiagnosticsType.widget, ByValueKey('Text'), depth: 0, properties: false); + result = await getDiagnosticsTree(DiagnosticsType.widget, ByValueKey('Text'), properties: false); expect(result['widgetRuntimeType'], 'Text'); expect(result['properties'], isNull); // properties: false @@ -870,12 +870,12 @@ void main() { expect(children.single['children'], isEmpty); // RenderObject - result = await getDiagnosticsTree(DiagnosticsType.renderObject, ByValueKey('Text'), depth: 0); + result = await getDiagnosticsTree(DiagnosticsType.renderObject, ByValueKey('Text')); expect(result['children'], isNull); // depth: 0 expect(result['properties'], isNotNull); expect(result['description'], startsWith('RenderParagraph')); - result = await getDiagnosticsTree(DiagnosticsType.renderObject, ByValueKey('Text'), depth: 0, properties: false); + result = await getDiagnosticsTree(DiagnosticsType.renderObject, ByValueKey('Text'), properties: false); expect(result['properties'], isNull); // properties: false expect(result['description'], startsWith('RenderParagraph')); diff --git a/packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart b/packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart index 5403899864..ff7661ebce 100644 --- a/packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart +++ b/packages/flutter_driver/test/src/real_tests/flutter_driver_test.dart @@ -82,7 +82,7 @@ void main() { }); test('logFilePathName was set when a new driver was created', () { - driver = VMServiceFlutterDriver.connectedTo(fakeClient, fakeIsolate, logCommunicationToFile: true); + driver = VMServiceFlutterDriver.connectedTo(fakeClient, fakeIsolate); logFile = File(driver.logFilePathName); expect(logFile.path, endsWith('.log')); }); @@ -113,7 +113,7 @@ void main() { }); test('printCommunication = false', () async { - driver = VMServiceFlutterDriver.connectedTo(fakeClient, fakeIsolate, printCommunication: false); + driver = VMServiceFlutterDriver.connectedTo(fakeClient, fakeIsolate); await driver.waitFor(find.byTooltip('foo'), timeout: _kTestTimeout); expect(log, []); }); @@ -783,7 +783,7 @@ void main() { }); test('printCommunication = false', () async { - driver = WebFlutterDriver.connectedTo(fakeConnection, printCommunication: false); + driver = WebFlutterDriver.connectedTo(fakeConnection); await driver.waitFor(find.byTooltip('printCommunication test'), timeout: _kTestTimeout); expect(log, []); }); diff --git a/packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart b/packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart index ad645c222f..b7456cf8ad 100644 --- a/packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart +++ b/packages/flutter_driver/test/src/real_tests/timeline_summary_test.dart @@ -502,7 +502,6 @@ void main() { ]).writeTimelineToFile( 'test', destinationDirectory: tempDir.path, - includeSummary: true, ); final String written = await fs.file(path.join(tempDir.path, 'test.timeline.json')).readAsString(); diff --git a/packages/flutter_localizations/test/cupertino/translations_test.dart b/packages/flutter_localizations/test/cupertino/translations_test.dart index b2004f60d5..73d8ec3770 100644 --- a/packages/flutter_localizations/test/cupertino/translations_test.dart +++ b/packages/flutter_localizations/test/cupertino/translations_test.dart @@ -144,7 +144,7 @@ void main() { if (noCupertinoArbFile.existsSync() && !nbCupertinoArbFile.existsSync()) { - Locale locale = const Locale.fromSubtags(languageCode: 'no', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'no'); expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); CupertinoLocalizations localizations = await GlobalCupertinoLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -153,7 +153,7 @@ void main() { final String copyButtonLabelNo = localizations.copyButtonLabel; final String cutButtonLabelNo = localizations.cutButtonLabel; - locale = const Locale.fromSubtags(languageCode: 'nb', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'nb'); expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalCupertinoLocalizations.delegate.load(locale); expect(localizations, isA()); diff --git a/packages/flutter_localizations/test/material/date_picker_test.dart b/packages/flutter_localizations/test/material/date_picker_test.dart index adfbdbbeae..5872eba389 100644 --- a/packages/flutter_localizations/test/material/date_picker_test.dart +++ b/packages/flutter_localizations/test/material/date_picker_test.dart @@ -13,7 +13,7 @@ void main() { late DateTime initialDate; setUp(() { - firstDate = DateTime(2001, DateTime.january, 1); + firstDate = DateTime(2001, DateTime.january); lastDate = DateTime(2031, DateTime.december, 31); initialDate = DateTime(2016, DateTime.january, 15); }); @@ -140,9 +140,6 @@ void main() { testWidgets('textDirection parameter overrides ambient textDirection', (WidgetTester tester) async { await tester.pumpWidget(MaterialApp( locale: const Locale('en', 'US'), - supportedLocales: const [ - Locale('en', 'US'), - ], home: Material( child: Builder( builder: (BuildContext context) { diff --git a/packages/flutter_localizations/test/material/date_time_test.dart b/packages/flutter_localizations/test/material/date_time_test.dart index 39f56f4e38..0c5c9dc2e8 100644 --- a/packages/flutter_localizations/test/material/date_time_test.dart +++ b/packages/flutter_localizations/test/material/date_time_test.dart @@ -144,7 +144,7 @@ void main() { } testWidgets('formats dates in English', (WidgetTester tester) async { - final Map formatted = await formatDate(tester, const Locale('en'), DateTime(2018, 8, 1)); + final Map formatted = await formatDate(tester, const Locale('en'), DateTime(2018, 8)); expect(formatted[DateType.year], '2018'); expect(formatted[DateType.medium], 'Wed, Aug 1'); expect(formatted[DateType.full], 'Wednesday, August 1, 2018'); @@ -152,7 +152,7 @@ void main() { }); testWidgets('formats dates in German', (WidgetTester tester) async { - final Map formatted = await formatDate(tester, const Locale('de'), DateTime(2018, 8, 1)); + final Map formatted = await formatDate(tester, const Locale('de'), DateTime(2018, 8)); expect(formatted[DateType.year], '2018'); expect(formatted[DateType.medium], 'Mi., 1. Aug.'); expect(formatted[DateType.full], 'Mittwoch, 1. August 2018'); @@ -160,7 +160,7 @@ void main() { }); testWidgets('formats dates in Serbian', (WidgetTester tester) async { - final Map formatted = await formatDate(tester, const Locale('sr'), DateTime(2018, 8, 1)); + final Map formatted = await formatDate(tester, const Locale('sr'), DateTime(2018, 8)); expect(formatted[DateType.year], '2018.'); expect(formatted[DateType.medium], 'сре 1. авг'); expect(formatted[DateType.full], 'среда, 1. август 2018.'); @@ -169,7 +169,7 @@ void main() { testWidgets('formats dates in Serbian (Latin)', (WidgetTester tester) async { final Map formatted = await formatDate(tester, - const Locale.fromSubtags(languageCode:'sr', scriptCode: 'Latn'), DateTime(2018, 8, 1)); + const Locale.fromSubtags(languageCode:'sr', scriptCode: 'Latn'), DateTime(2018, 8)); expect(formatted[DateType.year], '2018.'); expect(formatted[DateType.medium], 'sre 1. avg'); expect(formatted[DateType.full], 'sreda, 1. avgust 2018.'); @@ -183,9 +183,6 @@ void main() { late DateFormat dateFormat; await tester.pumpWidget(MaterialApp( - supportedLocales: const [ - Locale('en', 'US'), - ], locale: const Locale('en', 'US'), localizationsDelegates: const >[ GlobalMaterialLocalizations.delegate, diff --git a/packages/flutter_localizations/test/material/tabs_test.dart b/packages/flutter_localizations/test/material/tabs_test.dart index 25c739cab6..e4e16647f3 100644 --- a/packages/flutter_localizations/test/material/tabs_test.dart +++ b/packages/flutter_localizations/test/material/tabs_test.dart @@ -14,7 +14,6 @@ void main() { final TabController controller = TabController( vsync: const TestVSync(), length: 2, - initialIndex: 0, ); await tester.pumpWidget( diff --git a/packages/flutter_localizations/test/material/translations_test.dart b/packages/flutter_localizations/test/material/translations_test.dart index c31792e972..38583e8245 100644 --- a/packages/flutter_localizations/test/material/translations_test.dart +++ b/packages/flutter_localizations/test/material/translations_test.dart @@ -88,10 +88,10 @@ void main() { expect(localizations.formatHour(const TimeOfDay(hour: 10, minute: 0)), isNotNull); expect(localizations.formatMinute(const TimeOfDay(hour: 10, minute: 0)), isNotNull); - expect(localizations.formatYear(DateTime(2018, 8, 1)), isNotNull); - expect(localizations.formatMediumDate(DateTime(2018, 8, 1)), isNotNull); - expect(localizations.formatFullDate(DateTime(2018, 8, 1)), isNotNull); - expect(localizations.formatMonthYear(DateTime(2018, 8, 1)), isNotNull); + expect(localizations.formatYear(DateTime(2018, 8)), isNotNull); + expect(localizations.formatMediumDate(DateTime(2018, 8)), isNotNull); + expect(localizations.formatFullDate(DateTime(2018, 8)), isNotNull); + expect(localizations.formatMonthYear(DateTime(2018, 8)), isNotNull); expect(localizations.narrowWeekdays, isNotNull); expect(localizations.narrowWeekdays.length, 7); expect(localizations.formatDecimal(123), isNotNull); @@ -100,14 +100,14 @@ void main() { } testWidgets('translations spot check', (WidgetTester tester) async { - Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); expect(localizations.firstPageTooltip, '第一页'); expect(localizations.lastPageTooltip, '最后一页'); - locale = const Locale.fromSubtags(languageCode: 'zu', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zu'); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); expect(localizations.firstPageTooltip, 'Ikhasi lokuqala'); @@ -181,7 +181,7 @@ void main() { }); testWidgets('Chinese resolution', (WidgetTester tester) async { - Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -191,22 +191,22 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'HK'); + locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'HK'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'TW'); + locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -236,7 +236,7 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'US'); + locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -251,7 +251,7 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'TW'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'TW'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -261,34 +261,34 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'RU'); + locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'RU'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); }); testWidgets('Serbian resolution', (WidgetTester tester) async { - Locale locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'sr'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: 'SR'); + locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'SR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -313,49 +313,49 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: 'US'); + locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); }); testWidgets('Misc resolution', (WidgetTester tester) async { - Locale locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'en'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Cyrl', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Cyrl'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'US'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'AU'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'AU'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'GB'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'GB'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'SG'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'SG'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'MX'); + locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'MX'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -370,37 +370,37 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'es'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: '419'); + locale = const Locale.fromSubtags(languageCode: 'es', countryCode: '419'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'MX'); + locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'MX'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'US'); + locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'US'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'AR'); + locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'AR'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'ES'); + locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'ES'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -410,39 +410,39 @@ void main() { localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'fr', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'fr'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'fr', scriptCode: null, countryCode: 'CA'); + locale = const Locale.fromSubtags(languageCode: 'fr', countryCode: 'CA'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'de', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'de'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'de', scriptCode: null, countryCode: 'CH'); + locale = const Locale.fromSubtags(languageCode: 'de', countryCode: 'CH'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'th', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'th'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); - locale = const Locale.fromSubtags(languageCode: 'ru', scriptCode: null, countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'ru'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); }); testWidgets('Chinese translations spot check', (WidgetTester tester) async { - Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null); + Locale locale = const Locale.fromSubtags(languageCode: 'zh'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -451,7 +451,7 @@ void main() { expect(localizations.closeButtonLabel, '关闭'); expect(localizations.okButtonLabel, '确定'); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); @@ -460,7 +460,7 @@ void main() { expect(localizations.closeButtonLabel, '关闭'); expect(localizations.okButtonLabel, '确定'); - locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: null); + locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant'); expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue); localizations = await GlobalMaterialLocalizations.delegate.load(locale); expect(localizations, isA()); diff --git a/packages/flutter_localizations/test/override_test.dart b/packages/flutter_localizations/test/override_test.dart index 2600fec78e..f977bb111b 100644 --- a/packages/flutter_localizations/test/override_test.dart +++ b/packages/flutter_localizations/test/override_test.dart @@ -241,7 +241,7 @@ void main() { await tester.pumpWidget( buildFrame( delegates: [ - const FooMaterialLocalizationsDelegate(supportedLanguage: 'en'), + const FooMaterialLocalizationsDelegate(), ], // supportedLocales not specified, so all locales resolve to 'en' buildContent: (BuildContext context) { diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index 13e0db7976..0283f59d3e 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -1173,7 +1173,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { final FakeAsync fakeAsync = FakeAsync(); _currentFakeAsync = fakeAsync; // reset in postTest - _clock = fakeAsync.getClock(DateTime.utc(2015, 1, 1)); + _clock = fakeAsync.getClock(DateTime.utc(2015)); late Future testBodyResult; fakeAsync.run((FakeAsync localFakeAsync) { assert(fakeAsync == _currentFakeAsync); diff --git a/packages/flutter_test/lib/src/controller.dart b/packages/flutter_test/lib/src/controller.dart index a6466a3358..cb20e2992d 100644 --- a/packages/flutter_test/lib/src/controller.dart +++ b/packages/flutter_test/lib/src/controller.dart @@ -705,11 +705,9 @@ abstract class WidgetController { final List records = [ PointerEventRecord(Duration.zero, [ PointerAddedEvent( - timeStamp: Duration.zero, position: startLocation, ), PointerDownEvent( - timeStamp: Duration.zero, position: startLocation, pointer: pointer, buttons: buttons, diff --git a/packages/flutter_test/lib/src/event_simulation.dart b/packages/flutter_test/lib/src/event_simulation.dart index bf865961ff..f1667558af 100644 --- a/packages/flutter_test/lib/src/event_simulation.dart +++ b/packages/flutter_test/lib/src/event_simulation.dart @@ -757,7 +757,7 @@ class KeyEventSimulator { Future _simulateByRawEvent() { return _simulateKeyEventByRawEvent(() { platform ??= _defaultPlatform; - return getKeyData(key, platform: platform!, isDown: true, physicalKey: physicalKey, character: character); + return getKeyData(key, platform: platform!, physicalKey: physicalKey, character: character); }); } switch (_transitMode) { @@ -848,7 +848,7 @@ class KeyEventSimulator { Future _simulateByRawEvent() { return _simulateKeyEventByRawEvent(() { platform ??= _defaultPlatform; - return getKeyData(key, platform: platform!, isDown: true, physicalKey: physicalKey, character: character); + return getKeyData(key, platform: platform!, physicalKey: physicalKey, character: character); }); } switch (_transitMode) { diff --git a/packages/flutter_test/lib/src/image.dart b/packages/flutter_test/lib/src/image.dart index 7df2e392ce..55ca49295a 100644 --- a/packages/flutter_test/lib/src/image.dart +++ b/packages/flutter_test/lib/src/image.dart @@ -50,7 +50,7 @@ Future createTestImage({ Future _createImage(int width, int height) async { final Completer completer = Completer(); ui.decodeImageFromPixels( - Uint8List.fromList(List.filled(width * height * 4, 0, growable: false)), + Uint8List.fromList(List.filled(width * height * 4, 0)), width, height, ui.PixelFormat.rgba8888, diff --git a/packages/flutter_test/lib/src/test_default_binary_messenger.dart b/packages/flutter_test/lib/src/test_default_binary_messenger.dart index d0e18ac5a6..ba227d6e40 100644 --- a/packages/flutter_test/lib/src/test_default_binary_messenger.dart +++ b/packages/flutter_test/lib/src/test_default_binary_messenger.dart @@ -86,7 +86,7 @@ class TestDefaultBinaryMessenger extends BinaryMessenger { Future? result; if (_inboundHandlers.containsKey(channel)) result = _inboundHandlers[channel]!(data); - result ??= Future.value(null); + result ??= Future.value(); if (callback != null) result = result.then((ByteData? result) { callback(result); return result; }); return result; @@ -281,7 +281,7 @@ class TestDefaultBinaryMessenger extends BinaryMessenger { } on MissingPluginException { return null; } catch (error) { - return channel.codec.encodeErrorEnvelope(code: 'error', message: '$error', details: null); + return channel.codec.encodeErrorEnvelope(code: 'error', message: '$error'); } }, handler); } diff --git a/packages/flutter_test/test/controller_test.dart b/packages/flutter_test/test/controller_test.dart index 25f33e6776..3513e9b426 100644 --- a/packages/flutter_test/test/controller_test.dart +++ b/packages/flutter_test/test/controller_test.dart @@ -94,7 +94,7 @@ void main() { expect(semantics.label, 'hello'); expect(semantics.hasAction(SemanticsAction.tap), true); expect(semantics.hasFlag(SemanticsFlag.isButton), true); - }, semanticsEnabled: true); + }); testWidgets('Returns merged SemanticsData', (WidgetTester tester) async { final SemanticsHandle semanticsHandle = tester.ensureSemantics(); @@ -663,12 +663,12 @@ void main() { ); // Make sure widget isn't on screen - expect(find.text('Item 15', skipOffstage: true), findsNothing); + expect(find.text('Item 15'), findsNothing); await tester.ensureVisible(find.text('Item 15', skipOffstage: false)); await tester.pumpAndSettle(); - expect(find.text('Item 15', skipOffstage: true), findsOneWidget); + expect(find.text('Item 15'), findsOneWidget); }, ); @@ -698,7 +698,7 @@ void main() { await tester.pumpAndSettle(); // Now the widget is on screen. - expect(find.text('Item 45', skipOffstage: true), findsOneWidget); + expect(find.text('Item 45'), findsOneWidget); }, ); @@ -729,7 +729,7 @@ void main() { await tester.pumpAndSettle(); // Now the widget is on screen. - expect(find.text('Item 45', skipOffstage: true), findsOneWidget); + expect(find.text('Item 45'), findsOneWidget); }, ); @@ -799,7 +799,7 @@ void main() { await tester.pumpAndSettle(); // Now the widget is on screen. - expect(find.text('Item b-45', skipOffstage: true), findsOneWidget); + expect(find.text('Item b-45'), findsOneWidget); }); }); } diff --git a/packages/flutter_test/test/finders_test.dart b/packages/flutter_test/test/finders_test.dart index fc8923b6ed..1c4342b3d1 100644 --- a/packages/flutter_test/test/finders_test.dart +++ b/packages/flutter_test/test/finders_test.dart @@ -12,16 +12,16 @@ void main() { group('image', () { testWidgets('finds Image widgets', (WidgetTester tester) async { await tester.pumpWidget(_boilerplate( - Image(image: FileImage(File('test'), scale: 1.0)) + Image(image: FileImage(File('test'))) )); - expect(find.image(FileImage(File('test'), scale: 1.0)), findsOneWidget); + expect(find.image(FileImage(File('test'))), findsOneWidget); }); testWidgets('finds Button widgets with Image', (WidgetTester tester) async { await tester.pumpWidget(_boilerplate( - ElevatedButton(onPressed: null, child: Image(image: FileImage(File('test'), scale: 1.0)),) + ElevatedButton(onPressed: null, child: Image(image: FileImage(File('test'))),) )); - expect(find.widgetWithImage(ElevatedButton, FileImage(File('test'), scale: 1.0)), findsOneWidget); + expect(find.widgetWithImage(ElevatedButton, FileImage(File('test'))), findsOneWidget); }); }); @@ -79,7 +79,7 @@ void main() { ), ))); - expect(find.text('test', findRichText: false), findsNothing); + expect(find.text('test'), findsNothing); }); testWidgets( @@ -120,7 +120,7 @@ void main() { ), ))); - expect(find.text('test3', findRichText: false), findsOneWidget); + expect(find.text('test3'), findsOneWidget); }); }); }); @@ -234,7 +234,7 @@ void main() { )), ); expect(find.byType(GestureDetector), findsNWidgets(2)); - final Finder hitTestable = find.byType(GestureDetector).hitTestable(at: Alignment.center); + final Finder hitTestable = find.byType(GestureDetector).hitTestable(); expect(hitTestable, findsOneWidget); expect(tester.widget(hitTestable).key, const ValueKey(0)); }); diff --git a/packages/flutter_test/test/goldens_test.dart b/packages/flutter_test/test/goldens_test.dart index 74f2f947e4..6082843534 100644 --- a/packages/flutter_test/test/goldens_test.dart +++ b/packages/flutter_test/test/goldens_test.dart @@ -162,7 +162,7 @@ void main() { ..writeAsBytesSync(_kExpectedPngBytes); fs.currentDirectory = fix('/foo/bar'); comparator = LocalFileComparator(Uri.parse('local_test.dart'), pathStyle: fs.path.style); - final bool success = await doComparison('golden.png'); + final bool success = await doComparison(); expect(success, isTrue); }); diff --git a/packages/flutter_test/test/live_widget_controller_test.dart b/packages/flutter_test/test/live_widget_controller_test.dart index 96908277c8..00fdd76c48 100644 --- a/packages/flutter_test/test/live_widget_controller_test.dart +++ b/packages/flutter_test/test/live_widget_controller_test.dart @@ -111,11 +111,9 @@ void main() { // Typically PointerAddedEvent is not used in testers, but for records // captured on a device it is usually what start a gesture. PointerAddedEvent( - timeStamp: Duration.zero, position: location, ), PointerDownEvent( - timeStamp: Duration.zero, position: location, buttons: kSecondaryMouseButton, pointer: 1, diff --git a/packages/flutter_test/test/widget_tester_live_device_test.dart b/packages/flutter_test/test/widget_tester_live_device_test.dart index 34db4e36b0..070fbcf9e6 100644 --- a/packages/flutter_test/test/widget_tester_live_device_test.dart +++ b/packages/flutter_test/test/widget_tester_live_device_test.dart @@ -127,7 +127,7 @@ class _MockLiveTestWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding { // See the documentation of [handlePointerEventForSource] for details. if (source == TestBindingEventSource.test) { final PointerEvent globalEvent = event.copyWith(position: localToGlobal(event.position)); - return super.handlePointerEventForSource(globalEvent, source: TestBindingEventSource.device); + return super.handlePointerEventForSource(globalEvent); } return super.handlePointerEventForSource(event, source: source); } diff --git a/packages/flutter_test/test/widget_tester_test.dart b/packages/flutter_test/test/widget_tester_test.dart index ceeeace9b9..ae3b2820d5 100644 --- a/packages/flutter_test/test/widget_tester_test.dart +++ b/packages/flutter_test/test/widget_tester_test.dart @@ -508,11 +508,9 @@ void main() { // Typically PointerAddedEvent is not used in testers, but for records // captured on a device it is usually what start a gesture. PointerAddedEvent( - timeStamp: Duration.zero, position: location, ), PointerDownEvent( - timeStamp: Duration.zero, position: location, buttons: kSecondaryMouseButton, pointer: 1, diff --git a/packages/flutter_tools/bin/fuchsia_attach.dart b/packages/flutter_tools/bin/fuchsia_attach.dart index b4e3b5590c..1000c5e805 100644 --- a/packages/flutter_tools/bin/fuchsia_attach.dart +++ b/packages/flutter_tools/bin/fuchsia_attach.dart @@ -108,8 +108,6 @@ Future main(List args) async { _FuchsiaDoctorCommand(), // If attach fails the tool will attempt to run doctor. ], verbose: verbose, - muteCommandLogging: false, - verboseHelp: false, overrides: { FeatureFlags: () => const _FuchsiaFeatureFlags(), DeviceManager: () => _FuchsiaDeviceManager(), diff --git a/packages/flutter_tools/bin/fuchsia_tester.dart b/packages/flutter_tools/bin/fuchsia_tester.dart index 305aab2f91..072f930545 100644 --- a/packages/flutter_tools/bin/fuchsia_tester.dart +++ b/packages/flutter_tools/bin/fuchsia_tester.dart @@ -151,7 +151,6 @@ Future run(List args) async { ), ), watcher: collector, - ipv6: false, enableObservatory: collector != null, precompiledDillFiles: tests, concurrency: math.max(1, globals.platform.numberOfProcessors - 2), diff --git a/packages/flutter_tools/lib/runner.dart b/packages/flutter_tools/lib/runner.dart index 4d3da3ada8..965f2f7d63 100644 --- a/packages/flutter_tools/lib/runner.dart +++ b/packages/flutter_tools/lib/runner.dart @@ -229,7 +229,7 @@ Future _doctorText() async { ); final Doctor doctor = Doctor(logger: logger); - await doctor.diagnose(verbose: true, showColor: false); + await doctor.diagnose(showColor: false); return logger.statusText; } on Exception catch (error, trace) { diff --git a/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart b/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart index 9299ba1223..6396943948 100644 --- a/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart +++ b/packages/flutter_tools/lib/src/android/deferred_components_gen_snapshot_validator.dart @@ -279,7 +279,6 @@ class DeferredComponentsGenSnapshotValidator extends DeferredComponentsValidator loadingUnits.add( LoadingUnit( id: loadingUnitDataMap!['id'] as int, - path: null, libraries: libraries, )); } diff --git a/packages/flutter_tools/lib/src/base/config.dart b/packages/flutter_tools/lib/src/base/config.dart index 57d6455756..b14f9abf29 100644 --- a/packages/flutter_tools/lib/src/base/config.dart +++ b/packages/flutter_tools/lib/src/base/config.dart @@ -38,8 +38,7 @@ class Config { name, fileSystem: fileSystem, logger: logger, - platform: platform, - managed: false + platform: platform ); } diff --git a/packages/flutter_tools/lib/src/base/error_handling_io.dart b/packages/flutter_tools/lib/src/base/error_handling_io.dart index 3678e45fe2..4675a889e6 100644 --- a/packages/flutter_tools/lib/src/base/error_handling_io.dart +++ b/packages/flutter_tools/lib/src/base/error_handling_io.dart @@ -312,7 +312,7 @@ class ErrorHandlingFile // First check if the source file can be read. If not, bail through error // handling. _runSync( - () => delegate.openSync(mode: FileMode.read).closeSync(), + () => delegate.openSync().closeSync(), platform: _platform, failureMessage: 'Flutter failed to copy $path to $newPath due to source location error', posixPermissionSuggestion: _posixPermissionSuggestion([path]), @@ -337,7 +337,7 @@ class ErrorHandlingFile RandomAccessFile? source; RandomAccessFile? sink; try { - source = delegate.openSync(mode: FileMode.read); + source = delegate.openSync(); sink = resultFile.openSync(mode: FileMode.writeOnly); // 64k is the same sized buffer used by dart:io for `File.openRead`. final Uint8List buffer = Uint8List(64 * 1024); diff --git a/packages/flutter_tools/lib/src/build_system/build_system.dart b/packages/flutter_tools/lib/src/build_system/build_system.dart index 7994a6e6bd..557f4f4a91 100644 --- a/packages/flutter_tools/lib/src/build_system/build_system.dart +++ b/packages/flutter_tools/lib/src/build_system/build_system.dart @@ -191,7 +191,7 @@ abstract class Target { /// Resolve the set of input patterns and functions into a concrete list of /// files. ResolvedFiles resolveInputs(Environment environment) { - return _resolveConfiguration(inputs, depfiles, environment, implicit: true, inputs: true); + return _resolveConfiguration(inputs, depfiles, environment); } /// Find the current set of declared outputs, including wildcard directories. @@ -236,8 +236,11 @@ abstract class Target { return environment.buildDir.childFile(fileName); } - static ResolvedFiles _resolveConfiguration(List config, - List depfiles, Environment environment, { bool implicit = true, bool inputs = true, + static ResolvedFiles _resolveConfiguration( + List config, + List depfiles, + Environment environment, { + bool inputs = true, }) { final SourceVisitor collector = SourceVisitor(environment, inputs); for (final Source source in config) { diff --git a/packages/flutter_tools/lib/src/build_system/file_store.dart b/packages/flutter_tools/lib/src/build_system/file_store.dart index 48d8ef8247..5045370a60 100644 --- a/packages/flutter_tools/lib/src/build_system/file_store.dart +++ b/packages/flutter_tools/lib/src/build_system/file_store.dart @@ -236,7 +236,7 @@ class FileStore { final Md5Hash hash = Md5Hash(); RandomAccessFile? openFile; try { - openFile = file.openSync(mode: FileMode.read); + openFile = file.openSync(); int bytes = 0; while (bytes < fileBytes) { final int bytesRead = openFile.readIntoSync(_readBuffer); diff --git a/packages/flutter_tools/lib/src/build_system/targets/android.dart b/packages/flutter_tools/lib/src/build_system/targets/android.dart index da264a832b..d17efc4e32 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/android.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/android.dart @@ -207,7 +207,6 @@ class AndroidAot extends AotElfBase { @override Future build(Environment environment) async { final AOTSnapshotter snapshotter = AOTSnapshotter( - reportTimings: false, fileSystem: environment.fileSystem, logger: environment.logger, xcode: globals.xcode, diff --git a/packages/flutter_tools/lib/src/build_system/targets/assets.dart b/packages/flutter_tools/lib/src/build_system/targets/assets.dart index 5a01c65059..68a4cd0257 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/assets.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/assets.dart @@ -50,7 +50,6 @@ Future copyAssets(Environment environment, Directory outputDirectory, { final int resultCode = await assetBundle.build( manifestPath: pubspecFile.path, packagesPath: environment.projectDir.childFile('.packages').path, - assetDirPath: null, deferredComponentsEnabled: environment.defines[kDeferredComponents] == 'true', targetPlatform: targetPlatform, ); diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index 590b3c50f8..f3b6dd5e63 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -154,7 +154,6 @@ class KernelSnapshot extends Target { processManager: environment.processManager, artifacts: environment.artifacts, fileSystemRoots: [], - fileSystemScheme: null, ); final String? buildModeEnvironment = environment.defines[kBuildMode]; if (buildModeEnvironment == null) { @@ -242,7 +241,6 @@ abstract class AotElfBase extends Target { @override Future build(Environment environment) async { final AOTSnapshotter snapshotter = AOTSnapshotter( - reportTimings: false, fileSystem: environment.fileSystem, logger: environment.logger, xcode: globals.xcode!, diff --git a/packages/flutter_tools/lib/src/build_system/targets/dart_plugin_registrant.dart b/packages/flutter_tools/lib/src/build_system/targets/dart_plugin_registrant.dart index d5f2fb0e86..c3054f6be6 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/dart_plugin_registrant.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/dart_plugin_registrant.dart @@ -51,7 +51,6 @@ class DartPluginRegistrantTarget extends Target { packageConfig, mainFileUriString, mainFile, - throwOnPluginPubspecError: false, ); } diff --git a/packages/flutter_tools/lib/src/build_system/targets/ios.dart b/packages/flutter_tools/lib/src/build_system/targets/ios.dart index a61609cb2b..94d53a0cf6 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/ios.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/ios.dart @@ -35,7 +35,6 @@ abstract class AotAssemblyBase extends Target { @override Future build(Environment environment) async { final AOTSnapshotter snapshotter = AOTSnapshotter( - reportTimings: false, fileSystem: environment.fileSystem, logger: environment.logger, xcode: globals.xcode, diff --git a/packages/flutter_tools/lib/src/build_system/targets/macos.dart b/packages/flutter_tools/lib/src/build_system/targets/macos.dart index 8e2ef25f9d..9672906db8 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/macos.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/macos.dart @@ -254,7 +254,6 @@ class CompileMacOSFramework extends Target { } final AOTSnapshotter snapshotter = AOTSnapshotter( - reportTimings: false, fileSystem: environment.fileSystem, logger: environment.logger, xcode: globals.xcode, diff --git a/packages/flutter_tools/lib/src/commands/build_appbundle.dart b/packages/flutter_tools/lib/src/commands/build_appbundle.dart index 4eb512db66..329267a9ae 100644 --- a/packages/flutter_tools/lib/src/commands/build_appbundle.dart +++ b/packages/flutter_tools/lib/src/commands/build_appbundle.dart @@ -119,7 +119,6 @@ class BuildAppBundleCommand extends BuildSubCommand { globals.logger, globals.platform, title: 'Deferred components prebuild validation', - exitOnFail: true, ); validator.clearOutputDir(); await validator.checkAndroidDynamicFeature(FlutterProject.current().manifest.deferredComponents); diff --git a/packages/flutter_tools/lib/src/commands/build_bundle.dart b/packages/flutter_tools/lib/src/commands/build_bundle.dart index f8fa4ad040..52f67b52b0 100644 --- a/packages/flutter_tools/lib/src/commands/build_bundle.dart +++ b/packages/flutter_tools/lib/src/commands/build_bundle.dart @@ -131,7 +131,6 @@ class BuildBundleCommand extends BuildSubCommand { platform: platform, buildInfo: buildInfo, mainPath: targetFile, - manifestPath: defaultManifestPath, depfilePath: stringArg('depfile'), assetDirPath: stringArg('asset-dir'), ); diff --git a/packages/flutter_tools/lib/src/commands/build_ios.dart b/packages/flutter_tools/lib/src/commands/build_ios.dart index 76685506a3..eeeee80ab8 100644 --- a/packages/flutter_tools/lib/src/commands/build_ios.dart +++ b/packages/flutter_tools/lib/src/commands/build_ios.dart @@ -186,7 +186,7 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand { _BuildIOSSubCommand({ @required bool verboseHelp }) { addTreeShakeIconsFlag(); addSplitDebugInfoOption(); - addBuildModeFlags(verboseHelp: verboseHelp, defaultToRelease: true); + addBuildModeFlags(verboseHelp: verboseHelp); usesTargetOption(); usesFlavorOption(); usesPubOption(); diff --git a/packages/flutter_tools/lib/src/commands/build_ios_framework.dart b/packages/flutter_tools/lib/src/commands/build_ios_framework.dart index 6369b176a5..2855277b1d 100644 --- a/packages/flutter_tools/lib/src/commands/build_ios_framework.dart +++ b/packages/flutter_tools/lib/src/commands/build_ios_framework.dart @@ -359,7 +359,7 @@ end projectDir: globals.fs.currentDirectory, outputDir: outputBuildDirectory, buildDir: _project.dartTool.childDirectory('flutter_build'), - cacheDir: null, + cacheDir: globals.cache.getRoot(), flutterRootDir: globals.fs.directory(Cache.flutterRoot), defines: { kTargetFile: targetFile, diff --git a/packages/flutter_tools/lib/src/commands/build_web.dart b/packages/flutter_tools/lib/src/commands/build_web.dart index 06dbab3764..8cb8b06a27 100644 --- a/packages/flutter_tools/lib/src/commands/build_web.dart +++ b/packages/flutter_tools/lib/src/commands/build_web.dart @@ -29,7 +29,7 @@ class BuildWebCommand extends BuildSubCommand { usesWebRendererOption(); addEnableExperimentation(hide: !verboseHelp); addNullSafetyModeOptions(hide: !verboseHelp); - addNativeNullAssertions(hide: false); + addNativeNullAssertions(); argParser.addFlag('csp', defaultsTo: false, negatable: false, diff --git a/packages/flutter_tools/lib/src/commands/custom_devices.dart b/packages/flutter_tools/lib/src/commands/custom_devices.dart index 91c820338c..4c144e1a35 100644 --- a/packages/flutter_tools/lib/src/commands/custom_devices.dart +++ b/packages/flutter_tools/lib/src/commands/custom_devices.dart @@ -635,7 +635,6 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { final bool enabled = await askForBool( 'enabled', description: 'Should the device be enabled?', - defaultsTo: true, ); final String targetStr = await askForString( @@ -674,7 +673,6 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { 'remote device has a static IP address and you have a way of ' 'specifying the "--observatory-host=" engine option, you might prefer ' 'not using port forwarding.', - defaultsTo: true, ); final String screenshotCommand = await askForString( @@ -702,9 +700,8 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { // host-platform specific, filled out later pingCommand: const [], - pingSuccessRegex: null, - postBuildCommand: null, + postBuildCommand: const [], // just install to /tmp/${appName} by default installCommand: [ diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index 3e99d24829..83c5883163 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -1135,7 +1135,7 @@ class EmulatorDomain extends Domain { } Future> create(Map args) async { - final String name = _getStringArg(args, 'name', required: false); + final String name = _getStringArg(args, 'name'); final CreateEmulatorResult res = await emulators.createEmulator(name: name); return { 'success': res.success, diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index c56742dc6b..ef9999a958 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -248,7 +248,7 @@ class RunCommand extends RunCommandBase { // By default, the app should to publish the VM service port over mDNS. // This will allow subsequent "flutter attach" commands to connect to the VM // without needing to know the port. - addPublishPort(enabledByDefault: true, verboseHelp: verboseHelp); + addPublishPort(verboseHelp: verboseHelp); argParser ..addFlag('enable-software-rendering', negatable: false, @@ -563,7 +563,6 @@ class RunCommand extends RunCommandBase { packagesFilePath: globalResults['packages'] as String, dillOutputPath: stringArg('output-dill'), ipv6: ipv6, - machine: true, ); } on Exception catch (error) { throwToolExit(error.toString()); diff --git a/packages/flutter_tools/lib/src/commands/upgrade.dart b/packages/flutter_tools/lib/src/commands/upgrade.dart index 038a02969a..f67689deda 100644 --- a/packages/flutter_tools/lib/src/commands/upgrade.dart +++ b/packages/flutter_tools/lib/src/commands/upgrade.dart @@ -10,7 +10,6 @@ import '../base/common.dart'; import '../base/io.dart'; import '../base/os.dart'; import '../base/process.dart'; -import '../base/time.dart'; import '../cache.dart'; import '../dart/pub.dart'; import '../globals_null_migrated.dart' as globals; @@ -79,7 +78,7 @@ class UpgradeCommand extends FlutterCommand { gitTagVersion: GitTagVersion.determine(globals.processUtils), flutterVersion: stringArg('working-directory') == null ? globals.flutterVersion - : FlutterVersion(clock: const SystemClock(), workingDirectory: _commandRunner.workingDirectory), + : FlutterVersion(workingDirectory: _commandRunner.workingDirectory), verifyOnly: boolArg('verify-only'), ); } diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 731829c999..f09cce3667 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -908,7 +908,7 @@ class DefaultResidentCompiler implements ResidentCompiler { Future _reject() async { if (!_compileRequestNeedsConfirmation) { - return Future.value(null); + return Future.value(); } _stdoutHandler.reset(expectSources: false); _server?.stdin.writeln('reject'); diff --git a/packages/flutter_tools/lib/src/context_runner.dart b/packages/flutter_tools/lib/src/context_runner.dart index d3488d8004..463113ac6f 100644 --- a/packages/flutter_tools/lib/src/context_runner.dart +++ b/packages/flutter_tools/lib/src/context_runner.dart @@ -232,7 +232,7 @@ Future runInContext( config: globals.config, platform: globals.platform, ), - FlutterVersion: () => FlutterVersion(clock: const SystemClock()), + FlutterVersion: () => FlutterVersion(), FuchsiaArtifacts: () => FuchsiaArtifacts.find(), FuchsiaDeviceTools: () => FuchsiaDeviceTools(), FuchsiaSdk: () => FuchsiaSdk(), diff --git a/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart b/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart index cc2c158520..1fda61d791 100644 --- a/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart +++ b/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart @@ -284,8 +284,7 @@ class CustomDeviceConfig { '-c', '1', 'raspberrypi' ], - explicitPingSuccessRegex: true, - pingSuccessRegex: null + explicitPingSuccessRegex: true ); /// Returns an example custom device config that works on the given host platform. diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index 4aea017f70..e8670eb92d 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -639,7 +639,7 @@ class DevFS { } final CompilerOutput? compilerOutput = await pendingCompilerOutput; if (compilerOutput == null || compilerOutput.errorCount > 0) { - return UpdateFSReport(success: false); + return UpdateFSReport(); } // Only update the last compiled time if we successfully compiled. _previousCompiled = lastCompiled; diff --git a/packages/flutter_tools/lib/src/drive/web_driver_service.dart b/packages/flutter_tools/lib/src/drive/web_driver_service.dart index 71284dde7f..4b3d12ac81 100644 --- a/packages/flutter_tools/lib/src/drive/web_driver_service.dart +++ b/packages/flutter_tools/lib/src/drive/web_driver_service.dart @@ -91,7 +91,6 @@ class WebDriverService extends DriverService { final Completer appStartedCompleter = Completer.sync(); final Future runFuture = _residentRunner.run( appStartedCompleter: appStartedCompleter, - enableDevTools: false, route: route, ); diff --git a/packages/flutter_tools/lib/src/features.dart b/packages/flutter_tools/lib/src/features.dart index fb4494ddbe..e338073d45 100644 --- a/packages/flutter_tools/lib/src/features.dart +++ b/packages/flutter_tools/lib/src/features.dart @@ -101,19 +101,15 @@ const Feature flutterMacOSDesktopFeature = Feature( extraHelpText: 'Newer beta versions are available on the beta channel.', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, ), beta: FeatureChannelSetting( available: true, - enabledByDefault: false, ), stable: FeatureChannelSetting( available: true, - enabledByDefault: false, ), ); @@ -125,19 +121,15 @@ const Feature flutterLinuxDesktopFeature = Feature( extraHelpText: 'Newer beta versions are available on the beta channel.', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, ), beta: FeatureChannelSetting( available: true, - enabledByDefault: false, ), stable: FeatureChannelSetting( available: true, - enabledByDefault: false, ), ); @@ -149,19 +141,15 @@ const Feature flutterWindowsDesktopFeature = Feature( extraHelpText: 'Newer beta versions are available on the beta channel.', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, ), beta: FeatureChannelSetting( available: true, - enabledByDefault: false, ), stable: FeatureChannelSetting( available: true, - enabledByDefault: false, ), ); @@ -217,7 +205,6 @@ const Feature flutterFuchsiaFeature = Feature( environmentOverride: 'FLUTTER_FUCHSIA', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), ); @@ -227,19 +214,9 @@ const Feature flutterCustomDevicesFeature = Feature( environmentOverride: 'FLUTTER_CUSTOM_DEVICES', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, - ), - beta: FeatureChannelSetting( - available: false, - enabledByDefault: false, - ), - stable: FeatureChannelSetting( - available: false, - enabledByDefault: false, ) ); @@ -254,15 +231,9 @@ const Feature singleWidgetReload = Feature( ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, ), beta: FeatureChannelSetting( available: true, - enabledByDefault: false, - ), - stable: FeatureChannelSetting( - available: false, - enabledByDefault: false, ), ); @@ -272,11 +243,9 @@ const Feature windowsUwpEmbedding = Feature( configSetting: 'enable-windows-uwp-desktop', master: FeatureChannelSetting( available: true, - enabledByDefault: false, ), dev: FeatureChannelSetting( available: true, - enabledByDefault: false, ), ); diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart index 13a37fad26..7f21f8313c 100644 --- a/packages/flutter_tools/lib/src/flutter_cache.dart +++ b/packages/flutter_tools/lib/src/flutter_cache.dart @@ -119,7 +119,6 @@ class PubDependencies extends ArtifactSet { await _pub().get( context: PubContext.pubGet, directory: fileSystem.path.join(_flutterRoot(), 'packages', 'flutter_tools'), - generateSyntheticPackage: false, ); } } diff --git a/packages/flutter_tools/lib/src/flutter_plugins.dart b/packages/flutter_tools/lib/src/flutter_plugins.dart index 2f0d7ad44c..9215167c90 100644 --- a/packages/flutter_tools/lib/src/flutter_plugins.dart +++ b/packages/flutter_tools/lib/src/flutter_plugins.dart @@ -27,7 +27,7 @@ import 'project.dart'; void _renderTemplateToFile(String template, Object? context, File file, TemplateRenderer templateRenderer) { final String renderedTemplate = templateRenderer - .renderString(template, context, htmlEscapeValues: false); + .renderString(template, context); file.createSync(recursive: true); file.writeAsStringSync(renderedTemplate); } diff --git a/packages/flutter_tools/lib/src/ios/code_signing.dart b/packages/flutter_tools/lib/src/ios/code_signing.dart index f3096a6d3a..5a958f3a3f 100644 --- a/packages/flutter_tools/lib/src/ios/code_signing.dart +++ b/packages/flutter_tools/lib/src/ios/code_signing.dart @@ -151,7 +151,6 @@ Future getCodeSigningIdentityDevelopmentTeam({ logger: logger, config: config, terminal: terminal, - shouldExitOnNoCerts: false, ); /// Set [shouldExitOnNoCerts] to show instructions for how to add a cert when none are found, then [toolExit]. @@ -302,7 +301,6 @@ Future _chooseSigningIdentity( List.generate(count, (int number) => '${number + 1}') ..add('a'), prompt: 'Please select a certificate for code signing', - displayAcceptedCharacters: true, defaultChoiceIndex: 0, // Just pressing enter chooses the first one. logger: logger, ); diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart index ebba406ec2..750915466a 100644 --- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart +++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart @@ -854,7 +854,7 @@ class WebDevFS implements DevFS { fs: globals.fs, ); if (compilerOutput == null || compilerOutput.errorCount > 0) { - return UpdateFSReport(success: false); + return UpdateFSReport(); } // Only update the last compiled time if we successfully compiled. diff --git a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart index 41d5f6266d..0ac5ce2f33 100644 --- a/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart +++ b/packages/flutter_tools/lib/src/isolated/resident_web_runner.dart @@ -356,7 +356,7 @@ class ResidentWebRunner extends ResidentRunner { if (debuggingOptions.buildInfo.isDebug) { await runSourceGenerators(); // Full restart is always false for web, since the extra recompile is wasteful. - final UpdateFSReport report = await _updateDevFS(fullRestart: false); + final UpdateFSReport report = await _updateDevFS(); if (report.success) { device.generator.accept(); } else { @@ -415,7 +415,7 @@ class ResidentWebRunner extends ResidentRunner { fullRestart: true, reason: reason, overallTimeInMs: elapsed.inMilliseconds, - fastReassemble: null, + fastReassemble: false, ).send(); } return OperationResult.ok; @@ -498,7 +498,7 @@ class ResidentWebRunner extends ResidentRunner { targetPlatform: TargetPlatform.web_javascript, ); if (result != 0) { - return UpdateFSReport(success: false); + return UpdateFSReport(); } } final InvalidationResult invalidationResult = await projectFileInvalidator.findInvalidated( @@ -589,7 +589,7 @@ class ResidentWebRunner extends ResidentRunner { bool force, bool pause, }) async { - await restart(benchmarkMode: false, pause: pause, fullRestart: false); + await restart(pause: pause); }, null, null, diff --git a/packages/flutter_tools/lib/src/localizations/gen_l10n.dart b/packages/flutter_tools/lib/src/localizations/gen_l10n.dart index a45d69beed..40cd33c7e9 100644 --- a/packages/flutter_tools/lib/src/localizations/gen_l10n.dart +++ b/packages/flutter_tools/lib/src/localizations/gen_l10n.dart @@ -132,7 +132,7 @@ String generateDateFormattingLogic(Message message) { .replaceAll('@(format)', generateString(placeholderFormat)); }); - return formatStatements.isEmpty ? '@(none)' : formatStatements.join(''); + return formatStatements.isEmpty ? '@(none)' : formatStatements.join(); } String generateNumberFormattingLogic(Message message) { @@ -174,7 +174,7 @@ String generateNumberFormattingLogic(Message message) { } }); - return formatStatements.isEmpty ? '@(none)' : formatStatements.join(''); + return formatStatements.isEmpty ? '@(none)' : formatStatements.join(); } String _generatePluralMethod(Message message, String translationForMessage) { diff --git a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart index fd435e74fe..19298f2737 100644 --- a/packages/flutter_tools/lib/src/localizations/localizations_utils.dart +++ b/packages/flutter_tools/lib/src/localizations/localizations_utils.dart @@ -119,7 +119,7 @@ class LocaleInfo implements Comparable { return originalString .split('_') .map((String part) => part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase()) - .join(''); + .join(); } @override diff --git a/packages/flutter_tools/lib/src/project.dart b/packages/flutter_tools/lib/src/project.dart index 3d120bf73e..01bd45ef80 100644 --- a/packages/flutter_tools/lib/src/project.dart +++ b/packages/flutter_tools/lib/src/project.dart @@ -550,7 +550,6 @@ to migrate your project. 'androidX': usesAndroidX, }, printStatusWhenWriting: false, - overwriteExisting: true, ); } diff --git a/packages/flutter_tools/lib/src/reporting/usage.dart b/packages/flutter_tools/lib/src/reporting/usage.dart index 303ca501f8..8c3e78be1f 100644 --- a/packages/flutter_tools/lib/src/reporting/usage.dart +++ b/packages/flutter_tools/lib/src/reporting/usage.dart @@ -369,35 +369,35 @@ class LogToFileAnalytics extends AnalyticsMock { Map? parameters, }) { if (!enabled) { - return Future.value(null); + return Future.value(); } parameters ??= {}; parameters['viewName'] = viewName; parameters.addAll(_sessionValues); _sendController.add(parameters); logFile.writeAsStringSync('screenView $parameters\n', mode: FileMode.append); - return Future.value(null); + return Future.value(); } @override Future sendEvent(String category, String action, {String? label, int? value, Map? parameters}) { if (!enabled) { - return Future.value(null); + return Future.value(); } parameters ??= {}; parameters['category'] = category; parameters['action'] = action; _sendController.add(parameters); logFile.writeAsStringSync('event $parameters\n', mode: FileMode.append); - return Future.value(null); + return Future.value(); } @override Future sendTiming(String variableName, int time, {String? category, String? label}) { if (!enabled) { - return Future.value(null); + return Future.value(); } final Map parameters = { 'variableName': variableName, @@ -407,7 +407,7 @@ class LogToFileAnalytics extends AnalyticsMock { }; _sendController.add(parameters); logFile.writeAsStringSync('timing $parameters\n', mode: FileMode.append); - return Future.value(null); + return Future.value(); } @override diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index e59cd5527d..eef7a2ecf9 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -560,7 +560,7 @@ class FlutterDevice { ); } on DevFSException { devFSStatus.cancel(); - return UpdateFSReport(success: false); + return UpdateFSReport(); } devFSStatus.stop(); globals.printTrace('Synced ${getSizeAsMB(report.syncedBytes)}.'); @@ -1607,7 +1607,7 @@ class TerminalHandler { if (!residentRunner.canHotReload) { return false; } - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); if (result.fatal) { throwToolExit(result.message); } diff --git a/packages/flutter_tools/lib/src/run_hot.dart b/packages/flutter_tools/lib/src/run_hot.dart index cf4677f00c..e81bf73d64 100644 --- a/packages/flutter_tools/lib/src/run_hot.dart +++ b/packages/flutter_tools/lib/src/run_hot.dart @@ -324,7 +324,7 @@ class HotRunner extends ResidentRunner { globals.printStatus('Benchmarking hot reload'); // Measure time to perform a hot reload. - await restart(fullRestart: false); + await restart(); if (stayResident) { await waitForAppToFinish(); } else { @@ -411,8 +411,8 @@ class HotRunner extends ResidentRunner { targetPlatform: _targetPlatform, sdkName: _sdkName, emulator: _emulator, - fullRestart: null, - fastReassemble: null, + fullRestart: false, + fastReassemble: false, overallTimeInMs: appStartedTimer.elapsed.inMilliseconds, compileTimeInMs: totalCompileTime.inMilliseconds, transferTimeInMs: totalLaunchAppTime.inMilliseconds, @@ -456,7 +456,7 @@ class HotRunner extends ResidentRunner { globals.printTrace('Updating assets'); final int result = await assetBundle.build(packagesPath: '.packages'); if (result != 0) { - return UpdateFSReport(success: false); + return UpdateFSReport(); } } @@ -760,7 +760,7 @@ class HotRunner extends ResidentRunner { emulator: emulator, fullRestart: true, reason: reason, - fastReassemble: null, + fastReassemble: false, overallTimeInMs: restartTimer.elapsed.inMilliseconds, syncedBytes: result.updateFSReport?.syncedBytes, invalidatedSourcesCount: result.updateFSReport?.invalidatedSourcesCount, @@ -786,7 +786,7 @@ class HotRunner extends ResidentRunner { emulator: emulator, fullRestart: true, reason: reason, - fastReassemble: null, + fastReassemble: false, ).send(); } status?.cancel(); @@ -836,7 +836,7 @@ class HotRunner extends ResidentRunner { emulator: emulator, fullRestart: false, reason: reason, - fastReassemble: null, + fastReassemble: false, ).send(); } else { HotEvent('exception', @@ -845,7 +845,7 @@ class HotRunner extends ResidentRunner { emulator: emulator, fullRestart: false, reason: reason, - fastReassemble: null, + fastReassemble: false, ).send(); } return OperationResult(errorCode, errorMessage, fatal: true); @@ -1142,7 +1142,7 @@ Future _defaultReloadSourcesHelper( emulator: emulator, fullRestart: false, reason: reason, - fastReassemble: null, + fastReassemble: false, ).send(); // Reset devFS lastCompileTime to ensure the file will still be marked // as dirty on subsequent reloads. diff --git a/packages/flutter_tools/lib/src/test/test_compiler.dart b/packages/flutter_tools/lib/src/test/test_compiler.dart index ec90fa970f..13a2404d8a 100644 --- a/packages/flutter_tools/lib/src/test/test_compiler.dart +++ b/packages/flutter_tools/lib/src/test/test_compiler.dart @@ -81,7 +81,7 @@ class TestCompiler { Future compile(Uri mainDart) { final Completer completer = Completer(); if (compilerController.isClosed) { - return Future.value(null); + return Future.value(); } compilerController.add(CompilationRequest(mainDart, completer)); return completer.future; diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 502727cb41..abfbfc9239 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -67,7 +67,7 @@ class FlutterVersion { globals.processUtils, _workingDirectory, ); - _gitTagVersion = GitTagVersion.determine(globals.processUtils, workingDirectory: _workingDirectory, fetchTags: false, gitRef: _frameworkRevision); + _gitTagVersion = GitTagVersion.determine(globals.processUtils, workingDirectory: _workingDirectory, gitRef: _frameworkRevision); _frameworkVersion = gitTagVersion.frameworkVersionFor(_frameworkRevision); } @@ -231,9 +231,7 @@ class FlutterVersion { } DateTime localFrameworkCommitDate; try { - localFrameworkCommitDate = DateTime.parse(_latestGitCommitDate( - lenient: false - )); + localFrameworkCommitDate = DateTime.parse(_latestGitCommitDate()); } on VersionCheckError { // Don't perform the update check if the version check failed. return; @@ -276,7 +274,6 @@ class FlutterVersion { await _run(['git', 'fetch', _versionCheckRemote, branch]); return _latestGitCommitDate( branch: '$_versionCheckRemote/$branch', - lenient: false, ); } on VersionCheckError catch (error) { if (globals.platform.environment.containsKey('FLUTTER_GIT_URL')) { diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index 89866f2146..678a4f9b4e 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -333,7 +333,6 @@ Future createVmServiceDelegate( return vm_service.VmService( channel, channel.add, - log: null, disposeHandler: () async { await channel.close(); }, diff --git a/packages/flutter_tools/lib/src/xcode_project.dart b/packages/flutter_tools/lib/src/xcode_project.dart index 9b4c1da657..fa0222a6cb 100644 --- a/packages/flutter_tools/lib/src/xcode_project.dart +++ b/packages/flutter_tools/lib/src/xcode_project.dart @@ -495,7 +495,6 @@ class IosProject extends XcodeBasedProject { 'iosDevelopmentTeam': iosDevelopmentTeam ?? '', }, printStatusWhenWriting: false, - overwriteExisting: true, ); } } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart index 36d67c3ae4..e77906a0fb 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/analyze_continuously_test.dart @@ -198,7 +198,7 @@ void main() { terminal: Terminal.test(), artifacts: artifacts, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), processManager: processManager, ); @@ -236,7 +236,7 @@ void main() { terminal: Terminal.test(), artifacts: artifacts, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), processManager: processManager, ); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart index 047e4aa7ad..de6c528321 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_fuchsia_test.dart @@ -33,7 +33,6 @@ void main() { Cache.disableLocking(); final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: const { 'FLUTTER_ROOT': '/', }, @@ -67,7 +66,7 @@ void main() { Platform: () => linuxPlatform, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isFuchsiaEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('there is no Fuchsia project', () async { final BuildCommand command = BuildCommand(); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart index 3eb6075e86..dcdc96b2fe 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart @@ -42,7 +42,6 @@ final Platform macosPlatform = FakePlatform( } ); final Platform notMacosPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': '/', } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart index 17f6761afa..8226fc1bbd 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart @@ -41,7 +41,6 @@ final Platform macosPlatform = FakePlatform( } ); final Platform notMacosPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': '/', } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart index 5f2451d114..a3d18ba31c 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_linux_test.dart @@ -28,7 +28,6 @@ import '../../src/test_flutter_command_runner.dart'; const String _kTestFlutterRoot = '/flutter'; final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': _kTestFlutterRoot, 'HOME': '/', @@ -149,7 +148,7 @@ void main() { Platform: () => linuxPlatform, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('Linux build invokes CMake and ninja, and writes temporary files', () async { @@ -493,13 +492,13 @@ set(BINARY_NAME "fizz_bar") expect(() => runner.run(['build', 'linux', '--no-pub']), throwsToolExit()); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('hidden when not enabled on Linux host', () { expect(BuildLinuxCommand(operatingSystemUtils: FakeOperatingSystemUtils()).hidden, true); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Platform: () => notLinuxPlatform, }); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart index 8dab217cb8..febf95159d 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart @@ -55,7 +55,6 @@ final FakePlatform macosPlatformCustomEnv = FakePlatform( ); final Platform notMacosPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': '/', } @@ -170,7 +169,7 @@ void main() { Platform: () => macosPlatform, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('macOS build forwards error stdout to status logger error', () async { @@ -394,13 +393,13 @@ void main() { expect(() => runner.run(['build', 'macos', '--no-pub']), supported ? throwsToolExit() : throwsA(isA())); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('hidden when not enabled on macOS host', () { expect(BuildMacosCommand(verboseHelp: false).hidden, true); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Platform: () => macosPlatform, }); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart index f4247eb4c7..e783ab8ef4 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_web_test.dart @@ -25,7 +25,6 @@ import '../../src/test_flutter_command_runner.dart'; void main() { FileSystem fileSystem; final Platform fakePlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': '/' } @@ -83,7 +82,7 @@ void main() { }, overrides: { Platform: () => fakePlatform, FileSystem: () => fileSystem, - FeatureFlags: () => TestFeatureFlags(isWebEnabled: false), + FeatureFlags: () => TestFeatureFlags(), ProcessManager: () => FakeProcessManager.any(), }); @@ -122,7 +121,7 @@ void main() { }, overrides: { Platform: () => fakePlatform, FileSystem: () => fileSystem, - FeatureFlags: () => TestFeatureFlags(isWebEnabled: false), + FeatureFlags: () => TestFeatureFlags(), ProcessManager: () => FakeProcessManager.any(), }); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_windows_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_windows_test.dart index 75d3d62f82..7640690047 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_windows_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_windows_test.dart @@ -36,7 +36,6 @@ final Platform windowsPlatform = FakePlatform( } ); final Platform notWindowsPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': flutterRoot, } @@ -195,7 +194,7 @@ void main() { Platform: () => windowsPlatform, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('Windows build does not spew stdout to status logger', () async { @@ -396,7 +395,7 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier testUsingContext('hidden when not enabled on Windows host', () { expect(BuildWindowsCommand().hidden, true); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Platform: () => windowsPlatform, }); @@ -537,7 +536,7 @@ C:\foo\windows\runner\main.cpp(17,1): error C2065: 'Baz': undeclared identifier Platform: () => windowsPlatform, FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isWindowsUwpEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('Windows UWP build completes successfully', () async { diff --git a/packages/flutter_tools/test/commands.shard/hermetic/custom_devices.dart b/packages/flutter_tools/test/commands.shard/hermetic/custom_devices.dart index b9b0a3f99e..e8321e17e5 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/custom_devices.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/custom_devices.dart @@ -162,7 +162,6 @@ const String defaultConfigLinux2 = r''' '''; final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'FLUTTER_ROOT': linuxFlutterRoot, 'HOME': '/', @@ -462,9 +461,7 @@ void main() { testUsingContext( 'custom-devices add command fails when feature is not enabled', () async { - final CommandRunner runner = createCustomDevicesCommandRunner( - featureEnabled: false - ); + final CommandRunner runner = createCustomDevicesCommandRunner(); expect( runner.run(const ['custom-devices', 'add']), throwsToolExit(message: featureNotEnabledMessage), @@ -555,7 +552,7 @@ void main() { '-w', '1', 'testhostname' ], - postBuildCommand: null, + postBuildCommand: const [], installCommand: const [ 'scp', '-r', @@ -644,7 +641,7 @@ void main() { '-w', '1', '192.168.178.1' ], - postBuildCommand: null, + postBuildCommand: const [], installCommand: const [ 'scp', '-r', @@ -733,7 +730,7 @@ void main() { '-w', '1', '::1' ], - postBuildCommand: null, + postBuildCommand: const [], installCommand: const [ 'scp', '-r', @@ -826,7 +823,7 @@ void main() { '-w', '1', 'testhostname' ], - postBuildCommand: null, + postBuildCommand: [], installCommand: [ 'scp', '-r', @@ -906,7 +903,7 @@ void main() { '-w', '1', 'testhostname' ], - postBuildCommand: null, + postBuildCommand: const [], installCommand: const [ 'scp', '-r', @@ -1230,7 +1227,7 @@ void main() { 'testhostname' ], pingSuccessRegex: RegExp(r'[<=]\d+ms'), - postBuildCommand: null, + postBuildCommand: const [], installCommand: const [ 'scp', '-r', diff --git a/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart index 85d9737b72..936b97c241 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/doctor_test.dart @@ -347,7 +347,7 @@ void main() { }); testUsingContext('validate verbose output format contains trace for run with crash', () async { - expect(await FakeCrashingDoctor(logger).diagnose(verbose: true), isFalse); + expect(await FakeCrashingDoctor(logger).diagnose(), isFalse); expect(logger.statusText, contains('#0 CrashingValidator.validate')); }); @@ -428,7 +428,7 @@ void main() { }); testUsingContext('validate verbose output format', () async { - expect(await FakeDoctor(logger).diagnose(verbose: true), isFalse); + expect(await FakeDoctor(logger).diagnose(), isFalse); expect(logger.statusText, equals( '[✓] Passing Validator (with statusInfo)\n' ' • A helpful message\n' @@ -495,7 +495,7 @@ void main() { final BufferLogger wrapLogger = BufferLogger.test( outputPreferences: OutputPreferences(wrapText: true, wrapColumn: 30), ); - expect(await FakeDoctor(wrapLogger).diagnose(verbose: true), isFalse); + expect(await FakeDoctor(wrapLogger).diagnose(), isFalse); expect(wrapLogger.statusText, equals( '[✓] Passing Validator (with\n' ' statusInfo)\n' diff --git a/packages/flutter_tools/test/commands.shard/hermetic/downgrade_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/downgrade_test.dart index d87506a374..3f0c113bbe 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/downgrade_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/downgrade_test.dart @@ -43,7 +43,7 @@ void main() { }); testUsingContext('Downgrade exits on unknown channel', () async { - final FakeFlutterVersion fakeFlutterVersion = FakeFlutterVersion(channel: 'unknown'); + final FakeFlutterVersion fakeFlutterVersion = FakeFlutterVersion(); fileSystem.currentDirectory.childFile('.flutter_tool_state') .writeAsStringSync('{"last-active-master-version":"invalid"}'); final DowngradeCommand command = DowngradeCommand( @@ -70,7 +70,6 @@ void main() { command: [ 'git', 'describe', '--tags', 'abcd' ], - exitCode: 0, stdout: 'v1.2.3' ) ]), diff --git a/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart index 53f4f2c73c..7688ca80d5 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart @@ -26,7 +26,7 @@ void main() { setUp(() { fileSystem = MemoryFileSystem.test(); logger = BufferLogger.test(); - platform = FakePlatform(operatingSystem: 'linux'); + platform = FakePlatform(); }); setUpAll(() { diff --git a/packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart index 44a4d1d599..bc2806fb86 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/precache_test.dart @@ -74,7 +74,7 @@ void main() { final PrecacheCommand command = PrecacheCommand( cache: cache, logger: BufferLogger.test(), - featureFlags: TestFeatureFlags(isWebEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(environment: {}), ); await createTestCommandRunner(command).run(const ['precache', '--web', '--no-android', '--no-ios']); @@ -103,7 +103,7 @@ void main() { final PrecacheCommand command = PrecacheCommand( cache: cache, logger: BufferLogger.test(), - featureFlags: TestFeatureFlags(isMacOSEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(environment: {}), ); await createTestCommandRunner(command).run(const ['precache', '--macos', '--no-android', '--no-ios']); @@ -132,7 +132,7 @@ void main() { final PrecacheCommand command = PrecacheCommand( cache: cache, logger: BufferLogger.test(), - featureFlags: TestFeatureFlags(isWindowsEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(environment: {}), ); await createTestCommandRunner(command).run(const ['precache', '--windows', '--no-android', '--no-ios']); @@ -161,7 +161,7 @@ void main() { final PrecacheCommand command = PrecacheCommand( cache: cache, logger: BufferLogger.test(), - featureFlags: TestFeatureFlags(isLinuxEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(environment: {}), ); await createTestCommandRunner(command).run(const ['precache', '--linux', '--no-android', '--no-ios']); @@ -175,7 +175,7 @@ void main() { final PrecacheCommand command = PrecacheCommand( cache: cache, logger: BufferLogger.test(), - featureFlags: TestFeatureFlags(isWebEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(environment: {}), ); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart index 225d208ef0..96afec3551 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart @@ -258,7 +258,7 @@ void main() { testUsingContext('passes device target platform to usage', () async { final RunCommand command = RunCommand(); - final FakeDevice mockDevice = FakeDevice(targetPlatform: TargetPlatform.ios, sdkNameAndVersion: 'iOS 13') + final FakeDevice mockDevice = FakeDevice(sdkNameAndVersion: 'iOS 13') ..startAppSuccess = false; mockDeviceManager @@ -302,7 +302,7 @@ void main() { DevelopmentArtifact.androidGenSnapshot, })); - mockDeviceManager.devices = [FakeDevice(targetPlatform: TargetPlatform.ios)]; + mockDeviceManager.devices = [FakeDevice()]; expect(await RunCommand().requiredArtifacts, unorderedEquals({ DevelopmentArtifact.universal, @@ -310,7 +310,7 @@ void main() { })); mockDeviceManager.devices = [ - FakeDevice(targetPlatform: TargetPlatform.ios), + FakeDevice(), FakeDevice(targetPlatform: TargetPlatform.android_arm), ]; diff --git a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart index 5815e919e9..f77b30da3b 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart @@ -538,7 +538,7 @@ dev_dependencies: FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager([ - FakeDevice('ephemeral', 'ephemeral', ephemeral: true, isSupported: true, type: PlatformType.android), + FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); }); @@ -576,7 +576,7 @@ dev_dependencies: FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager([ - FakeDevice('ephemeral', 'ephemeral', ephemeral: true, isSupported: true, type: PlatformType.web), + FakeDevice('ephemeral', 'ephemeral'), ]), }); @@ -600,7 +600,7 @@ dev_dependencies: FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), DeviceManager: () => _FakeDeviceManager([ - FakeDevice('ephemeral', 'ephemeral', ephemeral: true, isSupported: true, type: PlatformType.android), + FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), ]), }); diff --git a/packages/flutter_tools/test/commands.shard/permeable/build_apk_test.dart b/packages/flutter_tools/test/commands.shard/permeable/build_apk_test.dart index 12b1f6dffe..1112552096 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/build_apk_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/build_apk_test.dart @@ -340,7 +340,6 @@ void main() { '-Ptree-shake-icons=true', 'assembleRelease', ], - exitCode: 0, )); // The command throws a [ToolExit] because it expects an APK in the file system. @@ -387,7 +386,6 @@ void main() { '-Ptree-shake-icons=true', 'assembleRelease', ], - exitCode: 0, )); // The command throws a [ToolExit] because it expects an APK in the file system. diff --git a/packages/flutter_tools/test/commands.shard/permeable/build_bundle_test.dart b/packages/flutter_tools/test/commands.shard/permeable/build_bundle_test.dart index c725e32aba..de3aea4996 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/build_bundle_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/build_bundle_test.dart @@ -100,7 +100,7 @@ void main() { }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isWindowsEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('bundle fails to build for Linux if feature is disabled', () async { @@ -118,7 +118,7 @@ void main() { }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('bundle fails to build for macOS if feature is disabled', () async { @@ -136,7 +136,7 @@ void main() { }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('bundle --tree-shake-icons fails', () async { diff --git a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart index f741e5607d..3d6963edef 100755 --- a/packages/flutter_tools/test/commands.shard/permeable/create_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/create_test.dart @@ -1950,7 +1950,7 @@ void main() { ], pluginClass: 'somePluginClass', unexpectedPlatforms: [ 'ios', 'android', 'web', 'linux', 'windows', 'macos']); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('plugin supports ios if requested', () async { @@ -1969,7 +1969,7 @@ void main() { unexpectedPlatforms: ['some_platform']); expect(logger.errorText, isNot(contains(_kNoPlatformsMessage))); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); @@ -1991,7 +1991,7 @@ void main() { androidIdentifier: 'com.example.flutter_project'); expect(logger.errorText, isNot(contains(_kNoPlatformsMessage))); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); @@ -2033,7 +2033,7 @@ void main() { unexpectedPlatforms: ['web']); expect(logger.errorText, contains(_kNoPlatformsMessage)); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isWebEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); @@ -2048,7 +2048,7 @@ void main() { expect(projectDir.childDirectory('ios'), exists); expect(projectDir.childDirectory('example').childDirectory('ios'), exists); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('create an empty plugin, then add android', () async { @@ -2063,7 +2063,7 @@ void main() { expect( projectDir.childDirectory('example').childDirectory('android'), exists); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), }); testUsingContext('create an empty plugin, then add linux', () async { @@ -2531,7 +2531,7 @@ void main() { expect(logger.statusText, contains('For more information, see https://flutter.dev/go/plugin-platforms.')); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: ()=> logger, }); @@ -2546,7 +2546,7 @@ void main() { expect(logger.errorText, isNot(contains(_kNoPlatformsMessage))); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isLinuxEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); diff --git a/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart b/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart index f66b5589f1..8df718fa17 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/devices_test.dart @@ -42,7 +42,7 @@ void main() { isEmpty, ); }, overrides: { - FeatureFlags: () => TestFeatureFlags(isWebEnabled: false), + FeatureFlags: () => TestFeatureFlags(), Logger: () => logger, }); diff --git a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart index 90714e9df7..da0f49d4df 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/packages_test.dart @@ -458,7 +458,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }, overrides: { FileSystem: () => MemoryFileSystem.test(), - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), ProcessManager: () => processManager, Stdio: () => mockStdio, BotDetector: () => const FakeBotDetector(false), @@ -483,7 +483,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }, overrides: { FileSystem: () => MemoryFileSystem.test(), - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), ProcessManager: () => processManager, Stdio: () => mockStdio, BotDetector: () => const FakeBotDetector(true), @@ -512,7 +512,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }, overrides: { FileSystem: () => MemoryFileSystem.test(), - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), ProcessManager: () => processManager, Stdio: () => mockStdio, Pub: () => Pub( @@ -538,7 +538,7 @@ void main() { expect(processManager, hasNoRemainingExpectations); }, overrides: { FileSystem: () => MemoryFileSystem.test(), - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), ProcessManager: () => processManager, Stdio: () => mockStdio, Pub: () => Pub( diff --git a/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart b/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart index c21a69e17b..745dcd07fb 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/upgrade_test.dart @@ -165,8 +165,7 @@ void main() { stdout: revision), const FakeCommand(command: [ 'git', 'tag', '--points-at', revision, - ], - stdout: ''), + ]), const FakeCommand(command: [ 'git', 'describe', '--match', '*.*.*', '--long', '--tags', revision, ], @@ -267,7 +266,6 @@ void main() { testUsingContext('does not throw toolExit at standard remote url with FLUTTER_GIT_URL unset', () async { final FakeFlutterVersion flutterVersion = FakeFlutterVersion( channel: 'dev', - repositoryUrl: flutterStandardUrlDotGit, ); expect(() => realCommandRunner.verifyStandardRemote(flutterVersion), returnsNormally); expect(processManager, hasNoRemainingExpectations); @@ -544,7 +542,6 @@ void main() { command: [ 'git', 'tag', '--points-at', 'HEAD', ], - stdout: '', ), const FakeCommand( command: [ diff --git a/packages/flutter_tools/test/general.shard/analytics_test.dart b/packages/flutter_tools/test/general.shard/analytics_test.dart index c53da5d877..cfb551fdce 100644 --- a/packages/flutter_tools/test/general.shard/analytics_test.dart +++ b/packages/flutter_tools/test/general.shard/analytics_test.dart @@ -74,7 +74,7 @@ void main() { expect(count, 0); }, overrides: { - FlutterVersion: () => FlutterVersion(clock: const SystemClock()), + FlutterVersion: () => FlutterVersion(), Usage: () => Usage( configDirOverride: tempDir.path, logFile: tempDir.childFile('analytics.log').path, @@ -98,7 +98,7 @@ void main() { expect(count, 0); }, overrides: { - FlutterVersion: () => FlutterVersion(clock: const SystemClock()), + FlutterVersion: () => FlutterVersion(), Usage: () => Usage( configDirOverride: tempDir.path, logFile: tempDir.childFile('analytics.log').path, @@ -115,7 +115,7 @@ void main() { expect(globals.fs.file('test').readAsStringSync(), contains('$featuresKey: enable-web')); }, overrides: { - FlutterVersion: () => FlutterVersion(clock: const SystemClock()), + FlutterVersion: () => FlutterVersion(), Config: () => testConfig, Platform: () => FakePlatform(environment: { 'FLUTTER_ANALYTICS_LOG_FILE': 'test', @@ -138,7 +138,7 @@ void main() { contains('$featuresKey: enable-web,enable-linux-desktop,enable-macos-desktop'), ); }, overrides: { - FlutterVersion: () => FlutterVersion(clock: const SystemClock()), + FlutterVersion: () => FlutterVersion(), Config: () => testConfig, Platform: () => FakePlatform(environment: { 'FLUTTER_ANALYTICS_LOG_FILE': 'test', diff --git a/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart index 76b5b2f287..dbf6680f04 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart @@ -55,7 +55,7 @@ void main() { androidSdk: FakeAndroidSdk(), logger: BufferLogger.test(), androidWorkflow: AndroidWorkflow( - androidSdk: FakeAndroidSdk('adb'), + androidSdk: FakeAndroidSdk(), featureFlags: TestFeatureFlags(), operatingSystemUtils: FakeOperatingSystemUtils(), ), diff --git a/packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart index f639c099cc..29b5546aca 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart @@ -37,7 +37,6 @@ void main() { processManager: FakeProcessManager.list([ const FakeCommand( command: ['adb', '-s', '1', 'forward', 'tcp:456', 'tcp:123'], - stdout: '', ) ]), logger: BufferLogger.test(), diff --git a/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart index c7c3d53505..13b1ec6dda 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart @@ -64,7 +64,7 @@ void main() { fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app.apk')..createSync(); @@ -130,7 +130,7 @@ void main() { fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app.apk')..createSync(); @@ -168,7 +168,7 @@ void main() { fileSystem: fileSystem, processManager: processManager, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), androidSdk: androidSdk, ); final File apkFile = fileSystem.file('app.apk')..createSync(); diff --git a/packages/flutter_tools/test/general.shard/android/android_device_stop_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_stop_test.dart index 6d1e459035..3af7ea53f6 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_stop_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_stop_test.dart @@ -20,7 +20,7 @@ void main() { androidSdk: FakeAndroidSdk(), fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: FakeProcessManager.any(), ); diff --git a/packages/flutter_tools/test/general.shard/android/android_device_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_test.dart index 93266bc1cb..f89f93b7ae 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_test.dart @@ -56,7 +56,7 @@ void main() { ); final AndroidDevice linuxDevice = setUpAndroidDevice( processManager: FakeProcessManager.list(commands.toList()), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); final AndroidDevice macOsDevice = setUpAndroidDevice( processManager: FakeProcessManager.list(commands.toList()), @@ -469,7 +469,7 @@ AndroidDevice setUpAndroidDevice({ androidSdk ??= FakeAndroidSdk(); return AndroidDevice(id ?? '1234', logger: BufferLogger.test(), - platform: platform ?? FakePlatform(operatingSystem: 'linux'), + platform: platform ?? FakePlatform(), androidSdk: androidSdk, fileSystem: fileSystem ?? MemoryFileSystem.test(), processManager: processManager ?? FakeProcessManager.any(), diff --git a/packages/flutter_tools/test/general.shard/android/android_emulator_test.dart b/packages/flutter_tools/test/general.shard/android/android_emulator_test.dart index 61a51ace9d..a09b3e326a 100644 --- a/packages/flutter_tools/test/general.shard/android/android_emulator_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_emulator_test.dart @@ -187,7 +187,6 @@ void main() { FakeCommand( command: kEmulatorLaunchCommand, exitCode: 1, - stderr: '', stdout: 'dummy text', completer: Completer(), ), diff --git a/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart b/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart index 12f87afaf4..c0d50db4ac 100644 --- a/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart @@ -407,7 +407,6 @@ void main() { '-Ptree-shake-icons=false', 'assembleRelease', ], - exitCode: 0, )); fileSystem.directory('android') @@ -495,7 +494,6 @@ void main() { '-Pcode-size-directory=foo', 'assembleRelease', ], - exitCode: 0, )); fileSystem.directory('android') @@ -655,7 +653,6 @@ void main() { '-Ptarget-platform=android-arm,android-arm64,android-x64', 'assembleAarRelease', ], - exitCode: 0, )); final File manifestFile = fileSystem.file('pubspec.yaml'); @@ -773,7 +770,6 @@ void main() { '-Ptree-shake-icons=false', 'assembleRelease', ], - exitCode: 0, )); fileSystem.file('out/android_arm/flutter_embedding_release.pom') @@ -847,7 +843,6 @@ void main() { '-Ptree-shake-icons=false', 'assembleRelease', ], - exitCode: 0, )); fileSystem.file('out/android_arm64/flutter_embedding_release.pom') @@ -921,7 +916,6 @@ void main() { '-Ptree-shake-icons=false', 'assembleRelease', ], - exitCode: 0, )); fileSystem.file('out/android_x86/flutter_embedding_release.pom') @@ -1128,7 +1122,6 @@ void main() { '-Ptarget-platform=android-arm', 'assembleAarRelease' ], - exitCode: 0, )); fileSystem.file('out/android_arm/flutter_embedding_release.pom') @@ -1213,7 +1206,6 @@ void main() { '-Ptarget-platform=android-arm64', 'assembleAarRelease' ], - exitCode: 0, )); fileSystem.file('out/android_arm64/flutter_embedding_release.pom') @@ -1298,7 +1290,6 @@ void main() { '-Ptarget-platform=android-x86', 'assembleAarRelease' ], - exitCode: 0, )); fileSystem.file('out/android_x86/flutter_embedding_release.pom') @@ -1383,7 +1374,6 @@ void main() { '-Ptarget-platform=android-x64', 'assembleAarRelease' ], - exitCode: 0, )); fileSystem.file('out/android_x64/flutter_embedding_release.pom') diff --git a/packages/flutter_tools/test/general.shard/android/android_install_test.dart b/packages/flutter_tools/test/general.shard/android/android_install_test.dart index f0a20da9e5..bd6d56b7a9 100644 --- a/packages/flutter_tools/test/general.shard/android/android_install_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_install_test.dart @@ -56,7 +56,7 @@ void main() { androidSdk ??= FakeAndroidSdk(); return AndroidDevice('1234', logger: logger, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), androidSdk: androidSdk, fileSystem: fileSystem ?? MemoryFileSystem.test(), processManager: processManager ?? FakeProcessManager.any(), diff --git a/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart b/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart index 296512eeb4..f9e8da857b 100644 --- a/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_sdk_test.dart @@ -75,7 +75,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); @@ -95,7 +95,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); @@ -112,7 +112,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); @@ -129,7 +129,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); @@ -191,7 +191,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => processManager, Config: () => config, - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), }); testUsingContext('returns validate sdk is well formed', () { @@ -214,7 +214,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => processManager, Config: () => config, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('does not throw on sdkmanager version check failure', () { @@ -239,7 +239,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => processManager, Config: () => config, - Platform: () => FakePlatform(operatingSystem: 'linux', environment: {}), + Platform: () => FakePlatform(environment: {}), }); testUsingContext('throws on sdkmanager version check if sdkmanager not found', () { @@ -253,7 +253,7 @@ void main() { FileSystem: () => fileSystem, ProcessManager: () => processManager, Config: () => config, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('returns avdmanager path under cmdline tools', () { @@ -269,7 +269,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); @@ -303,7 +303,7 @@ void main() { }, overrides: { FileSystem: () => fileSystem, ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), Config: () => config, }); diff --git a/packages/flutter_tools/test/general.shard/android/android_studio_test.dart b/packages/flutter_tools/test/general.shard/android/android_studio_test.dart index aeade943c5..787f2ec52d 100644 --- a/packages/flutter_tools/test/general.shard/android/android_studio_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_studio_test.dart @@ -59,7 +59,6 @@ const Map macStudioInfoPlist2020_3 = { }; final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: {'HOME': homeLinux}, ); diff --git a/packages/flutter_tools/test/general.shard/android/android_studio_validator_test.dart b/packages/flutter_tools/test/general.shard/android/android_studio_validator_test.dart index e46260cdfe..e12eaac1df 100644 --- a/packages/flutter_tools/test/general.shard/android/android_studio_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_studio_validator_test.dart @@ -20,7 +20,6 @@ import '../../src/context.dart'; const String home = '/home/me'; final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: {'HOME': home} ); diff --git a/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart b/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart index e5df2217c3..d36225135a 100644 --- a/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_workflow_test.dart @@ -6,6 +6,7 @@ import 'package:file/memory.dart'; import 'package:flutter_tools/src/android/android_sdk.dart'; +import 'package:flutter_tools/src/android/android_studio.dart'; import 'package:flutter_tools/src/android/android_workflow.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; @@ -39,7 +40,7 @@ void main() { testWithoutContext('AndroidWorkflow handles a null AndroidSDK', () { final AndroidWorkflow androidWorkflow = AndroidWorkflow( featureFlags: TestFeatureFlags(), - androidSdk: null, + androidSdk: null, // ignore: avoid_redundant_argument_values operatingSystemUtils: FakeOperatingSystemUtils(), ); @@ -135,7 +136,7 @@ void main() { stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted licenseStatus = await licenseValidator.licensesAccepted; @@ -154,7 +155,7 @@ void main() { stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted licenseStatus = await licenseValidator.licensesAccepted; @@ -178,7 +179,7 @@ void main() { stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted result = await licenseValidator.licensesAccepted; @@ -207,7 +208,7 @@ All SDK package licenses accepted. stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted result = await licenseValidator.licensesAccepted; @@ -237,7 +238,7 @@ Review licenses that have not been accepted (y/N)? stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted result = await licenseValidator.licensesAccepted; @@ -267,7 +268,7 @@ Review licenses that have not been accepted (y/N)? stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); final LicensesAccepted result = await licenseValidator.licensesAccepted; @@ -282,7 +283,7 @@ Review licenses that have not been accepted (y/N)? command: [ '/foo/bar/sdkmanager', '--licenses', - ], stdout: '', + ], )); final AndroidLicenseValidator licenseValidator = AndroidLicenseValidator( @@ -293,7 +294,7 @@ Review licenses that have not been accepted (y/N)? stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); @@ -312,7 +313,7 @@ Review licenses that have not been accepted (y/N)? stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); @@ -331,7 +332,7 @@ Review licenses that have not been accepted (y/N)? stdio: stdio, logger: BufferLogger.test(), userMessages: UserMessages(), - androidStudio: null, + androidStudio: FakeAndroidStudio(), operatingSystemUtils: FakeOperatingSystemUtils(), ); @@ -345,7 +346,7 @@ Review licenses that have not been accepted (y/N)? ..cmdlineToolsAvailable = true ..directory = fileSystem.directory('/foo/bar'); final ValidationResult validationResult = await AndroidValidator( - androidStudio: null, + androidStudio: FakeAndroidStudio(), androidSdk: sdk, fileSystem: fileSystem, logger: logger, @@ -392,7 +393,7 @@ Review licenses that have not been accepted (y/N)? ); final AndroidValidator androidValidator = AndroidValidator( - androidStudio: null, + androidStudio: null, // ignore: avoid_redundant_argument_values androidSdk: sdk, fileSystem: fileSystem, logger: logger, @@ -440,7 +441,7 @@ Review licenses that have not been accepted (y/N)? ..directory = fileSystem.directory('/foo/bar'); final AndroidValidator androidValidator = AndroidValidator( - androidStudio: null, + androidStudio: null, // ignore: avoid_redundant_argument_values androidSdk: sdk, fileSystem: fileSystem, logger: logger, @@ -489,7 +490,7 @@ Review licenses that have not been accepted (y/N)? final ValidationResult validationResult = await AndroidValidator( androidSdk: sdk, - androidStudio: null, + androidStudio: null, // ignore: avoid_redundant_argument_values fileSystem: fileSystem, logger: logger, platform: FakePlatform()..environment = {'HOME': '/home/me', 'JAVA_HOME': 'home/java'}, @@ -511,8 +512,8 @@ Review licenses that have not been accepted (y/N)? testWithoutContext('Mentions `flutter config --android-sdk if user has no AndroidSdk`', () async { final ValidationResult validationResult = await AndroidValidator( - androidSdk: null, - androidStudio: null, + androidSdk: null, // ignore: avoid_redundant_argument_values + androidStudio: null, // ignore: avoid_redundant_argument_values fileSystem: fileSystem, logger: logger, platform: FakePlatform()..environment = {'HOME': '/home/me', 'JAVA_HOME': 'home/java'}, @@ -591,3 +592,8 @@ class CustomFakeOperatingSystemUtils extends Fake implements OperatingSystemUtil @override HostPlatform get hostPlatform => _hostPlatform; } + +class FakeAndroidStudio extends Fake implements AndroidStudio { + @override + String get javaPath => 'java'; +} diff --git a/packages/flutter_tools/test/general.shard/android/gradle_test.dart b/packages/flutter_tools/test/general.shard/android/gradle_test.dart index 8bc6fe4ad6..7bd9322309 100644 --- a/packages/flutter_tools/test/general.shard/android/gradle_test.dart +++ b/packages/flutter_tools/test/general.shard/android/gradle_test.dart @@ -206,7 +206,7 @@ void main() { void testUsingAndroidContext(String description, dynamic Function() testMethod) { testUsingContext(description, testMethod, overrides: { Artifacts: () => localEngineArtifacts, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), FileSystem: () => fs, ProcessManager: () => FakeProcessManager.any(), }); @@ -274,7 +274,6 @@ flutter: manifest: manifest, buildInfo: buildInfo, expectedBuildName: '1.0.0', - expectedBuildNumber: null, ); }); @@ -377,9 +376,7 @@ flutter: '''; await checkBuildVersion( manifest: manifest, - buildInfo: const BuildInfo(BuildMode.release, null, buildName: null, buildNumber: null, treeShakeIcons: false), - expectedBuildName: null, - expectedBuildNumber: null, + buildInfo: const BuildInfo(BuildMode.release, null, treeShakeIcons: false), ); await checkBuildVersion( manifest: manifest, @@ -396,16 +393,13 @@ flutter: // Values don't get unset. await checkBuildVersion( manifest: manifest, - buildInfo: null, expectedBuildName: '1.0.3', expectedBuildNumber: '4', ); // Values get unset. await checkBuildVersion( manifest: manifest, - buildInfo: const BuildInfo(BuildMode.release, null, buildName: null, buildNumber: null, treeShakeIcons: false), - expectedBuildName: null, - expectedBuildNumber: null, + buildInfo: const BuildInfo(BuildMode.release, null, treeShakeIcons: false), ); }); }); diff --git a/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart b/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart index acdc11d90e..46b937a50b 100644 --- a/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart +++ b/packages/flutter_tools/test/general.shard/android/gradle_utils_test.dart @@ -38,7 +38,7 @@ void main() { gradleUtils = GradleUtils( cache: Cache.test(processManager: FakeProcessManager.any(), fileSystem: fileSystem), fileSystem: fileSystem, - platform: FakePlatform(environment: {}, operatingSystem: 'linux'), + platform: FakePlatform(environment: {}), logger: BufferLogger.test(), operatingSystemUtils: FakeOperatingSystemUtils(), ); diff --git a/packages/flutter_tools/test/general.shard/artifact_updater_test.dart b/packages/flutter_tools/test/general.shard/artifact_updater_test.dart index 6a3f56ded7..9946e80327 100644 --- a/packages/flutter_tools/test/general.shard/artifact_updater_test.dart +++ b/packages/flutter_tools/test/general.shard/artifact_updater_test.dart @@ -17,7 +17,7 @@ import '../src/common.dart'; import '../src/fake_http_client.dart'; import '../src/fakes.dart'; -final Platform testPlatform = FakePlatform(environment: const {}); +final Platform testPlatform = FakePlatform(); void main() { testWithoutContext('ArtifactUpdater can download a zip archive', () async { diff --git a/packages/flutter_tools/test/general.shard/artifacts_test.dart b/packages/flutter_tools/test/general.shard/artifacts_test.dart index 5a25df9e9f..b1451277d4 100644 --- a/packages/flutter_tools/test/general.shard/artifacts_test.dart +++ b/packages/flutter_tools/test/general.shard/artifacts_test.dart @@ -25,7 +25,7 @@ void main() { fileSystem = MemoryFileSystem.test(); final Directory cacheRoot = fileSystem.directory('root') ..createSync(); - platform = FakePlatform(operatingSystem: 'linux'); + platform = FakePlatform(); cache = Cache( rootOverride: cacheRoot, fileSystem: fileSystem, @@ -192,7 +192,7 @@ void main() { fileSystem = MemoryFileSystem.test(); final Directory cacheRoot = fileSystem.directory('root') ..createSync(); - platform = FakePlatform(operatingSystem: 'linux'); + platform = FakePlatform(); cache = Cache( rootOverride: cacheRoot, fileSystem: fileSystem, diff --git a/packages/flutter_tools/test/general.shard/asset_bundle_test.dart b/packages/flutter_tools/test/general.shard/asset_bundle_test.dart index 692f4d7b60..45d965372c 100644 --- a/packages/flutter_tools/test/general.shard/asset_bundle_test.dart +++ b/packages/flutter_tools/test/general.shard/asset_bundle_test.dart @@ -419,7 +419,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('does not track wildcard directories from dependencies', () async { @@ -461,7 +461,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('reports package that causes asset bundle error when it is ' @@ -495,7 +495,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('does not report package that causes asset bundle error ' @@ -518,7 +518,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('does not include material design assets if uses-material-design: true is ' @@ -556,7 +556,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('does not include assets in project directories as asset variants', () async { @@ -589,7 +589,7 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); testUsingContext('deferred and regular assets are included in manifest alphabetically', () async { @@ -626,6 +626,6 @@ flutter: }, overrides: { FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), }); } diff --git a/packages/flutter_tools/test/general.shard/base/build_test.dart b/packages/flutter_tools/test/general.shard/base/build_test.dart index 8a869cdc65..149d0cb3cc 100644 --- a/packages/flutter_tools/test/general.shard/base/build_test.dart +++ b/packages/flutter_tools/test/general.shard/base/build_test.dart @@ -83,7 +83,6 @@ void main() { final int result = await genSnapshot.run( snapshotType: SnapshotType(TargetPlatform.android_x64, BuildMode.release), - darwinArch: null, additionalArgs: ['--additional_arg'], ); expect(result, 0); @@ -141,7 +140,6 @@ void main() { final int result = await genSnapshot.run( snapshotType: SnapshotType(TargetPlatform.android_x64, BuildMode.release), - darwinArch: null, additionalArgs: ['--strip'], ); @@ -186,7 +184,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ), isNot(equals(0))); }); @@ -200,7 +197,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ), isNot(0)); }); @@ -214,7 +210,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ), isNot(0)); }); @@ -288,7 +283,6 @@ void main() { darwinArch: DarwinArch.armv7, sdkRoot: 'path/to/sdk', bitcode: true, - splitDebugInfo: null, dartObfuscation: false, ); @@ -410,7 +404,6 @@ void main() { darwinArch: DarwinArch.armv7, sdkRoot: 'path/to/sdk', bitcode: false, - splitDebugInfo: null, dartObfuscation: true, ); @@ -468,7 +461,6 @@ void main() { darwinArch: DarwinArch.armv7, sdkRoot: 'path/to/sdk', bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ); @@ -524,7 +516,6 @@ void main() { darwinArch: DarwinArch.arm64, sdkRoot: 'path/to/sdk', bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ); @@ -553,7 +544,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ); @@ -615,7 +605,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: true, ); @@ -671,7 +660,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, ); @@ -697,7 +685,6 @@ void main() { mainPath: 'main.dill', outputPath: outputPath, bitcode: false, - splitDebugInfo: null, dartObfuscation: false, extraGenSnapshotOptions: const ['--no-strip'], ); diff --git a/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart b/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart index 16bdda97a4..5a3ca56d73 100644 --- a/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart +++ b/packages/flutter_tools/test/general.shard/base/error_handling_io_test.dart @@ -25,7 +25,6 @@ final Platform windowsPlatform = FakePlatform( ); final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: {} ); @@ -889,8 +888,8 @@ void main() { testWithoutContext('when PackageProcess throws an exception without containing non-executable bits', () { final FakeProcessManager fakeProcessManager = FakeProcessManager.list([ - const FakeCommand(command: ['foo'], exception: ProcessPackageExecutableNotFoundException('', candidates: [])), - const FakeCommand(command: ['foo'], exception: ProcessPackageExecutableNotFoundException('', candidates: [])), + const FakeCommand(command: ['foo'], exception: ProcessPackageExecutableNotFoundException('')), + const FakeCommand(command: ['foo'], exception: ProcessPackageExecutableNotFoundException('')), ]); final ProcessManager processManager = ErrorHandlingProcessManager( @@ -1114,7 +1113,7 @@ void main() { platform: linuxPlatform, ); - expect(processManager.killPid(1, io.ProcessSignal.sigterm), true); + expect(processManager.killPid(1), true); expect(processManager.killPid(3, io.ProcessSignal.sigkill), true); expect(fakeProcessManager.killedProcesses, { 1: io.ProcessSignal.sigterm, diff --git a/packages/flutter_tools/test/general.shard/base/file_system_test.dart b/packages/flutter_tools/test/general.shard/base/file_system_test.dart index fcd710cc05..0e1235a6eb 100644 --- a/packages/flutter_tools/test/general.shard/base/file_system_test.dart +++ b/packages/flutter_tools/test/general.shard/base/file_system_test.dart @@ -137,7 +137,7 @@ void main() { final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final FileSystemUtils fsUtils = FileSystemUtils( fileSystem: fileSystem, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); expect(fsUtils.escapePath('/foo/bar/cool.dart'), '/foo/bar/cool.dart'); expect(fsUtils.escapePath('foo/bar/cool.dart'), 'foo/bar/cool.dart'); diff --git a/packages/flutter_tools/test/general.shard/base/io_test.dart b/packages/flutter_tools/test/general.shard/base/io_test.dart index e6b1482b36..a3fd727596 100644 --- a/packages/flutter_tools/test/general.shard/base/io_test.dart +++ b/packages/flutter_tools/test/general.shard/base/io_test.dart @@ -102,7 +102,7 @@ void main() { testWithoutContext('Does not listen to Posix process signals on windows', () async { final FakePlatform windows = FakePlatform(operatingSystem: 'windows'); - final FakePlatform linux = FakePlatform(operatingSystem: 'linux'); + final FakePlatform linux = FakePlatform(); final FakeProcessSignal fakeSignalA = FakeProcessSignal(); final FakeProcessSignal fakeSignalB = FakeProcessSignal(); fakeSignalA.controller.add(fakeSignalA); diff --git a/packages/flutter_tools/test/general.shard/base/logger_test.dart b/packages/flutter_tools/test/general.shard/base/logger_test.dart index a4c404af58..3fc06cb5b8 100644 --- a/packages/flutter_tools/test/general.shard/base/logger_test.dart +++ b/packages/flutter_tools/test/general.shard/base/logger_test.dart @@ -19,7 +19,7 @@ import 'package:test/fake.dart'; import '../../src/common.dart'; import '../../src/fakes.dart'; -final Platform _kNoAnsiPlatform = FakePlatform(stdoutSupportsAnsi: false); +final Platform _kNoAnsiPlatform = FakePlatform(); final String red = RegExp.escape(AnsiTerminal.red); final String bold = RegExp.escape(AnsiTerminal.bold); final String resetBold = RegExp.escape(AnsiTerminal.resetBold); @@ -240,7 +240,7 @@ void main() { testWithoutContext('error', () async { final BufferLogger mockLogger = BufferLogger.test( - outputPreferences: OutputPreferences.test(showColor: false), + outputPreferences: OutputPreferences.test(), ); final VerboseLogger verboseLogger = VerboseLogger( mockLogger, @@ -346,7 +346,6 @@ void main() { int called; final List testPlatforms = [ FakePlatform( - operatingSystem: 'linux', environment: {}, executableArguments: [], ), @@ -399,7 +398,7 @@ void main() { SpinnerStatus spinnerStatus; setUp(() { - platform = FakePlatform(stdoutSupportsAnsi: false); + platform = FakePlatform(); ansiPlatform = FakePlatform(stdoutSupportsAnsi: true); terminal = AnsiTerminal( @@ -670,7 +669,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printError('0123456789' * 15); final List lines = outputStderr(); @@ -699,7 +698,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printError('0123456789' * 15, indent: 5); final List lines = outputStderr(); @@ -722,7 +721,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printError('0123456789' * 15, hangingIndent: 5); final List lines = outputStderr(); @@ -745,7 +744,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printError('0123456789' * 15, indent: 4, hangingIndent: 5); final List lines = outputStderr(); @@ -768,7 +767,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printStatus('0123456789' * 15); final List lines = outputStdout(); @@ -788,7 +787,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printStatus('0123456789' * 15, indent: 5); final List lines = outputStdout(); @@ -811,7 +810,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false) + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40) ); logger.printStatus('0123456789' * 15, hangingIndent: 5); final List lines = outputStdout(); @@ -834,7 +833,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40, showColor: false), + outputPreferences: OutputPreferences.test(wrapText: true, wrapColumn: 40), ); logger.printStatus('0123456789' * 15, indent: 4, hangingIndent: 5); final List lines = outputStdout(); @@ -914,7 +913,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(showColor: false), + outputPreferences: OutputPreferences.test(), ); logger.printStatus( null, @@ -937,7 +936,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(showColor: false), + outputPreferences: OutputPreferences.test(), stopwatchFactory: FakeStopwatchFactory(stopwatch: fakeStopwatch), ); final Status status = logger.startProgress( @@ -1007,7 +1006,7 @@ void main() { platform: _kNoAnsiPlatform, ), stdio: fakeStdio, - outputPreferences: OutputPreferences.test(showColor: false), + outputPreferences: OutputPreferences.test(), ); logger.startProgress('AAA').stop(); logger.startProgress('BBB').stop(); diff --git a/packages/flutter_tools/test/general.shard/base/net_test.dart b/packages/flutter_tools/test/general.shard/base/net_test.dart index e03315099c..05bd1df11a 100644 --- a/packages/flutter_tools/test/general.shard/base/net_test.dart +++ b/packages/flutter_tools/test/general.shard/base/net_test.dart @@ -150,10 +150,10 @@ void main() { final Uri invalid = Uri.parse('http://example.invalid/'); final Net net = createNet( FakeHttpClient.list([ - FakeRequest(invalid, responseError: const io.HandshakeException('')), - FakeRequest(invalid, responseError: const io.HandshakeException('')), - FakeRequest(invalid, responseError: const io.HandshakeException('')), - FakeRequest(invalid, responseError: const io.HandshakeException('')), + FakeRequest(invalid, responseError: const io.HandshakeException()), + FakeRequest(invalid, responseError: const io.HandshakeException()), + FakeRequest(invalid, responseError: const io.HandshakeException()), + FakeRequest(invalid, responseError: const io.HandshakeException()), ]) ); String? error; diff --git a/packages/flutter_tools/test/general.shard/base/os_test.dart b/packages/flutter_tools/test/general.shard/base/os_test.dart index 2b5219b727..3621c619c5 100644 --- a/packages/flutter_tools/test/general.shard/base/os_test.dart +++ b/packages/flutter_tools/test/general.shard/base/os_test.dart @@ -44,7 +44,7 @@ void main() { exitCode: 1, ), ); - final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'linux')); + final OperatingSystemUtils utils = createOSUtils(FakePlatform()); expect(utils.which(kExecutable), isNull); }); @@ -58,7 +58,7 @@ void main() { stdout: kPath1, ), ); - final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'linux')); + final OperatingSystemUtils utils = createOSUtils(FakePlatform()); expect(utils.which(kExecutable)!.path, kPath1); }); @@ -73,7 +73,7 @@ void main() { stdout: '$kPath1\n$kPath2', ), ); - final OperatingSystemUtils utils = createOSUtils(FakePlatform(operatingSystem: 'linux')); + final OperatingSystemUtils utils = createOSUtils(FakePlatform()); final List result = utils.whichAll(kExecutable); expect(result, hasLength(2)); expect(result[0].path, kPath1); @@ -177,7 +177,7 @@ void main() { ); final OperatingSystemUtils utils = - createOSUtils(FakePlatform(operatingSystem: 'linux')); + createOSUtils(FakePlatform()); expect(utils.hostPlatform, HostPlatform.linux_x64); }); @@ -193,7 +193,7 @@ void main() { ); final OperatingSystemUtils utils = - createOSUtils(FakePlatform(operatingSystem: 'linux')); + createOSUtils(FakePlatform()); expect(utils.hostPlatform, HostPlatform.linux_arm64); }); @@ -410,7 +410,6 @@ void main() { fileSystem: fileSystem, logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000', ), processManager: fakeProcessManager, @@ -442,7 +441,6 @@ void main() { fileSystem: fileSystem, logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000', ), processManager: fakeProcessManager, @@ -463,7 +461,6 @@ void main() { fileSystem: fileSystem, logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', operatingSystemVersion: 'Linux 1.2.3-abcd #1 SMP PREEMPT Sat Jan 1 00:00:00 UTC 2000', ), processManager: fakeProcessManager, @@ -493,7 +490,6 @@ void main() { fileSystem: fileSystem, logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', operatingSystemVersion: 'undefinedOperatingSystemVersion', ), processManager: fakeProcessManager, @@ -527,7 +523,7 @@ void main() { final OperatingSystemUtils osUtils = OperatingSystemUtils( fileSystem: fileSystem, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: fakeProcessManager, ); @@ -618,7 +614,7 @@ void main() { final OperatingSystemUtils linuxOsUtils = OperatingSystemUtils( fileSystem: fileSystem, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: fakeProcessManager, ); diff --git a/packages/flutter_tools/test/general.shard/base/process_test.dart b/packages/flutter_tools/test/general.shard/base/process_test.dart index 22b2b38669..208ceb22e2 100644 --- a/packages/flutter_tools/test/general.shard/base/process_test.dart +++ b/packages/flutter_tools/test/general.shard/base/process_test.dart @@ -72,8 +72,8 @@ void main() { final List testString = ['0123456789' * 10]; processManager.addCommand(FakeCommand( command: const ['command'], - stdout: testString.join(''), - stderr: testString.join(''), + stdout: testString.join(), + stderr: testString.join(), )); await processUtils.stream(['command']); @@ -187,7 +187,7 @@ void main() { testLogger = BufferLogger( terminal: AnsiTerminal( stdio: FakeStdio(), - platform: FakePlatform(stdinSupportsAnsi: false), + platform: FakePlatform(), ), outputPreferences: OutputPreferences(wrapText: true, wrapColumn: 40), ); diff --git a/packages/flutter_tools/test/general.shard/base/terminal_test.dart b/packages/flutter_tools/test/general.shard/base/terminal_test.dart index 4458c6f7d3..b602fdc366 100644 --- a/packages/flutter_tools/test/general.shard/base/terminal_test.dart +++ b/packages/flutter_tools/test/general.shard/base/terminal_test.dart @@ -24,7 +24,7 @@ void main() { testWithoutContext('can turn off wrapping', () async { final BufferLogger bufferLogger = BufferLogger( - outputPreferences: OutputPreferences.test(wrapText: false), + outputPreferences: OutputPreferences.test(), terminal: TestTerminal(platform: FakePlatform()..stdoutSupportsAnsi = true), ); final String testString = '0123456789' * 20; @@ -184,7 +184,7 @@ void main() { final Stdio stdio = FakeStdio(); expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform()).preferredStyle, 0); // Defaults to 0 for backwards compatibility. - expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform(), now: DateTime(2018, 1, 1)).preferredStyle, 0); + expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform(), now: DateTime(2018)).preferredStyle, 0); expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform(), now: DateTime(2018, 1, 2)).preferredStyle, 1); expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform(), now: DateTime(2018, 1, 3)).preferredStyle, 2); expect(AnsiTerminal(stdio: stdio, platform: const LocalPlatform(), now: DateTime(2018, 1, 4)).preferredStyle, 3); diff --git a/packages/flutter_tools/test/general.shard/base/user_messages_test.dart b/packages/flutter_tools/test/general.shard/base/user_messages_test.dart index 4b50070198..b67302013c 100644 --- a/packages/flutter_tools/test/general.shard/base/user_messages_test.dart +++ b/packages/flutter_tools/test/general.shard/base/user_messages_test.dart @@ -11,7 +11,7 @@ typedef _InstallationMessage = String Function(Platform); void main() { final FakePlatform macPlatform = FakePlatform(operatingSystem: 'macos'); - final FakePlatform linuxPlatform = FakePlatform(operatingSystem: 'linux'); + final FakePlatform linuxPlatform = FakePlatform(); final FakePlatform windowsPlatform = FakePlatform(operatingSystem: 'windows'); void _checkInstallationURL(_InstallationMessage message) { diff --git a/packages/flutter_tools/test/general.shard/build_system/build_system_test.dart b/packages/flutter_tools/test/general.shard/build_system/build_system_test.dart index 0d62bc1de7..c5bd533f12 100644 --- a/packages/flutter_tools/test/general.shard/build_system/build_system_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/build_system_test.dart @@ -648,7 +648,6 @@ void main() { testWithoutContext('Build completes all dependencies before failing', () async { final MemoryFileSystem fileSystem = MemoryFileSystem.test(); final BuildSystem buildSystem = setUpBuildSystem(fileSystem, FakePlatform( - operatingSystem: 'linux', numberOfProcessors: 10, // Ensure the tool will process tasks concurrently. )); final Completer startB = Completer(); @@ -687,7 +686,7 @@ BuildSystem setUpBuildSystem(FileSystem fileSystem, [FakePlatform? platform]) { return FlutterBuildSystem( fileSystem: fileSystem, logger: BufferLogger.test(), - platform: platform ?? FakePlatform(operatingSystem: 'linux'), + platform: platform ?? FakePlatform(), ); } diff --git a/packages/flutter_tools/test/general.shard/build_system/source_test.dart b/packages/flutter_tools/test/general.shard/build_system/source_test.dart index 5ad4f27cb5..fe3d0ae034 100644 --- a/packages/flutter_tools/test/general.shard/build_system/source_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/source_test.dart @@ -36,8 +36,8 @@ void main() { artifacts: globals.artifacts, // using real artifacts processManager: FakeProcessManager.any(), fileSystem: globals.fs, + // engineVersion being null simulates a local engine. logger: globals.logger, - engineVersion: null, // simulate a local engine. ); visitor = SourceVisitor(environment); environment.buildDir.createSync(recursive: true); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/android_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/android_test.dart index fa67e55b19..23000156be 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/android_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/android_test.dart @@ -21,7 +21,7 @@ import '../../../src/common.dart'; import '../../../src/context.dart'; import '../../../src/fake_process_manager.dart'; -final Platform platform = FakePlatform(operatingSystem: 'linux', environment: const {}); +final Platform platform = FakePlatform(); void main() { FakeProcessManager processManager; FileSystem fileSystem; diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart index b071d2b44d..4d5f6a266d 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart @@ -69,7 +69,7 @@ flutter: expect(depfile, exists); final DepfileService depfileService = DepfileService( - logger: null, + logger: BufferLogger.test(), fileSystem: fileSystem, ); final Depfile dependencies = depfileService.parse(depfile); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart index acc1a65b72..b9d2afde5e 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart @@ -37,7 +37,7 @@ void main() { processManager = FakeProcessManager.empty(); logger = BufferLogger.test(); artifacts = Artifacts.test(); - fileSystem = MemoryFileSystem.test(style: FileSystemStyle.posix); + fileSystem = MemoryFileSystem.test(); androidEnvironment = Environment.test( fileSystem.currentDirectory, defines: { diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart index 01a47e8a62..9a1a018656 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart @@ -11,6 +11,7 @@ @Tags(['no-shuffle']) import 'package:file/memory.dart'; +import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/build_info.dart'; @@ -105,18 +106,18 @@ void main() { testWithoutContext('skipped based on environment.generateDartPluginRegistry', () async { final Environment environment = Environment.test( - fileSystem.currentDirectory, - artifacts: null, - fileSystem: fileSystem, - logger: BufferLogger.test(), - processManager: FakeProcessManager.any(), - generateDartPluginRegistry: false); + fileSystem.currentDirectory, + artifacts: Artifacts.test(), + fileSystem: fileSystem, + logger: BufferLogger.test(), + processManager: FakeProcessManager.any(), + ); expect(const DartPluginRegistrantTarget().canSkip(environment), isTrue); final Environment environment2 = Environment.test( fileSystem.currentDirectory, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), @@ -143,7 +144,7 @@ void main() { const DartPluginRegistrantTarget().canSkip( Environment.test( fileSystem.currentDirectory, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), @@ -163,7 +164,7 @@ void main() { final Environment environment = Environment.test( fileSystem.currentDirectory, projectDir: projectDir, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), @@ -197,7 +198,7 @@ void main() { final Environment environment = Environment.test( fileSystem.currentDirectory, projectDir: projectDir, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), @@ -290,7 +291,7 @@ void main() { final Environment environment = Environment.test( fileSystem.currentDirectory, projectDir: projectDir, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), @@ -337,7 +338,7 @@ void main() { final Environment environment = Environment.test( fileSystem.currentDirectory, projectDir: projectDir, - artifacts: null, + artifacts: Artifacts.test(), fileSystem: fileSystem, logger: BufferLogger.test(), processManager: FakeProcessManager.any(), diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/deferred_components_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/deferred_components_test.dart index dbb2dd8bdc..5964744bc3 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/deferred_components_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/deferred_components_test.dart @@ -5,6 +5,7 @@ // @dart = 2.8 import 'package:file/memory.dart'; +import 'package:flutter_tools/src/artifacts.dart'; import 'package:flutter_tools/src/base/file_system.dart'; import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/build_info.dart'; @@ -35,8 +36,8 @@ void main() { defines: { kDeferredComponents: 'true', }, - artifacts: null, - processManager: null, + artifacts: Artifacts.test(), + processManager: FakeProcessManager.empty(), fileSystem: fileSystem, logger: logger, ); @@ -68,8 +69,8 @@ void main() { defines: { kDeferredComponents: 'true', }, - artifacts: null, - processManager: null, + artifacts: Artifacts.test(), + processManager: FakeProcessManager.empty(), fileSystem: fileSystem, logger: logger, ); @@ -100,8 +101,8 @@ void main() { defines: { kDeferredComponents: 'true', }, - artifacts: null, - processManager: null, + artifacts: Artifacts.test(), + processManager: FakeProcessManager.empty(), fileSystem: fileSystem, logger: logger, ); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart index 8a7f68b9ab..f8050347cb 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/icon_tree_shaker_test.dart @@ -16,7 +16,7 @@ import '../../../src/common.dart'; import '../../../src/fake_process_manager.dart'; import '../../../src/fakes.dart'; -final Platform kNoAnsiPlatform = FakePlatform(stdoutSupportsAnsi: false); +final Platform kNoAnsiPlatform = FakePlatform(); const List _kTtfHeaderBytes = [0, 1, 0, 0, 0, 15, 0, 128, 0, 3, 0, 112]; const String inputPath = '/input/fonts/MaterialIcons-Regular.otf'; diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart index d5a5aed5dc..e536d4824f 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart @@ -30,7 +30,6 @@ void main() { Environment environment; FakeProcessManager processManager; final Platform linux = FakePlatform( - operatingSystem: 'linux', environment: {}, ); final Platform windows = FakePlatform( diff --git a/packages/flutter_tools/test/general.shard/cache_test.dart b/packages/flutter_tools/test/general.shard/cache_test.dart index cd6ee10a2b..859966169c 100644 --- a/packages/flutter_tools/test/general.shard/cache_test.dart +++ b/packages/flutter_tools/test/general.shard/cache_test.dart @@ -448,7 +448,7 @@ void main() { final FlutterRunnerDebugSymbols flutterRunnerDebugSymbols = FlutterRunnerDebugSymbols( cache, packageResolver: packageResolver, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); await flutterRunnerDebugSymbols.updateInner(FakeArtifactUpdater(), fileSystem, FakeOperatingSystemUtils()); @@ -461,7 +461,7 @@ void main() { testWithoutContext('FontSubset in universal artifacts', () { final Cache cache = Cache.test(processManager: FakeProcessManager.any()); - final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform()); expect(artifacts.developmentArtifact, DevelopmentArtifact.universal); }); @@ -469,8 +469,8 @@ void main() { testWithoutContext('FontSubset artifacts on x64 linux', () { fakeProcessManager.addCommand(unameCommandForX64); - final Cache cache = createCache(FakePlatform(operatingSystem: 'linux')); - final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final Cache cache = createCache(FakePlatform()); + final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform()); cache.includeAllPlatforms = false; expect(artifacts.getBinaryDirs(), >[['linux-x64', 'linux-x64/font-subset.zip']]); @@ -479,8 +479,8 @@ void main() { testWithoutContext('FontSubset artifacts on arm64 linux', () { fakeProcessManager.addCommand(unameCommandForArm64); - final Cache cache = createCache(FakePlatform(operatingSystem: 'linux')); - final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final Cache cache = createCache(FakePlatform()); + final FontSubsetArtifacts artifacts = FontSubsetArtifacts(cache, platform: FakePlatform()); cache.includeAllPlatforms = false; expect(artifacts.getBinaryDirs(), >[['linux-arm64', 'linux-arm64/font-subset.zip']]); @@ -559,7 +559,7 @@ void main() { testWithoutContext('macOS desktop artifacts ignore filtering when requested', () { final Cache cache = Cache.test(processManager: FakeProcessManager.any()); - final MacOSEngineArtifacts artifacts = MacOSEngineArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final MacOSEngineArtifacts artifacts = MacOSEngineArtifacts(cache, platform: FakePlatform()); cache.includeAllPlatforms = false; cache.platformOverrideArtifacts = {'macos'}; @@ -570,7 +570,7 @@ void main() { final Cache cache = Cache.test(processManager: FakeProcessManager.any()); final WindowsEngineArtifacts artifacts = WindowsEngineArtifacts( cache, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); cache.includeAllPlatforms = false; cache.platformOverrideArtifacts = {'windows'}; @@ -608,7 +608,7 @@ void main() { testWithoutContext('Linux desktop artifacts ignore filtering when requested', () { fakeProcessManager.addCommand(unameCommandForX64); - final Cache cache = createCache(FakePlatform(operatingSystem: 'linux')); + final Cache cache = createCache(FakePlatform()); final LinuxEngineArtifacts artifacts = LinuxEngineArtifacts( cache, platform: FakePlatform(operatingSystem: 'macos'), @@ -622,10 +622,10 @@ void main() { testWithoutContext('Linux desktop artifacts for x64 include profile and release artifacts', () { fakeProcessManager.addCommand(unameCommandForX64); - final Cache cache = createCache(FakePlatform(operatingSystem: 'linux')); + final Cache cache = createCache(FakePlatform()); final LinuxEngineArtifacts artifacts = LinuxEngineArtifacts( cache, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); expect(artifacts.getBinaryDirs(), >[ @@ -638,10 +638,10 @@ void main() { testWithoutContext('Linux desktop artifacts for arm64 include profile and release artifacts', () { fakeProcessManager.addCommand(unameCommandForArm64); - final Cache cache = createCache(FakePlatform(operatingSystem: 'linux')); + final Cache cache = createCache(FakePlatform()); final LinuxEngineArtifacts artifacts = LinuxEngineArtifacts( cache, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); expect(artifacts.getBinaryDirs(), >[ @@ -733,7 +733,7 @@ void main() { final Cache cache = Cache.test(processManager: FakeProcessManager.any(), fileSystem: fileSystem); final Directory webCacheDirectory = cache.getWebSdkDirectory(); final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater(); - final FlutterWebSdk webSdk = FlutterWebSdk(cache, platform: FakePlatform(operatingSystem: 'linux')); + final FlutterWebSdk webSdk = FlutterWebSdk(cache, platform: FakePlatform()); artifactUpdater.onDownloadZipArchive = (String message, Uri uri, Directory location) { location.createSync(recursive: true); @@ -753,7 +753,7 @@ void main() { final Cache cache = Cache.test(processManager: FakeProcessManager.any(), fileSystem: fileSystem); final Directory webCacheDirectory = cache.getWebSdkDirectory(); final FakeArtifactUpdater artifactUpdater = FakeArtifactUpdater(); - final FlutterWebSdk webSdk = FlutterWebSdk(cache, platform: FakePlatform(operatingSystem: 'linux')); + final FlutterWebSdk webSdk = FlutterWebSdk(cache, platform: FakePlatform()); artifactUpdater.onDownloadZipArchive = (String message, Uri uri, Directory location) { location.createSync(recursive: true); @@ -889,13 +889,13 @@ void main() { }); testWithoutContext('AndroidMavenArtifacts has a specified development artifact', () async { - final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform()); expect(mavenArtifacts.developmentArtifact, DevelopmentArtifact.androidMaven); }); testUsingContext('AndroidMavenArtifacts can invoke Gradle resolve dependencies if Android SDK is present', () async { Cache.flutterRoot = ''; - final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform()); expect(await mavenArtifacts.isUpToDate(memoryFileSystem), isFalse); final Directory gradleWrapperDir = cache.getArtifactDirectory('gradle_wrapper')..createSync(recursive: true); @@ -909,7 +909,7 @@ void main() { }, overrides: { Cache: () => cache, FileSystem: () => memoryFileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.list([ const FakeCommand(command: [ '/cache/bin/cache/flutter_gradle_wrapper.rand0/gradlew', @@ -924,7 +924,7 @@ void main() { }); testUsingContext('AndroidMavenArtifacts is a no-op if the Android SDK is absent', () async { - final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform(operatingSystem: 'linux')); + final AndroidMavenArtifacts mavenArtifacts = AndroidMavenArtifacts(cache, platform: FakePlatform()); expect(await mavenArtifacts.isUpToDate(memoryFileSystem), isFalse); await mavenArtifacts.update(FakeArtifactUpdater(), BufferLogger.test(), memoryFileSystem, FakeOperatingSystemUtils()); diff --git a/packages/flutter_tools/test/general.shard/cold_test.dart b/packages/flutter_tools/test/general.shard/cold_test.dart index 2a05890aae..60eb67a4c4 100644 --- a/packages/flutter_tools/test/general.shard/cold_test.dart +++ b/packages/flutter_tools/test/general.shard/cold_test.dart @@ -42,9 +42,7 @@ void main() { final int exitCode = await ColdRunner(devices, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), target: 'main.dart', - ).attach( - enableDevTools: false, - ); + ).attach(); expect(exitCode, 2); }); @@ -88,9 +86,7 @@ void main() { applicationBinary: applicationBinary, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), target: 'main.dart', - ).run( - enableDevTools: false, - ); + ).run(); expect(result, 1); }); @@ -106,9 +102,7 @@ void main() { debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug), target: 'main.dart', traceStartup: true, - ).run( - enableDevTools: false, - ); + ).run(); expect(result, 0); expect(memoryFileSystem.directory(getBuildDirectory()).childFile('start_up_info.json').existsSync(), true); @@ -131,9 +125,7 @@ void main() { debuggingOptions: DebuggingOptions.disabled(BuildInfo.debug), target: 'main.dart', traceStartup: true, - ).run( - enableDevTools: false, - ); + ).run(); expect(result, 0); expect(memoryFileSystem.directory('test_output_dir').childFile('start_up_info.json').existsSync(), true); diff --git a/packages/flutter_tools/test/general.shard/commands/build_test.dart b/packages/flutter_tools/test/general.shard/commands/build_test.dart index d5463e3a43..17e661aafe 100644 --- a/packages/flutter_tools/test/general.shard/commands/build_test.dart +++ b/packages/flutter_tools/test/general.shard/commands/build_test.dart @@ -28,18 +28,18 @@ import '../../src/context.dart'; void main() { testUsingContext('All build commands support null safety options', () { final List commands = [ - BuildWindowsCommand(verboseHelp: false), - BuildLinuxCommand(verboseHelp: false, operatingSystemUtils: globals.os), + BuildWindowsCommand(), + BuildLinuxCommand(operatingSystemUtils: globals.os), BuildMacosCommand(verboseHelp: false), BuildWebCommand(verboseHelp: false), - BuildApkCommand(verboseHelp: false), + BuildApkCommand(), BuildIOSCommand(verboseHelp: false), BuildIOSArchiveCommand(verboseHelp: false), - BuildAppBundleCommand(verboseHelp: false), + BuildAppBundleCommand(), BuildFuchsiaCommand(verboseHelp: false), BuildAarCommand(verboseHelp: false), BuildIOSFrameworkCommand(verboseHelp: false, buildSystem: globals.buildSystem), - AttachCommand(verboseHelp: false), + AttachCommand(), ]; for (final FlutterCommand command in commands) { @@ -57,15 +57,12 @@ void main() { const BuildInfo unsound = BuildInfo( BuildMode.debug, '', - trackWidgetCreation: false, nullSafetyMode: NullSafetyMode.unsound, treeShakeIcons: false, ); const BuildInfo sound = BuildInfo( BuildMode.debug, '', - trackWidgetCreation: false, - nullSafetyMode: NullSafetyMode.sound, treeShakeIcons: false, ); diff --git a/packages/flutter_tools/test/general.shard/compile_expression_test.dart b/packages/flutter_tools/test/general.shard/compile_expression_test.dart index d4a455945e..981989eb1f 100644 --- a/packages/flutter_tools/test/general.shard/compile_expression_test.dart +++ b/packages/flutter_tools/test/general.shard/compile_expression_test.dart @@ -40,7 +40,7 @@ void main() { artifacts: Artifacts.test(), processManager: processManager, logger: testLogger, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystem: fileSystem, ); diff --git a/packages/flutter_tools/test/general.shard/compile_incremental_test.dart b/packages/flutter_tools/test/general.shard/compile_incremental_test.dart index acecafdb7b..1a1c5eda43 100644 --- a/packages/flutter_tools/test/general.shard/compile_incremental_test.dart +++ b/packages/flutter_tools/test/general.shard/compile_incremental_test.dart @@ -58,7 +58,7 @@ void main() { logger: testLogger, processManager: fakeProcessManager, artifacts: Artifacts.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), stdoutHandler: generatorStdoutHandler, ); @@ -68,7 +68,7 @@ void main() { logger: testLogger, processManager: fakeProcessManager, artifacts: Artifacts.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystemRoots: [ '/foo/bar/fizz', ], diff --git a/packages/flutter_tools/test/general.shard/config_test.dart b/packages/flutter_tools/test/general.shard/config_test.dart index c4f95ca0a2..1e0ac6a978 100644 --- a/packages/flutter_tools/test/general.shard/config_test.dart +++ b/packages/flutter_tools/test/general.shard/config_test.dart @@ -21,7 +21,6 @@ void main() { setUp(() { memoryFileSystem = MemoryFileSystem.test(); fakePlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'HOME': '/', }, @@ -96,7 +95,7 @@ void main() { testWithoutContext('Config does not error on a normally fatal file system exception', () { final BufferLogger bufferLogger = BufferLogger.test(); final File file = ErrorHandlingFile( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fileSystem: MemoryFileSystem.test(), delegate: FakeFile('testfile'), ); diff --git a/packages/flutter_tools/test/general.shard/crash_reporting_test.dart b/packages/flutter_tools/test/general.shard/crash_reporting_test.dart index 89bcdd4eeb..1ad00b61cd 100644 --- a/packages/flutter_tools/test/general.shard/crash_reporting_test.dart +++ b/packages/flutter_tools/test/general.shard/crash_reporting_test.dart @@ -36,7 +36,7 @@ void main() { fs = MemoryFileSystem.test(); testUsage = TestUsage(); - platform = FakePlatform(environment: {}, operatingSystem: 'linux'); + platform = FakePlatform(environment: {}); operatingSystemUtils = OperatingSystemUtils( fileSystem: fs, logger: logger, @@ -290,7 +290,6 @@ void main() { }); final Platform environmentPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'HOME': '/', 'FLUTTER_CRASH_SERVER_BASE_URL': 'https://localhost:12345/fake_server', diff --git a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart index e981640eff..f1b8683bff 100644 --- a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart +++ b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart @@ -179,7 +179,7 @@ void main() { _writeCustomDevicesConfigFile(dir, [testConfig]); expect(await CustomDevices( - featureFlags: TestFeatureFlags(areCustomDevicesEnabled: false), + featureFlags: TestFeatureFlags(), logger: BufferLogger.test(), processManager: FakeProcessManager.any(), config: CustomDevicesConfig.test( @@ -285,8 +285,6 @@ void main() { processManager: FakeProcessManager.list([ FakeCommand( command: testConfig.pingCommand, - exitCode: 0, - stdout: '', ), ]), config: CustomDevicesConfig.test( @@ -354,7 +352,7 @@ void main() { ); // this should start the command - expect(await forwarder.forward(12345, hostPort: null), 12345); + expect(await forwarder.forward(12345), 12345); expect(forwardPortCommandCompleter.isCompleted, false); // this should terminate it diff --git a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_workflow_test.dart b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_workflow_test.dart index 319ca9f6e0..3f54ecd481 100644 --- a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_workflow_test.dart @@ -9,7 +9,7 @@ import '../../src/fakes.dart'; void main() { testWithoutContext('CustomDeviceWorkflow reports false when custom devices feature is disabled', () { - final CustomDeviceWorkflow workflow = CustomDeviceWorkflow(featureFlags: TestFeatureFlags(areCustomDevicesEnabled: false)); + final CustomDeviceWorkflow workflow = CustomDeviceWorkflow(featureFlags: TestFeatureFlags()); expect(workflow.appliesToHostPlatform, false); expect(workflow.canLaunchDevices, false); expect(workflow.canListDevices, false); diff --git a/packages/flutter_tools/test/general.shard/custom_devices/custom_devices_config_test.dart b/packages/flutter_tools/test/general.shard/custom_devices/custom_devices_config_test.dart index ee9000b861..38eefe97c5 100644 --- a/packages/flutter_tools/test/general.shard/custom_devices/custom_devices_config_test.dart +++ b/packages/flutter_tools/test/general.shard/custom_devices/custom_devices_config_test.dart @@ -23,8 +23,7 @@ void main() { final Directory directory = fileSystem.directory('custom_devices_config'); writeCustomDevicesConfigFile( - directory, - json: null + directory ); final CustomDevicesConfig customDevicesConfig = CustomDevicesConfig.test( diff --git a/packages/flutter_tools/test/general.shard/dart/language_version_test.dart b/packages/flutter_tools/test/general.shard/dart/language_version_test.dart index c974e821dd..fb0134856b 100644 --- a/packages/flutter_tools/test/general.shard/dart/language_version_test.dart +++ b/packages/flutter_tools/test/general.shard/dart/language_version_test.dart @@ -287,7 +287,6 @@ library funstuff; final Package package = Package( 'foo', Uri.parse('file://foo/'), - languageVersion: null, ); expect(determineLanguageVersion(file, package, flutterRoot), testCurrentLanguageVersion); diff --git a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart index 761af195ac..2876f8cf4c 100644 --- a/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart +++ b/packages/flutter_tools/test/general.shard/dart/pub_get_test.dart @@ -36,9 +36,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -82,9 +80,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -132,9 +128,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -181,9 +175,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -213,9 +205,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -248,9 +238,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -287,9 +275,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -326,9 +312,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -365,9 +349,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -403,9 +385,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -443,9 +423,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -485,9 +463,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -533,9 +509,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -620,9 +594,7 @@ void main() { logger: logger, processManager: processManager, usage: TestUsage(), - platform: FakePlatform( - environment: const {}, - ), + platform: FakePlatform(), botDetector: const BotDetectorAlwaysNo(), ); @@ -664,7 +636,7 @@ void main() { ]); final Pub pub = Pub( - platform: FakePlatform(environment: const {}), + platform: FakePlatform(), fileSystem: fileSystem, logger: logger, usage: TestUsage(), @@ -723,7 +695,7 @@ void main() { ]); final Pub pub = Pub( - platform: FakePlatform(environment: const {}), + platform: FakePlatform(), fileSystem: fileSystem, logger: logger, usage: TestUsage(), @@ -774,7 +746,7 @@ void main() { ]); final Pub pub = Pub( - platform: FakePlatform(environment: const {}), + platform: FakePlatform(), usage: TestUsage(), fileSystem: fileSystem, logger: BufferLogger.test(), @@ -1057,7 +1029,6 @@ void main() { logger: logger, processManager: processManager, platform: FakePlatform( - operatingSystem: 'linux', // so that the command executed is consistent environment: {}, ), botDetector: const BotDetectorAlwaysNo() diff --git a/packages/flutter_tools/test/general.shard/desktop_device_test.dart b/packages/flutter_tools/test/general.shard/desktop_device_test.dart index 17a33c598f..451fb5dc92 100644 --- a/packages/flutter_tools/test/general.shard/desktop_device_test.dart +++ b/packages/flutter_tools/test/general.shard/desktop_device_test.dart @@ -182,7 +182,6 @@ void main() { BuildInfo.debug, startPaused: true, disableServiceAuthCodes: true, - dartFlags: '', enableSoftwareRendering: true, skiaDeterministicRendering: true, traceSkia: true, diff --git a/packages/flutter_tools/test/general.shard/device_test.dart b/packages/flutter_tools/test/general.shard/device_test.dart index 515db621d4..4c36c91707 100644 --- a/packages/flutter_tools/test/general.shard/device_test.dart +++ b/packages/flutter_tools/test/general.shard/device_test.dart @@ -483,7 +483,7 @@ void main() { testWithoutContext('computeDartVmFlags handles various combinations of Dart VM flags and null_assertions', () { expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug)), ''); expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, dartFlags: '--foo')), '--foo'); - expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, dartFlags: '', nullAssertions: true)), '--null_assertions'); + expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, nullAssertions: true)), '--null_assertions'); expect(computeDartVmFlags(DebuggingOptions.enabled(BuildInfo.debug, dartFlags: '--foo', nullAssertions: true)), '--foo,--null_assertions'); }); } diff --git a/packages/flutter_tools/test/general.shard/doctor.dart b/packages/flutter_tools/test/general.shard/doctor.dart index 8462e1e45e..3dfb68ad9b 100644 --- a/packages/flutter_tools/test/general.shard/doctor.dart +++ b/packages/flutter_tools/test/general.shard/doctor.dart @@ -39,10 +39,7 @@ void main() { expect(DoctorValidatorsProvider.defaultInstance.validators, isNot(contains(isA()))); }, overrides: { - FeatureFlags: () => TestFeatureFlags( - isLinuxEnabled: false, - isWindowsEnabled: false, - ), + FeatureFlags: () => TestFeatureFlags(), })); test('doctor validators includes web when feature is enabled', () => testbed.run(() { @@ -58,8 +55,6 @@ void main() { expect(DoctorValidatorsProvider.defaultInstance.validators, isNot(contains(isA()))); }, overrides: { - FeatureFlags: () => TestFeatureFlags( - isWebEnabled: false, - ), + FeatureFlags: () => TestFeatureFlags(), })); } diff --git a/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart b/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart index c9bd8dfefd..372527cec2 100644 --- a/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart +++ b/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart @@ -339,9 +339,7 @@ void main() { 'data': {'A': 'B'} }); }, overrides: { - FlutterVersion: () => FakeFlutterVersion( - engineRevision: 'abcdefghijklmnopqrstuvwxyz', - ) + FlutterVersion: () => FakeFlutterVersion() }); testWithoutContext('Can connect to existing application and stop it during cleanup', () async { diff --git a/packages/flutter_tools/test/general.shard/emulator_test.dart b/packages/flutter_tools/test/general.shard/emulator_test.dart index 2d17323601..d2aaa6989b 100644 --- a/packages/flutter_tools/test/general.shard/emulator_test.dart +++ b/packages/flutter_tools/test/general.shard/emulator_test.dart @@ -99,7 +99,7 @@ void main() { ]), androidSdk: null, androidWorkflow: AndroidWorkflow( - androidSdk: null, + androidSdk: sdk, featureFlags: TestFeatureFlags(), operatingSystemUtils: FakeOperatingSystemUtils(), ), diff --git a/packages/flutter_tools/test/general.shard/flutter_manifest_test.dart b/packages/flutter_tools/test/general.shard/flutter_manifest_test.dart index 1dd1574a59..77f1de0639 100644 --- a/packages/flutter_tools/test/general.shard/flutter_manifest_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_manifest_test.dart @@ -630,8 +630,8 @@ flutter: expect(flutterManifest, matchesManifest( appVersion: '1.0.0+2', buildName: '1.0.0', - buildNumber: '2'), - ); + buildNumber: '2', + )); }); testWithoutContext('FlutterManifest parses major.minor.patch with no build version', () { @@ -652,8 +652,7 @@ flutter: expect(flutterManifest, matchesManifest( appVersion: '0.0.1', buildName: '0.0.1', - buildNumber: null), - ); + )); }); testWithoutContext('FlutterManifest parses major.minor.patch+build version clause 2', () { @@ -674,8 +673,8 @@ flutter: expect(flutterManifest, matchesManifest( appVersion: '1.0.0-beta+exp.sha.5114f85', buildName: '1.0.0-beta', - buildNumber: 'exp.sha.5114f85'), - ); + buildNumber: 'exp.sha.5114f85', + )); }); testWithoutContext('FlutterManifest parses major.minor+build version clause', () { @@ -696,8 +695,8 @@ flutter: expect(flutterManifest, matchesManifest( appVersion: '1.0+2', buildName: '1.0', - buildNumber: '2'), - ); + buildNumber: '2', + )); }); testWithoutContext('FlutterManifest parses empty version clause', () { @@ -715,11 +714,7 @@ flutter: logger: logger, ); - expect(flutterManifest, matchesManifest( - appVersion: null, - buildName: null, - buildNumber: null), - ); + expect(flutterManifest, matchesManifest()); }); testWithoutContext('FlutterManifest parses no version clause', () { @@ -736,11 +731,7 @@ flutter: logger: logger, ); - expect(flutterManifest, matchesManifest( - appVersion: null, - buildName: null, - buildNumber: null), - ); + expect(flutterManifest, matchesManifest()); }); // Regression test for https://github.com/flutter/flutter/issues/31764 diff --git a/packages/flutter_tools/test/general.shard/flutter_platform_test.dart b/packages/flutter_tools/test/general.shard/flutter_platform_test.dart index 08c940753b..b94c003dc9 100644 --- a/packages/flutter_tools/test/general.shard/flutter_platform_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_platform_test.dart @@ -69,7 +69,6 @@ void main() { BuildInfo.debug, startPaused: true, ), - enableObservatory: false, ), throwsAssertionError); expect(() => installHook( @@ -79,7 +78,6 @@ void main() { startPaused: true, hostVmServicePort: 123, ), - enableObservatory: false, ), throwsAssertionError); FlutterPlatform capturedPlatform; diff --git a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart index 34020c43dd..df75015aa4 100644 --- a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart @@ -34,7 +34,6 @@ void main() { fileSystem = MemoryFileSystem.test(); // Not Windows. platform = FakePlatform( - operatingSystem: 'linux', environment: {}, ); processManager = FakeProcessManager.any(); @@ -147,7 +146,6 @@ void main() { ], stdout: 'success', stderr: 'failure', - exitCode: 0, ) ]); device = createDevice(dartEntrypointArgs: ['--foo', '--bar']); @@ -180,7 +178,6 @@ void main() { ], stdout: 'Observatory listening on http://localhost:1234', stderr: 'failure', - exitCode: 0, ) ]); device = createDevice(enableObservatory: true); @@ -220,11 +217,7 @@ class TestFlutterTesterDevice extends FlutterTesterTestDevice { treeShakeIcons: false, packagesPath: '.dart_tool/package_config.json', ), - startPaused: false, - enableDds: true, - disableServiceAuthCodes: false, hostVmServicePort: 1234, - nullAssertions: false, dartEntrypointArgs: dartEntrypointArgs, ), enableObservatory: enableObservatory, diff --git a/packages/flutter_tools/test/general.shard/flutter_validator_test.dart b/packages/flutter_tools/test/general.shard/flutter_validator_test.dart index bfc9d276db..05abf80a10 100644 --- a/packages/flutter_tools/test/general.shard/flutter_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_validator_test.dart @@ -40,7 +40,6 @@ void main() { final Artifacts artifacts = Artifacts.test(); final FlutterValidator flutterValidator = FlutterValidator( platform: FakePlatform( - operatingSystem: 'linux', localeName: 'en_US.UTF-8', environment: {}, ), diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_dev_finder_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_dev_finder_test.dart index 9bf1342e3e..f2e689f893 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_dev_finder_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_dev_finder_test.dart @@ -87,7 +87,6 @@ void main() { final ProcessManager processManager = FakeProcessManager.list([ FakeCommand( command: [ deviceFinder.path, 'list', '-full' ], - exitCode: 0, stdout: 'device1\ndevice2', ), ]); @@ -114,7 +113,6 @@ void main() { '-timeout', '2000ms', ], - exitCode: 0, stdout: 'device1', ), ]); diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart index efcc9b704e..b3418732b1 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart @@ -354,7 +354,7 @@ void main() { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, ProcessManager: () => FakeProcessManager.any(), - FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: null), + FuchsiaArtifacts: () => FuchsiaArtifacts(), OperatingSystemUtils: () => osUtils, }); @@ -369,9 +369,7 @@ void main() { FuchsiaDeviceTools: () => fuchsiaDeviceTools, FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: sshConfig), OperatingSystemUtils: () => osUtils, - Platform: () => FakePlatform( - operatingSystem: 'linux', - ), + Platform: () => FakePlatform(), }); testUsingContext('fail with correct LaunchResult when pm fails', () async { diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart index 50c8c3ac10..26c4050ff8 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart @@ -91,7 +91,7 @@ void main() { testWithoutContext('lists nothing when workflow cannot list devices', () async { final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(canListDevices: false); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fuchsiaSdk: null, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -102,10 +102,10 @@ void main() { }); testWithoutContext('can parse ffx output for single device', () async { - final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: false, canListDevices: true); + final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: false); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devices: '2001:0db8:85a3:0000:0000:8a2e:0370:7334 paper-pulp-bush-angel'); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux', environment: {},), + platform: FakePlatform(environment: {}), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -118,10 +118,10 @@ void main() { }); testWithoutContext('can parse device-finder output for single device', () async { - final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: true, canListDevices: true); + final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devFinderDevices: '2001:0db8:85a3:0000:0000:8a2e:0370:7334 paper-pulp-bush-angel'); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux', environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'},), + platform: FakePlatform(environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -134,13 +134,13 @@ void main() { }); testWithoutContext('can parse ffx output for multiple devices', () async { - final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: false, canListDevices: true); + final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: false); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devices: '2001:0db8:85a3:0000:0000:8a2e:0370:7334 paper-pulp-bush-angel\n' '2001:0db8:85a3:0000:0000:8a2e:0370:7335 foo-bar-fiz-buzz' ); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -155,13 +155,13 @@ void main() { }); testWithoutContext('can parse device-finder output for multiple devices', () async { - final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: true, canListDevices: true); + final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devFinderDevices: '2001:0db8:85a3:0000:0000:8a2e:0370:7334 paper-pulp-bush-angel\n' '2001:0db8:85a3:0000:0000:8a2e:0370:7335 foo-bar-fiz-buzz' ); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -179,7 +179,7 @@ void main() { final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: false, canListDevices: false); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devices: 'junk', devFinderDevices: 'junk'); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -191,10 +191,10 @@ void main() { }); testWithoutContext('can parse junk output from device-finder', () async { - final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(shouldUseDeviceFinder: true, canListDevices: true); + final FakeFuchsiaWorkflow fuchsiaWorkflow = FakeFuchsiaWorkflow(); final FakeFuchsiaSdk fuchsiaSdk = FakeFuchsiaSdk(devices: 'junk', devFinderDevices: 'junk'); final FuchsiaDevices fuchsiaDevices = FuchsiaDevices( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), fuchsiaSdk: fuchsiaSdk, fuchsiaWorkflow: fuchsiaWorkflow, logger: BufferLogger.test(), @@ -254,7 +254,7 @@ void main() { expect(await device.targetPlatform, TargetPlatform.fuchsia_arm64); }, overrides: { - FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: null), + FuchsiaArtifacts: () => FuchsiaArtifacts(), FuchsiaSdk: () => FakeFuchsiaSdk(), ProcessManager: () => processManager, }); @@ -479,9 +479,7 @@ void main() { final FuchsiaDevice device = FuchsiaDevice('id', name: 'tester'); expect(device.supportsScreenshot, true); }, overrides: { - Platform: () => FakePlatform( - operatingSystem: 'linux', - ), + Platform: () => FakePlatform(), }); testUsingContext('is not supported on Windows', () { @@ -527,7 +525,6 @@ void main() { environment: { 'FUCHSIA_SSH_CONFIG': '/fuchsia/out/default/.ssh', }, - operatingSystem: 'linux', ), }); @@ -574,7 +571,6 @@ void main() { environment: { 'FUCHSIA_SSH_CONFIG': '/fuchsia/out/default/.ssh', }, - operatingSystem: 'linux', ), }); @@ -622,7 +618,6 @@ void main() { environment: { 'FUCHSIA_SSH_CONFIG': '/fuchsia/out/default/.ssh', }, - operatingSystem: 'linux', ), }, testOn: 'posix'); @@ -664,7 +659,6 @@ void main() { environment: { 'FUCHSIA_SSH_CONFIG': '/fuchsia/out/default/.ssh', }, - operatingSystem: 'linux', ), }); }); @@ -730,7 +724,7 @@ void main() { const String expectedIsolateName = 'foobar'; final Uri uri = await findUri([ // no ui isolate. - FlutterView(id: '1', uiIsolate: null), + FlutterView(id: '1', uiIsolate: fakeIsolate), // wrong name. FlutterView( id: '2', @@ -756,7 +750,7 @@ void main() { const String expectedIsolateName = 'foobar'; final Future uri = findUri([ // no ui isolate. - FlutterView(id: '1', uiIsolate: null), + FlutterView(id: '1', uiIsolate: fakeIsolate), // wrong name. FlutterView(id: '2', uiIsolate: vm_service.Isolate.parse({ ...fakeIsolate.toJson(), @@ -770,7 +764,7 @@ void main() { testUsingContext('can handle non flutter view', () async { const String expectedIsolateName = 'foobar'; final Future uri = findUri([ - FlutterView(id: '1', uiIsolate: null), // no ui isolate. + FlutterView(id: '1', uiIsolate: fakeIsolate), // no ui isolate. ], expectedIsolateName); expect(uri, throwsException); @@ -785,7 +779,7 @@ void main() { final CachedArtifacts artifacts = CachedArtifacts( cache: cache, fileSystem: fileSystem, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), operatingSystemUtils: globals.os, ); expect(artifacts.getArtifactPath( @@ -833,7 +827,7 @@ void main() { expect(await device.sdkNameAndVersion, equals('Fuchsia')); }, overrides: { ProcessManager: () => processManager, - FuchsiaArtifacts: () => FuchsiaArtifacts(sshConfig: null), + FuchsiaArtifacts: () => FuchsiaArtifacts(), FuchsiaSdk: () => FakeFuchsiaSdk(), }); diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart index 4e46ecf437..34bccd0662 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_ffx_test.dart @@ -46,7 +46,6 @@ void main() { FakeProcessManager.list([ FakeCommand( command: [ffx.path, 'target', 'list', '--format', 's'], - exitCode: 0, stderr: 'No devices found.', ), ]); @@ -90,7 +89,6 @@ void main() { FakeProcessManager.list([ FakeCommand( command: [ffx.path, 'target', 'list', '--format', 's'], - exitCode: 0, stdout: 'device1\ndevice2', ), ]); @@ -112,7 +110,6 @@ void main() { FakeProcessManager.list([ FakeCommand( command: [ffx.path, '-T', '2', 'target', 'list', '--format', 's'], - exitCode: 0, stdout: 'device1', ), ]); @@ -191,7 +188,6 @@ void main() { FakeProcessManager.list([ FakeCommand( command: [ffx.path, 'target', 'list', '--format', 'a', 'known-device'], - exitCode: 0, stdout: '1234-1234-1234-1234', ), ]); diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_workflow_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_workflow_test.dart index 00a6e553bd..2002cf096c 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_workflow_test.dart @@ -19,9 +19,9 @@ void main() { testWithoutContext('Fuchsia workflow does not apply to host platform if feature is disabled', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( - featureFlags: TestFeatureFlags(isFuchsiaEnabled: false), + featureFlags: TestFeatureFlags(), fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder, sshConfig: sshConfig), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), ); expect(fuchsiaWorkflow.appliesToHostPlatform, false); @@ -40,8 +40,8 @@ void main() { testWithoutContext('Fuchsia workflow can not list and launch devices if there is no ffx when using default workflow', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder, sshConfig: sshConfig, ffx: null), - platform: FakePlatform(operatingSystem: 'linux', environment: {}), + fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder, sshConfig: sshConfig), + platform: FakePlatform(environment: {}), ); expect(fuchsiaWorkflow.canLaunchDevices, false); @@ -52,8 +52,8 @@ void main() { testWithoutContext('Fuchsia workflow can not list and launch devices if there is no dev finder when ffx is disabled', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(devFinder: null, sshConfig: sshConfig, ffx: ffx), - platform: FakePlatform(operatingSystem: 'linux', environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), + fuchsiaArtifacts: FuchsiaArtifacts(sshConfig: sshConfig, ffx: ffx), + platform: FakePlatform(environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), ); expect(fuchsiaWorkflow.canLaunchDevices, false); @@ -64,8 +64,8 @@ void main() { testWithoutContext('Fuchsia workflow can not launch devices if there is no ssh config when using default workflow', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(sshConfig: null, ffx: ffx), - platform: FakePlatform(operatingSystem: 'linux', environment: {}), + fuchsiaArtifacts: FuchsiaArtifacts(ffx: ffx), + platform: FakePlatform(environment: {}), ); expect(fuchsiaWorkflow.canLaunchDevices, false); @@ -76,8 +76,8 @@ void main() { testWithoutContext('Fuchsia workflow can not launch devices if there is no ssh config when ffx is disabled', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(sshConfig: null, devFinder: devFinder), - platform: FakePlatform(operatingSystem: 'linux', environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), + fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder), + platform: FakePlatform(environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), ); expect(fuchsiaWorkflow.canLaunchDevices, false); @@ -88,8 +88,8 @@ void main() { testWithoutContext('Fuchsia workflow can list and launch devices supported with sufficient SDK artifacts when using default workflow', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(devFinder: null, sshConfig: sshConfig, ffx: ffx), - platform: FakePlatform(operatingSystem: 'linux', environment: {}), + fuchsiaArtifacts: FuchsiaArtifacts(sshConfig: sshConfig, ffx: ffx), + platform: FakePlatform(environment: {}), ); expect(fuchsiaWorkflow.canLaunchDevices, true); @@ -100,8 +100,8 @@ void main() { testWithoutContext('Fuchsia workflow can list and launch devices supported with sufficient SDK artifacts when ffx is disabled', () { final FuchsiaWorkflow fuchsiaWorkflow = FuchsiaWorkflow( featureFlags: TestFeatureFlags(), - fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder, sshConfig: sshConfig, ffx: null), - platform: FakePlatform(operatingSystem: 'linux', environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), + fuchsiaArtifacts: FuchsiaArtifacts(devFinder: devFinder, sshConfig: sshConfig), + platform: FakePlatform(environment: {'FUCHSIA_DISABLED_ffx_discovery': '1'}), ); expect(fuchsiaWorkflow.canLaunchDevices, true); diff --git a/packages/flutter_tools/test/general.shard/generate_localizations_test.dart b/packages/flutter_tools/test/general.shard/generate_localizations_test.dart index 69399069b9..b31e2f3c19 100644 --- a/packages/flutter_tools/test/general.shard/generate_localizations_test.dart +++ b/packages/flutter_tools/test/general.shard/generate_localizations_test.dart @@ -823,8 +823,6 @@ flutter: preferredSupportedLocales: ['en_US'], templateArbFile: Uri.file('example.arb', windows: false), untranslatedMessagesFile: Uri.file('untranslated', windows: false), - // Set synthetic package to true. - useSyntheticPackage: true, ); expect( @@ -2063,7 +2061,6 @@ import 'output-localization-file_en.dart' deferred as output-localization-file_e templateArbFileName: defaultTemplateArbFileName, outputFileString: defaultOutputFileString, classNameString: defaultClassNameString, - useDeferredLoading: false, ) ..loadResources() ..writeOutputFiles(BufferLogger.test()); @@ -2120,7 +2117,6 @@ import 'output-localization-file_en.dart' deferred as output-localization-file_e templateArbFileName: defaultTemplateArbFileName, outputFileString: defaultOutputFileString, classNameString: defaultClassNameString, - useDeferredLoading: false, ) ..loadResources() ..writeOutputFiles(BufferLogger.test()); diff --git a/packages/flutter_tools/test/general.shard/hot_test.dart b/packages/flutter_tools/test/general.shard/hot_test.dart index f469ac8ac5..3c69d05a58 100644 --- a/packages/flutter_tools/test/general.shard/hot_test.dart +++ b/packages/flutter_tools/test/general.shard/hot_test.dart @@ -187,7 +187,7 @@ void main() { HotRunnerConfig: () => failingTestingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); @@ -216,7 +216,7 @@ void main() { false, true, ), - ).restart(fullRestart: false); + ).restart(); expect(result.isOk, false); expect(result.message, 'setupHotReload failed'); expect(failingTestingConfig.updateDevFSCompleteCalled, false); @@ -224,7 +224,7 @@ void main() { HotRunnerConfig: () => failingTestingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); }); @@ -254,7 +254,7 @@ void main() { HotRunnerConfig: () => shutdownTestingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); @@ -276,7 +276,7 @@ void main() { HotRunnerConfig: () => shutdownTestingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); }); @@ -328,6 +328,7 @@ void main() { hotEventSdkName: 'Tester', hotEventEmulator: false, hotEventFullRestart: true, + fastReassemble: false, hotEventOverallTimeInMs: 64000, hotEventSyncedBytes: 4, hotEventInvalidatedSourcesCount: 2, @@ -342,7 +343,7 @@ void main() { HotRunnerConfig: () => testingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), Usage: () => testUsage, }); @@ -415,7 +416,7 @@ void main() { false, true, ), - ).restart(fullRestart: false); + ).restart(); expect(result.isOk, true); expect(testUsage.events, [ @@ -445,7 +446,7 @@ void main() { HotRunnerConfig: () => testingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), Usage: () => testUsage, }); @@ -479,7 +480,7 @@ void main() { HotRunnerConfig: () => testingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), Usage: () => testUsage, }); @@ -507,13 +508,13 @@ void main() { devtoolsHandler: createNoOpHandler, ); - await expectLater(runner.restart(fullRestart: false), throwsA('updateDevFS failed')); + await expectLater(runner.restart(), throwsA('updateDevFS failed')); expect(testingConfig.updateDevFSCompleteCalled, true); }, overrides: { HotRunnerConfig: () => testingConfig, Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), Usage: () => testUsage, }); @@ -547,15 +548,13 @@ void main() { final int exitCode = await HotRunner(devices, debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), target: 'main.dart', - ).attach( - enableDevTools: false, - ); + ).attach(); expect(exitCode, 2); }, overrides: { HotRunnerConfig: () => TestHotRunnerConfig(), Artifacts: () => Artifacts.test(), FileSystem: () => fileSystem, - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProcessManager: () => FakeProcessManager.any(), }); }); diff --git a/packages/flutter_tools/test/general.shard/integration_test_device_test.dart b/packages/flutter_tools/test/general.shard/integration_test_device_test.dart index a318ed9893..90c450fbac 100644 --- a/packages/flutter_tools/test/general.shard/integration_test_device_test.dart +++ b/packages/flutter_tools/test/general.shard/integration_test_device_test.dart @@ -164,7 +164,7 @@ void main() { 'ephemeral', 'ephemeral', type: PlatformType.android, - launchResult: LaunchResult.succeeded(observatoryUri: null), + launchResult: LaunchResult.succeeded(), ), debuggingOptions: DebuggingOptions.enabled( BuildInfo.debug, diff --git a/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart b/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart index 675ae2d193..0bb90fbac2 100644 --- a/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart +++ b/packages/flutter_tools/test/general.shard/intellij/intellij_validator_test.dart @@ -21,7 +21,6 @@ final Platform macPlatform = FakePlatform( environment: {'HOME': '/foo/bar'} ); final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: { 'HOME': '/foo/bar' }, diff --git a/packages/flutter_tools/test/general.shard/ios/code_signing_test.dart b/packages/flutter_tools/test/general.shard/ios/code_signing_test.dart index 0a4ee2da87..0b7208922e 100644 --- a/packages/flutter_tools/test/general.shard/ios/code_signing_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/code_signing_test.dart @@ -138,7 +138,7 @@ void main() { final String? developmentTeam = await getCodeSigningIdentityDevelopmentTeam( processManager: processManager, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), logger: logger, config: testConfig, terminal: testTerminal, diff --git a/packages/flutter_tools/test/general.shard/ios/devices_test.dart b/packages/flutter_tools/test/general.shard/ios/devices_test.dart index db7c73a671..b956d6e074 100644 --- a/packages/flutter_tools/test/general.shard/ios/devices_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/devices_test.dart @@ -34,7 +34,7 @@ import '../../src/fake_process_manager.dart'; void main() { final FakePlatform macPlatform = FakePlatform(operatingSystem: 'macos'); - final FakePlatform linuxPlatform = FakePlatform(operatingSystem: 'linux'); + final FakePlatform linuxPlatform = FakePlatform(); final FakePlatform windowsPlatform = FakePlatform(operatingSystem: 'windows'); group('IOSDevice', () { diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart index cc27bb1035..e6b055e7d5 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart @@ -161,7 +161,7 @@ void main() { ], environment: const { 'PATH': '/usr/bin:null', ...kDyLdLibEntry, - }, exitCode: 0) + }) ]); final IOSDevice device = setUpIOSDevice(processManager: processManager, artifacts: artifacts); final bool isAppInstalled = await device.isAppInstalled(iosApp); diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart index 673895b0a1..a1c2ac48e5 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_port_forwarder_test.dart @@ -21,16 +21,15 @@ void main() { // we timeout on a port testWithoutContext('IOSDevicePortForwarder.forward will kill iproxy processes before invoking a second', () async { final FakeProcessManager processManager = FakeProcessManager.list([ + // iproxy does not exit with 0 when it cannot forward; + // the FakeCommands below expect an exitCode of 0. const FakeCommand( command: ['iproxy', '12345:456', '--udid', '1234'], - // iproxy does not exit with 0 when it cannot forward. - exitCode: 0, stdout: null, // no stdout indicates failure. environment: kDyLdLibEntry, ), const FakeCommand( command: ['iproxy', '12346:456', '--udid', '1234'], - exitCode: 0, stdout: 'not empty', environment: kDyLdLibEntry, ), diff --git a/packages/flutter_tools/test/general.shard/ios/ios_workflow_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_workflow_test.dart index 0ef988a308..688b36094b 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_workflow_test.dart @@ -27,9 +27,9 @@ void main() { testWithoutContext('iOS workflow is disabled on Linux', () { final IOSWorkflow iosWorkflow = IOSWorkflow( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), xcode: Xcode.test(processManager: FakeProcessManager.any()), - featureFlags: TestFeatureFlags(isIOSEnabled: true), + featureFlags: TestFeatureFlags(), ); expect(iosWorkflow.appliesToHostPlatform, false); @@ -41,7 +41,7 @@ void main() { final IOSWorkflow iosWorkflow = IOSWorkflow( platform: FakePlatform(operatingSystem: 'windows'), xcode: Xcode.test(processManager: FakeProcessManager.any()), - featureFlags: TestFeatureFlags(isIOSEnabled: true), + featureFlags: TestFeatureFlags(), ); expect(iosWorkflow.appliesToHostPlatform, false); @@ -58,7 +58,7 @@ void main() { version: null, ), ), - featureFlags: TestFeatureFlags(isIOSEnabled: true), + featureFlags: TestFeatureFlags(), ); expect(iosWorkflow.appliesToHostPlatform, true); @@ -79,7 +79,7 @@ void main() { final IOSWorkflow iosWorkflow = IOSWorkflow( platform: FakePlatform(operatingSystem: 'macos'), xcode: xcode, - featureFlags: TestFeatureFlags(isIOSEnabled: true), + featureFlags: TestFeatureFlags(), ); // Make sure we're testing the right Xcode state. diff --git a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart index 13dbaf3000..93a4acd1df 100644 --- a/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart @@ -73,7 +73,7 @@ void main() { fileSystem: fileSystem, platform: platform, processManager: fakeProcessManager, - usage: null, + usage: TestUsage(), ); }); diff --git a/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart b/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart index 6ec411a7d8..fcf9558e1a 100644 --- a/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart +++ b/packages/flutter_tools/test/general.shard/linux/linux_device_test.dart @@ -20,9 +20,7 @@ import '../../src/common.dart'; import '../../src/fake_process_manager.dart'; import '../../src/fakes.dart'; -final FakePlatform linux = FakePlatform( - operatingSystem: 'linux', -); +final FakePlatform linux = FakePlatform(); final FakePlatform windows = FakePlatform( operatingSystem: 'windows', ); @@ -78,7 +76,7 @@ void main() { expect(await LinuxDevices( fileSystem: MemoryFileSystem.test(), platform: linux, - featureFlags: TestFeatureFlags(isLinuxEnabled: false), + featureFlags: TestFeatureFlags(), logger: BufferLogger.test(), processManager: FakeProcessManager.any(), operatingSystemUtils: FakeOperatingSystemUtils(), diff --git a/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart b/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart index fd037b4454..3e164b20a8 100644 --- a/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/linux/linux_workflow_test.dart @@ -11,7 +11,6 @@ import '../../src/fakes.dart'; void main() { final Platform linux = FakePlatform( - operatingSystem: 'linux', environment: {}, ); final Platform notLinux = FakePlatform( @@ -21,7 +20,7 @@ void main() { final FeatureFlags enabledFlags = TestFeatureFlags( isLinuxEnabled: true, ); - final FeatureFlags disabledFlags = TestFeatureFlags(isLinuxEnabled: false); + final FeatureFlags disabledFlags = TestFeatureFlags(); testWithoutContext('Applies to Linux platform', () { final LinuxWorkflow linuxWorkflow = LinuxWorkflow( diff --git a/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart b/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart index a72fa767ae..fd5f4da1ef 100644 --- a/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart +++ b/packages/flutter_tools/test/general.shard/macos/macos_device_test.dart @@ -27,9 +27,7 @@ final FakePlatform macOS = FakePlatform( operatingSystem: 'macos', ); -final FakePlatform linux = FakePlatform( - operatingSystem: 'linux', -); +final FakePlatform linux = FakePlatform(); void main() { testWithoutContext('default configuration', () async { @@ -108,7 +106,7 @@ void main() { platform: macOS, operatingSystemUtils: FakeOperatingSystemUtils(), macOSWorkflow: MacOSWorkflow( - featureFlags: TestFeatureFlags(isMacOSEnabled: false), + featureFlags: TestFeatureFlags(), platform: macOS, ), ); diff --git a/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart b/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart index bf323e018b..8ed185a419 100644 --- a/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/macos/macos_workflow_test.dart @@ -12,9 +12,7 @@ final FakePlatform macOS = FakePlatform( operatingSystem: 'macos', ); -final FakePlatform linux = FakePlatform( - operatingSystem: 'linux', -); +final FakePlatform linux = FakePlatform(); void main() { testWithoutContext('Applies to macOS platform', () { @@ -44,7 +42,7 @@ void main() { testWithoutContext('Does not apply when feature is disabled', () { final MacOSWorkflow macOSWorkflow = MacOSWorkflow( platform: macOS, - featureFlags: TestFeatureFlags(isMacOSEnabled: false), + featureFlags: TestFeatureFlags(), ); expect(macOSWorkflow.appliesToHostPlatform, false); diff --git a/packages/flutter_tools/test/general.shard/plugins_test.dart b/packages/flutter_tools/test/general.shard/plugins_test.dart index 5cf640a26a..4e7a4fbd50 100644 --- a/packages/flutter_tools/test/general.shard/plugins_test.dart +++ b/packages/flutter_tools/test/general.shard/plugins_test.dart @@ -119,7 +119,7 @@ void main() { fs = MemoryFileSystem.test(); fsWindows = MemoryFileSystem(style: FileSystemStyle.windows); systemClock = FakeSystemClock() - ..currentTime = DateTime(1970, 1, 1); + ..currentTime = DateTime(1970); flutterVersion = FakeFlutterVersion(frameworkVersion: '1.0.0'); // Add basic properties to the Flutter project and subprojects @@ -424,7 +424,7 @@ dependencies: final Directory pluginC = createPluginWithDependencies(name: 'plugin-c', dependencies: const []); iosProject.testExists = true; - final DateTime dateCreated = DateTime(1970, 1, 1); + final DateTime dateCreated = DateTime(1970); systemClock.currentTime = dateCreated; await refreshPluginsList(flutterProject); diff --git a/packages/flutter_tools/test/general.shard/reporting/events_test.dart b/packages/flutter_tools/test/general.shard/reporting/events_test.dart index 6ad207915e..d20e669aa0 100644 --- a/packages/flutter_tools/test/general.shard/reporting/events_test.dart +++ b/packages/flutter_tools/test/general.shard/reporting/events_test.dart @@ -107,7 +107,7 @@ void main() { testWithoutContext('a null language version is treated as unmigrated', () { final TestUsage usage = TestUsage(); final PackageConfig packageConfig = PackageConfig([ - Package('foo', Uri.parse('file:///foo/lib/'), languageVersion: null), + Package('foo', Uri.parse('file:///foo/lib/')), ]); NullSafetyAnalysisEvent( diff --git a/packages/flutter_tools/test/general.shard/resident_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_runner_test.dart index cd1735fe83..6084bec0c7 100644 --- a/packages/flutter_tools/test/general.shard/resident_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_runner_test.dart @@ -405,7 +405,7 @@ void main() { await futureAppStart.future; flutterDevice.reportError = vm_service.RPCError('something bad happened', 666, ''); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, true); expect(result.code, 1); expect((globals.flutterUsage as TestUsage).events, contains( @@ -414,6 +414,7 @@ void main() { hotEventSdkName: 'Android', hotEventEmulator: false, hotEventFullRestart: false, + fastReassemble: false, )), )); expect(fakeVmServiceHost.hasRemainingExpectations, false); @@ -435,7 +436,7 @@ void main() { await futureAppStart.future; flutterDevice._devFS = null; - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, false); expect(result.code, 1); expect(result.message, contains('Device initialization has not completed.')); @@ -458,7 +459,7 @@ void main() { await futureAppStart.future; flutterDevice.reportError = vm_service.RPCError('something bad happened', kIsolateReloadBarred, ''); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, true); expect(result.code, kIsolateReloadBarred); expect(result.message, contains('Unable to hot reload application due to an unrecoverable error')); @@ -469,6 +470,7 @@ void main() { hotEventSdkName: 'Android', hotEventEmulator: false, hotEventFullRestart: false, + fastReassemble: false, )), )); expect(fakeVmServiceHost.hasRemainingExpectations, false); @@ -505,7 +507,7 @@ void main() { await futureAppStart.future; flutterDevice.reportError = vm_service.RPCError('something bad happened', 666, ''); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, true); expect(result.code, 1); @@ -515,6 +517,7 @@ void main() { hotEventSdkName: 'Android', hotEventEmulator: false, hotEventFullRestart: false, + fastReassemble: false, )), )); expect(fakeVmServiceHost.hasRemainingExpectations, false); @@ -558,9 +561,9 @@ void main() { enableDevTools: true, )); await futureAppStart.future; - flutterDevice.report = UpdateFSReport(success: true, invalidatedSourcesCount: 0); + flutterDevice.report = UpdateFSReport(success: true); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.code, 0); expect(fakeVmServiceHost.hasRemainingExpectations, false); @@ -618,7 +621,7 @@ void main() { await futureAppStart.future; flutterDevice.report = UpdateFSReport(success: true, invalidatedSourcesCount: 1); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(globals.fs.file(globals.fs.path.join('lib', 'main.dart')), isNot(exists)); expect(testLogger.errorText, contains('The entrypoint file (i.e. the file with main())')); @@ -682,7 +685,7 @@ void main() { await futureAppStart.future; flutterDevice.report = UpdateFSReport(success: true, invalidatedSourcesCount: 1); - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, false); expect(result.message, contains('Reload rejected: Failed to hot reload')); // contains error message from reload report. @@ -741,7 +744,7 @@ void main() { )); await futureAppStart.future; - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, false); expect(result.code, 0); @@ -826,7 +829,7 @@ void main() { )); await futureAppStart.future; - final OperationResult result = await residentRunner.restart(fullRestart: false); + final OperationResult result = await residentRunner.restart(); expect(result.fatal, false); expect(result.code, 0); @@ -837,7 +840,7 @@ void main() { expect(event.parameters.fastReassemble, true); }, overrides: { FileSystem: () => MemoryFileSystem.test(), - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), ProjectFileInvalidator: () => FakeProjectFileInvalidator(), Usage: () => TestUsage(), FeatureFlags: () => TestFeatureFlags(isSingleWidgetReloadEnabled: true), @@ -1116,6 +1119,7 @@ void main() { hotEventSdkName: 'Android', hotEventEmulator: false, hotEventFullRestart: true, + fastReassemble: false, )), )); expect(fakeVmServiceHost.hasRemainingExpectations, false); @@ -1422,7 +1426,7 @@ void main() { devtoolsHandler: createNoOpHandler, ); - final Future result = residentRunner.attach(enableDevTools: false); + final Future result = residentRunner.attach(); expect(await result, 0); })); @@ -1681,7 +1685,7 @@ void main() { nullSafetyMode: NullSafetyMode.unsound, ), target: null, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), )).generator as DefaultResidentCompiler; expect(residentCompiler.initializeFromDill, @@ -1712,7 +1716,7 @@ void main() { extraFrontEndOptions: ['--enable-experiment=non-nullable'], ), target: null, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), )).generator as DefaultResidentCompiler; expect(residentCompiler.initializeFromDill, @@ -1732,7 +1736,7 @@ void main() { testUsingContext('FlutterDevice passes flutter-widget-cache flag when feature is enabled', () async { fakeVmServiceHost = FakeVmServiceHost(requests: []); - final FakeDevice device = FakeDevice(targetPlatform: TargetPlatform.android_arm); + final FakeDevice device = FakeDevice(); final DefaultResidentCompiler residentCompiler = (await FlutterDevice.create( device, @@ -1756,7 +1760,7 @@ void main() { testUsingContext('FlutterDevice passes alternative-invalidation-strategy flag', () async { fakeVmServiceHost = FakeVmServiceHost(requests: []); - final FakeDevice device = FakeDevice(targetPlatform: TargetPlatform.android_arm); + final FakeDevice device = FakeDevice(); final DefaultResidentCompiler residentCompiler = (await FlutterDevice.create( @@ -1780,7 +1784,7 @@ void main() { testUsingContext('FlutterDevice passes initializeFromDill parameter if specified', () async { fakeVmServiceHost = FakeVmServiceHost(requests: []); - final FakeDevice device = FakeDevice(targetPlatform: TargetPlatform.android_arm); + final FakeDevice device = FakeDevice(); final DefaultResidentCompiler residentCompiler = (await FlutterDevice.create( device, @@ -2053,7 +2057,6 @@ class FakeFlutterDevice extends Fake implements FlutterDevice { Uri testUri; UpdateFSReport report = UpdateFSReport( success: true, - syncedBytes: 0, invalidatedSourcesCount: 1, ); Object reportError; diff --git a/packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart b/packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart index c97a0688b2..57ed1ab981 100644 --- a/packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart @@ -53,7 +53,6 @@ void main() { flutterProject: project, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -82,7 +81,6 @@ void main() { flutterProject: project, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -106,7 +104,6 @@ void main() { flutterProject: project, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -129,7 +126,6 @@ void main() { flutterProject: project, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -157,7 +153,6 @@ void main() { flutterProject: project, debuggingOptions: DebuggingOptions.disabled(BuildInfo.release), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), diff --git a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart index ddb81efa4e..4678173114 100644 --- a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart @@ -138,7 +138,7 @@ void main() { fileSystem.file('pubspec.yaml').createSync(); fileSystem.file('lib/main.dart').createSync(recursive: true); fileSystem.file('web/index.html').createSync(recursive: true); - webDevFS.report = UpdateFSReport(success: true, syncedBytes: 0); + webDevFS.report = UpdateFSReport(success: true); debugConnection.fakeVmServiceHost = () => fakeVmServiceHost; webDevFS.result = ConnectionResult( appConnection, @@ -160,7 +160,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -190,7 +189,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, startPaused: true), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -210,7 +208,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -224,7 +221,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.profile), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -284,7 +280,7 @@ void main() { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fileSystem.file(globals.fs.path.join('lib', 'main.dart')) .createSync(recursive: true); - webDevFS.report = UpdateFSReport(success: false, syncedBytes: 0); + webDevFS.report = UpdateFSReport(); expect(await residentWebRunner.run(), 1); // Completing this future ensures that the daemon can exit correctly. @@ -447,7 +443,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug, startPaused: true), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: BufferLogger.test(), @@ -474,7 +469,7 @@ void main() { final ResidentRunner residentWebRunner = setUpResidentRunner( flutterDevice, logger: logger, - systemClock: SystemClock.fixed(DateTime(2001, 1, 1)), + systemClock: SystemClock.fixed(DateTime(2001)), ); fakeVmServiceHost = FakeVmServiceHost(requests: [ ...kAttachExpectations, @@ -500,7 +495,7 @@ void main() { fileSystem: fileSystem, chromiumLauncher: chromiumLauncher, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: FakeProcessManager.any(), ); webDevFS.report = UpdateFSReport(success: true); @@ -513,7 +508,7 @@ void main() { expect(debugConnectionInfo, isNotNull); - final OperationResult result = await residentWebRunner.restart(fullRestart: false); + final OperationResult result = await residentWebRunner.restart(); expect(logger.statusText, contains('Restarted application in')); expect(result.code, 0); @@ -521,7 +516,7 @@ void main() { // ensure that analytics are sent. expect(testUsage.events, [ - TestUsageEvent('hot', 'restart', parameters: CustomDimensions.fromMap({'cd27': 'web-javascript', 'cd28': '', 'cd29': 'false', 'cd30': 'true', 'cd13': '0'})), + TestUsageEvent('hot', 'restart', parameters: CustomDimensions.fromMap({'cd27': 'web-javascript', 'cd28': '', 'cd29': 'false', 'cd30': 'true', 'cd13': '0', 'cd48': 'false'})), ]); expect(testUsage.timings, const [ TestTimingEvent('hot', 'web-incremental-restart', Duration.zero), @@ -537,7 +532,7 @@ void main() { final ResidentRunner residentWebRunner = setUpResidentRunner( flutterDevice, logger: logger, - systemClock: SystemClock.fixed(DateTime(2001, 1, 1)), + systemClock: SystemClock.fixed(DateTime(2001)), ); fakeVmServiceHost = FakeVmServiceHost(requests: [ ...kAttachExpectations, @@ -557,7 +552,7 @@ void main() { fileSystem: fileSystem, chromiumLauncher: chromiumLauncher, logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: FakeProcessManager.any(), ); webDevFS.report = UpdateFSReport(success: true); @@ -581,7 +576,7 @@ void main() { // ensure that analytics are sent. expect(testUsage.events, [ - TestUsageEvent('hot', 'restart', parameters: CustomDimensions.fromMap({'cd27': 'web-javascript', 'cd28': '', 'cd29': 'false', 'cd30': 'true', 'cd13': '0'})), + TestUsageEvent('hot', 'restart', parameters: CustomDimensions.fromMap({'cd27': 'web-javascript', 'cd28': '', 'cd29': 'false', 'cd30': 'true', 'cd13': '0', 'cd48': 'false'})), ]); expect(testUsage.timings, const [ TestTimingEvent('hot', 'web-incremental-restart', Duration.zero), @@ -597,7 +592,7 @@ void main() { final ResidentRunner residentWebRunner = setUpResidentRunner( flutterDevice, logger: logger, - systemClock: SystemClock.fixed(DateTime(2001, 1, 1)), + systemClock: SystemClock.fixed(DateTime(2001)), ); fakeVmServiceHost = FakeVmServiceHost(requests :kAttachExpectations); _setupMocks(); @@ -637,7 +632,7 @@ void main() { final ResidentRunner residentWebRunner = setUpResidentRunner(flutterDevice); fakeVmServiceHost = FakeVmServiceHost(requests: []); _setupMocks(); - webDevFS.report = UpdateFSReport(success: false, syncedBytes: 0); + webDevFS.report = UpdateFSReport(); final Completer connectionInfoCompleter = Completer(); unawaited(residentWebRunner.run( @@ -694,7 +689,7 @@ void main() { connectionInfoCompleter: connectionInfoCompleter, )); await connectionInfoCompleter.future; - webDevFS.report = UpdateFSReport(success: false, syncedBytes: 0); + webDevFS.report = UpdateFSReport(); final OperationResult result = await residentWebRunner.restart(fullRestart: true); @@ -726,7 +721,7 @@ void main() { )); await connectionInfoCompleter.future; - final OperationResult result = await residentWebRunner.restart(fullRestart: false); + final OperationResult result = await residentWebRunner.restart(); expect(result.code, 0); }, overrides: { @@ -750,7 +745,7 @@ void main() { connectionInfoCompleter: connectionInfoCompleter, )); await connectionInfoCompleter.future; - final OperationResult result = await residentWebRunner.restart(fullRestart: false); + final OperationResult result = await residentWebRunner.restart(); expect(result.code, 1); expect(result.message, @@ -854,7 +849,7 @@ void main() { fileSystem: fileSystem, chromiumLauncher: chromiumLauncher, logger: logger, - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: FakeProcessManager.any(), ); webDevFS.baseUri = Uri.parse('http://localhost:8765/app/'); @@ -867,7 +862,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: logger, @@ -911,7 +905,6 @@ void main() { flutterProject: FlutterProject.fromDirectoryTest(fileSystem.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ipv6: true, - stayResident: true, urlTunneller: null, fileSystem: fileSystem, logger: logger, @@ -1061,7 +1054,6 @@ ResidentRunner setUpResidentRunner(FlutterDevice flutterDevice, { flutterProject: FlutterProject.fromDirectoryTest(globals.fs.currentDirectory), debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), ipv6: true, - stayResident: true, urlTunneller: null, usage: globals.flutterUsage, systemClock: systemClock ?? SystemClock.fixed(DateTime.now()), @@ -1305,7 +1297,6 @@ class FakeFlutterDevice extends Fake implements FlutterDevice { Uri testUri; UpdateFSReport report = UpdateFSReport( success: true, - syncedBytes: 0, invalidatedSourcesCount: 1, ); Object reportError; diff --git a/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart b/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart index 8e3e503bed..e770c183fd 100644 --- a/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart +++ b/packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart @@ -55,7 +55,7 @@ void main() { }); testUsingContext('honors shouldUpdateCache false', () async { - final DummyFlutterCommand flutterCommand = DummyFlutterCommand(shouldUpdateCache: false); + final DummyFlutterCommand flutterCommand = DummyFlutterCommand(); await flutterCommand.run(); expect(cache.artifacts, isEmpty); diff --git a/packages/flutter_tools/test/general.shard/runner/runner_test.dart b/packages/flutter_tools/test/general.shard/runner/runner_test.dart index f460fe6a33..752ffd13d0 100644 --- a/packages/flutter_tools/test/general.shard/runner/runner_test.dart +++ b/packages/flutter_tools/test/general.shard/runner/runner_test.dart @@ -190,8 +190,7 @@ void main() { environment: { 'FLUTTER_ANALYTICS_LOG_FILE': 'test', 'FLUTTER_ROOT': '/', - }, - operatingSystem: 'linux' + } ), FileSystem: () => MemoryFileSystem.test(), ProcessManager: () => FakeProcessManager.any(), diff --git a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart index 986ed07033..bc86f07a01 100644 --- a/packages/flutter_tools/test/general.shard/terminal_handler_test.dart +++ b/packages/flutter_tools/test/general.shard/terminal_handler_test.dart @@ -791,9 +791,7 @@ void main() { }); testWithoutContext('v - launchDevToolsInBrowser', () async { - final TerminalHandler terminalHandler = setUpTerminalHandler( - [], - supportsServiceProtocol: true); + final TerminalHandler terminalHandler = setUpTerminalHandler([]); final FakeResidentRunner runner = terminalHandler.residentRunner as FakeResidentRunner; final FakeResidentDevtoolsHandler devtoolsHandler = runner.residentDevtoolsHandler as FakeResidentDevtoolsHandler; @@ -1007,7 +1005,7 @@ void main() { 'enabled': 'true', }, ) - ], logger: logger, supportsScreenshot: false, fileSystem: fileSystem); + ], logger: logger, fileSystem: fileSystem); await terminalHandler.processTerminalInput('s'); @@ -1041,7 +1039,7 @@ void main() { 'enabled': 'true', }, ) - ], logger: logger, supportsScreenshot: false, web: true, fileSystem: fileSystem); + ], logger: logger, web: true, fileSystem: fileSystem); await terminalHandler.processTerminalInput('s'); @@ -1072,7 +1070,6 @@ void main() { final TerminalHandler terminalHandler = setUpTerminalHandler( [], logger: logger, - supportsScreenshot: false, supportsServiceProtocol: false, fileSystem: fileSystem, ); @@ -1089,7 +1086,6 @@ void main() { final TerminalHandler terminalHandler = setUpTerminalHandler( [], logger: logger, - supportsScreenshot: false, supportsServiceProtocol: false, web: true, fileSystem: fileSystem, @@ -1118,7 +1114,6 @@ void main() { ), ], logger: logger, - supportsScreenshot: false, fileSystem: fileSystem, ); @@ -1154,7 +1149,6 @@ void main() { ), ], logger: logger, - supportsScreenshot: false, fileSystem: fileSystem, ); @@ -1190,7 +1184,6 @@ void main() { ), ], logger: logger, - supportsScreenshot: false, web: true, fileSystem: fileSystem, ); diff --git a/packages/flutter_tools/test/general.shard/test/test_compiler_test.dart b/packages/flutter_tools/test/general.shard/test/test_compiler_test.dart index 5eebf9611f..f2eced8994 100644 --- a/packages/flutter_tools/test/general.shard/test/test_compiler_test.dart +++ b/packages/flutter_tools/test/general.shard/test/test_compiler_test.dart @@ -20,7 +20,6 @@ import '../../src/common.dart'; import '../../src/context.dart'; final Platform linuxPlatform = FakePlatform( - operatingSystem: 'linux', environment: {}, ); diff --git a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart index 0e70e08122..f4e7ae8acf 100644 --- a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart +++ b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart @@ -82,7 +82,7 @@ void main() { TestBuildSystem buildSystem; final Map startOverrides = { - Platform: () => FakePlatform(operatingSystem: 'linux'), + Platform: () => FakePlatform(), FileSystem: () => fileSystem, ProcessManager: () => fakeProcessManager, Artifacts: () => Artifacts.test(), diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index a891edc139..ba1ef1c223 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -19,7 +19,7 @@ import '../src/common.dart'; import '../src/context.dart'; import '../src/fake_process_manager.dart'; -final SystemClock _testClock = SystemClock.fixed(DateTime(2015, 1, 1)); +final SystemClock _testClock = SystemClock.fixed(DateTime(2015)); final DateTime _stampUpToDate = _testClock.ago(checkAgeConsideredUpToDate ~/ 2); final DateTime _stampOutOfDate = _testClock.ago(checkAgeConsideredUpToDate * 2); @@ -477,7 +477,7 @@ void main() { [ const FakeCommand( command: ['git', 'tag', '--points-at', 'HEAD'], - stdout: '', // no tag + // no output, since there's no tag ), const FakeCommand( command: ['git', 'describe', '--match', '*.*.*', '--long', '--tags', 'HEAD'], diff --git a/packages/flutter_tools/test/general.shard/vscode/vscode_test.dart b/packages/flutter_tools/test/general.shard/vscode/vscode_test.dart index 2e7b3cfbe2..2998f90cef 100644 --- a/packages/flutter_tools/test/general.shard/vscode/vscode_test.dart +++ b/packages/flutter_tools/test/general.shard/vscode/vscode_test.dart @@ -44,7 +44,7 @@ void main() { testWithoutContext('can locate VS Code installed via Snap', () { final FileSystem fileSystem = MemoryFileSystem.test(); const String home = '/home/me'; - final Platform platform = FakePlatform(operatingSystem: 'linux', environment: {'HOME': home}); + final Platform platform = FakePlatform(environment: {'HOME': home}); fileSystem.directory(fileSystem.path.join('/snap/code/current/', '.vscode')).createSync(recursive: true); diff --git a/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart b/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart index 6e5475e230..af2e5d36cd 100644 --- a/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart +++ b/packages/flutter_tools/test/general.shard/web/devfs_web_test.dart @@ -48,7 +48,7 @@ void main() { setUp(() { httpServer = FakeHttpServer(); - linux = FakePlatform(operatingSystem: 'linux', environment: {}); + linux = FakePlatform(environment: {}); windows = FakePlatform(operatingSystem: 'windows', environment: {}); testbed = Testbed(setup: () { webAssetServer = WebAssetServer( @@ -741,7 +741,6 @@ void main() { BuildMode.debug, '', treeShakeIcons: false, - nullSafetyMode: NullSafetyMode.sound, ), enableDwds: false, enableDds: false, diff --git a/packages/flutter_tools/test/general.shard/web/devices_test.dart b/packages/flutter_tools/test/general.shard/web/devices_test.dart index d17f9992d5..617d83b8fb 100644 --- a/packages/flutter_tools/test/general.shard/web/devices_test.dart +++ b/packages/flutter_tools/test/general.shard/web/devices_test.dart @@ -19,11 +19,10 @@ import '../../src/fakes.dart'; void main() { testWithoutContext('No web devices listed if feature is disabled', () async { final WebDevices webDevices = WebDevices( - featureFlags: TestFeatureFlags(isWebEnabled: false), + featureFlags: TestFeatureFlags(), fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.any(), @@ -37,7 +36,7 @@ void main() { chromiumLauncher: null, fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), processManager: FakeProcessManager.any(), ); @@ -114,7 +113,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.any(), @@ -130,7 +128,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.any(), @@ -147,7 +144,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: processManager, @@ -164,7 +160,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.any(), @@ -181,7 +176,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.any(), @@ -206,7 +200,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: processManager, @@ -280,7 +273,7 @@ void main() { fileSystem: MemoryFileSystem.test(), platform: platform, processManager: processManager, - operatingSystemUtils: null, + operatingSystemUtils: FakeOperatingSystemUtils(), browserFinder: findChromeExecutable, logger: BufferLogger.test(), ); @@ -339,7 +332,6 @@ void main() { fileSystem: MemoryFileSystem.test(), logger: BufferLogger.test(), platform: FakePlatform( - operatingSystem: 'linux', environment: {} ), processManager: FakeProcessManager.empty(), diff --git a/packages/flutter_tools/test/general.shard/web/web_asset_server_test.dart b/packages/flutter_tools/test/general.shard/web/web_asset_server_test.dart index c8c561fc49..38764b78b7 100644 --- a/packages/flutter_tools/test/general.shard/web/web_asset_server_test.dart +++ b/packages/flutter_tools/test/general.shard/web/web_asset_server_test.dart @@ -22,7 +22,6 @@ const List kTransparentImage = [ ]; final Platform platform = FakePlatform( - operatingSystem: 'linux', environment: { 'HOME': '/' }, diff --git a/packages/flutter_tools/test/general.shard/web/workflow_test.dart b/packages/flutter_tools/test/general.shard/web/workflow_test.dart index 3d291cf8ac..ab6c6fbfaf 100644 --- a/packages/flutter_tools/test/general.shard/web/workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/web/workflow_test.dart @@ -11,7 +11,7 @@ import '../../src/fakes.dart'; void main() { testWithoutContext('WebWorkflow applies on Linux', () { final WebWorkflow workflow = WebWorkflow( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), featureFlags: TestFeatureFlags(isWebEnabled: true), ); @@ -56,7 +56,7 @@ void main() { testWithoutContext('WebWorkflow does not apply if feature flag is disabled', () { final WebWorkflow workflow = WebWorkflow( - platform: FakePlatform(operatingSystem: 'linux'), + platform: FakePlatform(), featureFlags: TestFeatureFlags(), ); diff --git a/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart b/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart index 67f2d11326..4646884aec 100644 --- a/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart +++ b/packages/flutter_tools/test/general.shard/windows/windows_device_test.dart @@ -73,10 +73,10 @@ void main() { testWithoutContext('WindowsDevices does not list devices if the workflow is unsupported', () async { expect(await WindowsDevices( windowsWorkflow: WindowsWorkflow( - featureFlags: TestFeatureFlags(isWindowsEnabled: false), + featureFlags: TestFeatureFlags(), platform: FakePlatform(operatingSystem: 'windows'), ), - featureFlags: TestFeatureFlags(isWindowsEnabled: false), + featureFlags: TestFeatureFlags(), operatingSystemUtils: FakeOperatingSystemUtils(), logger: BufferLogger.test(), processManager: FakeProcessManager.any(), diff --git a/packages/flutter_tools/test/general.shard/windows/windows_workflow_test.dart b/packages/flutter_tools/test/general.shard/windows/windows_workflow_test.dart index d580127980..396cd7be0e 100644 --- a/packages/flutter_tools/test/general.shard/windows/windows_workflow_test.dart +++ b/packages/flutter_tools/test/general.shard/windows/windows_workflow_test.dart @@ -10,7 +10,7 @@ import '../../src/fakes.dart'; void main() { final FakePlatform windows = FakePlatform(operatingSystem: 'windows'); - final FakePlatform notWindows = FakePlatform(operatingSystem: 'linux'); + final FakePlatform notWindows = FakePlatform(); testWithoutContext('Windows workflow configuration when feature is enabled on Windows host machine', () { final WindowsWorkflow windowsWorkflow = WindowsWorkflow( @@ -27,7 +27,7 @@ void main() { testWithoutContext('Windows workflow configuration when feature is disabled on Windows host machine', () { final WindowsWorkflow windowsWorkflow = WindowsWorkflow( platform: windows, - featureFlags: TestFeatureFlags(isWindowsEnabled: false), + featureFlags: TestFeatureFlags(), ); expect(windowsWorkflow.appliesToHostPlatform, false); @@ -51,7 +51,7 @@ void main() { testWithoutContext('Windows workflow configuration when feature is disabled on non-Windows host machine', () { final WindowsWorkflow windowsWorkflow = WindowsWorkflow( platform: notWindows, - featureFlags: TestFeatureFlags(isWindowsEnabled: false), + featureFlags: TestFeatureFlags(), ); expect(windowsWorkflow.appliesToHostPlatform, false); diff --git a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart index 95bd0f4d59..c679cffd9b 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_once_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_once_test.dart @@ -266,7 +266,6 @@ int analyze() {} 'missing_return', ], exitMessageContains: '1 issue found.', - exitCode: 0, ); }); @@ -283,7 +282,6 @@ int analyze() {} 'missing_return', ], exitMessageContains: '1 issue found.', - exitCode: 0, ); }); diff --git a/packages/flutter_tools/test/integration.shard/plist_parser_test.dart b/packages/flutter_tools/test/integration.shard/plist_parser_test.dart index 1445c7eee3..3f43ed2874 100644 --- a/packages/flutter_tools/test/integration.shard/plist_parser_test.dart +++ b/packages/flutter_tools/test/integration.shard/plist_parser_test.dart @@ -13,6 +13,7 @@ import 'package:flutter_tools/src/base/terminal.dart'; import 'package:flutter_tools/src/ios/plist_parser.dart'; import '../src/common.dart'; +import '../src/fakes.dart'; import 'test_utils.dart'; const String base64PlistXml = @@ -46,7 +47,7 @@ void main() { outputPreferences: OutputPreferences.test(), terminal: AnsiTerminal( platform: const LocalPlatform(), - stdio: null, + stdio: FakeStdio(), ), ); parser = PlistParser( diff --git a/packages/flutter_tools/test/integration.shard/test_driver.dart b/packages/flutter_tools/test/integration.shard/test_driver.dart index c9a0e98eb6..b34061ec7f 100644 --- a/packages/flutter_tools/test/integration.shard/test_driver.dart +++ b/packages/flutter_tools/test/integration.shard/test_driver.dart @@ -613,7 +613,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { _vmServiceWsUri = Uri.parse(wsUriString); await connectToVmService(pauseOnExceptions: pauseOnExceptions); if (!startPaused) { - await resume(waitForNextPause: false); + await resume(); } } @@ -638,7 +638,7 @@ class FlutterRunTestDriver extends FlutterTestDriver { Future hotRestart({ bool pause = false, bool debounce = false}) => _restart(fullRestart: true, pause: pause); Future hotReload({ bool debounce = false, int debounceDurationOverrideMs }) => - _restart(fullRestart: false, debounce: debounce, debounceDurationOverrideMs: debounceDurationOverrideMs); + _restart(debounce: debounce, debounceDurationOverrideMs: debounceDurationOverrideMs); Future scheduleFrame() async { if (_currentRunningAppId == null) { @@ -807,7 +807,7 @@ class FlutterTestTestDriver extends FlutterTestDriver { if (beforeStart != null) { await beforeStart(); } - await resume(waitForNextPause: false); + await resume(); } } diff --git a/packages/flutter_tools/test/src/custom_devices_common.dart b/packages/flutter_tools/test/src/custom_devices_common.dart index 4e62ee3405..18c2178a23 100644 --- a/packages/flutter_tools/test/src/custom_devices_common.dart +++ b/packages/flutter_tools/test/src/custom_devices_common.dart @@ -43,9 +43,7 @@ const String testConfigForwardPortSuccessOutput = 'testforwardportsuccess\n'; final CustomDeviceConfig disabledTestConfig = testConfig.copyWith(enabled: false); final CustomDeviceConfig testConfigNonForwarding = testConfig.copyWith( explicitForwardPortCommand: true, - forwardPortCommand: null, explicitForwardPortSuccessRegex: true, - forwardPortSuccessRegex: null, ); const Map testConfigJson = { diff --git a/packages/flutter_tools/test/src/fake_process_manager.dart b/packages/flutter_tools/test/src/fake_process_manager.dart index b064a3d3bc..43d232f8b2 100644 --- a/packages/flutter_tools/test/src/fake_process_manager.dart +++ b/packages/flutter_tools/test/src/fake_process_manager.dart @@ -368,11 +368,6 @@ class _FakeAnyProcessManager extends FakeProcessManager { workingDirectory: workingDirectory, environment: environment, encoding: encoding, - duration: Duration.zero, - exitCode: 0, - stdout: '', - stderr: '', - outputFollowsExit: false, ); } diff --git a/packages/flutter_tools/test/web.shard/chrome_test.dart b/packages/flutter_tools/test/web.shard/chrome_test.dart index 10b1c25010..ada39d994e 100644 --- a/packages/flutter_tools/test/web.shard/chrome_test.dart +++ b/packages/flutter_tools/test/web.shard/chrome_test.dart @@ -541,8 +541,6 @@ void main() { await expectToolExitLater( chromiumLauncher.launch( 'example_url', - skipCheck: false, - headless: false, ), contains('Unable to connect to Chrome debug port:'), ); diff --git a/packages/flutter_tools/test/web.shard/vm_service_web_test.dart b/packages/flutter_tools/test/web.shard/vm_service_web_test.dart index 63f05fba54..d8c8e41a92 100644 --- a/packages/flutter_tools/test/web.shard/vm_service_web_test.dart +++ b/packages/flutter_tools/test/web.shard/vm_service_web_test.dart @@ -25,7 +25,7 @@ void main() { setUp(() async { tempDir = createResolvedTempDirectorySync('run_test.'); await project.setUpIn(tempDir); - flutter = FlutterRunTestDriver(tempDir, spawnDdsInstance: true); + flutter = FlutterRunTestDriver(tempDir); }); tearDown(() async { diff --git a/packages/flutter_web_plugins/test/plugin_registry_test.dart b/packages/flutter_web_plugins/test/plugin_registry_test.dart index 73cb681e07..1c158e9705 100644 --- a/packages/flutter_web_plugins/test/plugin_registry_test.dart +++ b/packages/flutter_web_plugins/test/plugin_registry_test.dart @@ -44,7 +44,7 @@ void main() { TestPlugin.calledMethods.clear(); const MethodChannel frameworkChannel = - MethodChannel('test_plugin', StandardMethodCodec()); + MethodChannel('test_plugin'); frameworkChannel.invokeMethod('test1'); expect(TestPlugin.calledMethods, equals(['test1'])); @@ -57,7 +57,7 @@ void main() { ServicesBinding.instance!.defaultBinaryMessenger .setMessageHandler('test_send', (ByteData? data) { loggedMessages.add(codec.decodeMessage(data)! as String); - return Future.value(null); + return Future.value(); }); await pluginBinaryMessenger.send( diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart index cb55ec05e8..29000213ac 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart @@ -46,7 +46,6 @@ Future _waitAndConnect( final vms.VmService service = vms.VmService( controller.stream, socket.add, - log: null, disposeHandler: () => socket.close(), streamClosed: streamClosedCompleter.future ); diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart index 409c2d9d5f..a40e4727b5 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart @@ -260,8 +260,7 @@ class FuchsiaRemoteConnection { if (event.eventType == DartVmEventType.started) { _log.fine('New VM found on port: ${event.servicePort}. Searching ' 'for Isolate: $pattern'); - final DartVm? vmService = await _getDartVm(event.uri, - timeout: _kDartVmConnectionTimeout); + final DartVm? vmService = await _getDartVm(event.uri); // If the VM service is null, set the result to the empty list. final List result = await vmService?.getMainIsolatesByPattern(pattern!) ?? []; if (result.isNotEmpty) {