From d261411b4c3bfb8591f352e3842f64005ba75505 Mon Sep 17 00:00:00 2001 From: Sangam Shrestha <2shrestha22@gmail.com> Date: Fri, 14 Mar 2025 23:35:20 +0545 Subject: [PATCH] Remove redundant `useMaterial3: true` (#163376) This PR removes redundant useMaterial3: true as described in https://github.com/flutter/flutter/issues/162818 *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* - https://github.com/flutter/flutter/issues/162818 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md --------- Co-authored-by: Qun Cheng <36861262+QuncCccccc@users.noreply.github.com> --- .../complex_layout/lib/src/app.dart | 2 +- .../platform_views_layout/lib/main.dart | 6 +- .../lib/main_ad_banners.dart | 1 - .../lib/main_bottom_ad_banner.dart | 1 - .../platform_views_layout/lib/main_hcpp.dart | 6 +- .../lib/main_non_intersecting.dart | 6 +- .../lib/main.dart | 6 +- .../lib/demo/fortnightly/fortnightly.dart | 2 +- .../flutter_gallery/lib/demo/shrine/app.dart | 2 +- .../new_gallery/lib/studies/crane/theme.dart | 2 +- .../lib/studies/fortnightly/shared.dart | 2 +- .../new_gallery/lib/studies/reply/app.dart | 2 +- .../new_gallery/lib/studies/shrine/theme.dart | 2 +- .../action_buttons/action_icon_theme.0.dart | 1 - .../material/action_chip/action_chip.0.dart | 2 +- .../animated_icon/animated_icon.0.dart | 2 +- .../animated_icon/animated_icons_data.0.dart | 2 +- .../api/lib/material/app_bar/app_bar.1.dart | 2 +- .../api/lib/material/app_bar/app_bar.3.dart | 2 +- .../material/app_bar/sliver_app_bar.2.dart | 2 +- .../material/app_bar/sliver_app_bar.3.dart | 2 +- .../bottom_app_bar/bottom_app_bar.2.dart | 1 - .../show_modal_bottom_sheet.1.dart | 2 +- .../material/button_style/button_style.0.dart | 2 +- .../api/lib/material/checkbox/checkbox.1.dart | 2 +- .../checkbox_list_tile.0.dart | 2 +- .../checkbox_list_tile.1.dart | 2 +- .../custom_labeled_checkbox.0.dart | 2 +- .../custom_labeled_checkbox.1.dart | 2 +- .../material/choice_chip/choice_chip.0.dart | 2 +- .../color_scheme/dynamic_content_color.0.dart | 2 +- .../dialog/adaptive_alert_dialog.0.dart | 2 +- .../lib/material/dialog/alert_dialog.1.dart | 2 +- .../lib/material/dialog/show_dialog.1.dart | 2 +- .../api/lib/material/divider/divider.1.dart | 2 +- .../material/divider/vertical_divider.1.dart | 2 +- .../api/lib/material/drawer/drawer.0.dart | 2 +- .../dropdown_menu/dropdown_menu.0.dart | 2 +- .../dropdown_menu/dropdown_menu.1.dart | 1 - .../expansion_tile/expansion_tile.0.dart | 1 - .../expansion_tile/expansion_tile.1.dart | 1 - .../filled_button/filled_button.0.dart | 2 +- .../material/filter_chip/filter_chip.0.dart | 1 - .../floating_action_button.0.dart | 5 +- .../floating_action_button.1.dart | 5 +- .../floating_action_button.2.dart | 5 +- .../material/icon_button/icon_button.2.dart | 2 +- .../material/icon_button/icon_button.3.dart | 2 +- .../lib/material/input_chip/input_chip.0.dart | 2 +- .../lib/material/input_chip/input_chip.1.dart | 5 +- .../input_decorator/input_decoration.0.dart | 1 - .../input_decorator/input_decoration.1.dart | 1 - .../input_decorator/input_decoration.2.dart | 1 - .../input_decorator/input_decoration.3.dart | 1 - ...coration.floating_label_style_error.0.dart | 1 - .../input_decoration.helper.0.dart | 1 - .../input_decoration.label.0.dart | 1 - .../input_decoration.label_style_error.0.dart | 1 - .../input_decoration.prefix_icon.0.dart | 5 +- ..._decoration.prefix_icon_constraints.0.dart | 1 - .../input_decoration.suffix_icon.0.dart | 5 +- ..._decoration.suffix_icon_constraints.0.dart | 1 - .../input_decoration.widget_state.0.dart | 1 - .../input_decoration.widget_state.1.dart | 1 - .../list_tile/custom_list_item.1.dart | 2 +- .../lib/material/list_tile/list_tile.0.dart | 5 +- .../lib/material/list_tile/list_tile.1.dart | 2 +- .../lib/material/list_tile/list_tile.2.dart | 2 +- .../lib/material/list_tile/list_tile.3.dart | 2 +- .../lib/material/list_tile/list_tile.4.dart | 2 +- .../list_tile/list_tile.selected.0.dart | 2 +- .../material/menu_anchor/menu_anchor.1.dart | 5 +- .../menu_anchor/radio_menu_button.0.dart | 5 +- .../navigation_bar/navigation_bar.0.dart | 2 +- .../navigation_drawer.0.dart | 6 +- .../page_transitions_theme.1.dart | 1 - .../lib/material/popup_menu/popup_menu.1.dart | 2 +- .../circular_progress_indicator.1.dart | 2 +- .../custom_labeled_radio.0.dart | 1 - .../custom_labeled_radio.1.dart | 1 - .../radio_list_tile/radio_list_tile.0.dart | 1 - .../radio_list_tile/radio_list_tile.1.dart | 2 +- .../radio_list_tile.toggleable.0.dart | 1 - .../reorderable_list_view.2.dart | 1 - .../search_anchor/search_anchor.0.dart | 2 +- .../search_anchor/search_anchor.1.dart | 2 +- .../search_anchor/search_anchor.2.dart | 3 - .../material/search_anchor/search_bar.0.dart | 5 +- .../segmented_button/segmented_button.0.dart | 5 +- .../selection_area/selection_area.1.dart | 5 +- .../selection_area/selection_area.2.dart | 5 +- .../lib/material/snack_bar/snack_bar.2.dart | 2 +- .../api/lib/material/switch/switch.0.dart | 1 - .../api/lib/material/switch/switch.1.dart | 1 - .../api/lib/material/switch/switch.2.dart | 1 - .../api/lib/material/switch/switch.3.dart | 2 +- .../custom_labeled_switch.0.dart | 1 - .../custom_labeled_switch.1.dart | 1 - .../switch_list_tile/switch_list_tile.0.dart | 1 - .../switch_list_tile/switch_list_tile.1.dart | 1 - examples/api/lib/material/tabs/tab_bar.0.dart | 2 +- examples/api/lib/material/tabs/tab_bar.1.dart | 2 +- examples/api/lib/material/tabs/tab_bar.2.dart | 2 +- .../lib/material/text_field/text_field.2.dart | 2 +- .../lib/material/theme/theme_extension.1.dart | 6 +- .../toggle_buttons/toggle_buttons.0.dart | 5 +- .../toggle_buttons/toggle_buttons.1.dart | 5 +- .../linear_border/linear_border.0.dart | 5 +- ...chrome.set_system_u_i_overlay_style.0.dart | 5 +- ...chrome.set_system_u_i_overlay_style.1.dart | 5 +- .../implicit_animations/animated_slide.0.dart | 2 +- .../raw_menu_anchor/raw_menu_anchor.0.dart | 1 - .../scroll_notification_observer.0.dart | 1 - .../scroll_controller_notification.0.dart | 5 +- .../widgets/sliver/decorated_sliver.1.dart | 5 +- examples/api/lib/widgets/text/text.0.dart | 6 +- .../text_magnifier/text_magnifier.0.dart | 1 - .../floating_action_button.1_test.dart | 2 +- .../floating_action_button.2_test.dart | 2 +- .../theme/theme_extension.1_test.dart | 6 +- .../toggle_buttons/toggle_buttons.1_test.dart | 4 +- .../gradient/linear_gradient.0_test.dart | 5 +- examples/layers/widgets/sectors.dart | 1 - examples/layers/widgets/styled_text.dart | 1 - packages/flutter/lib/src/material/app.dart | 2 +- .../flutter/test/material/about_test.dart | 36 +++------ .../material/action_icons_theme_test.dart | 2 +- .../test/material/app_bar_sliver_test.dart | 8 +- .../flutter/test/material/app_bar_test.dart | 55 ++++---------- .../test/material/app_bar_theme_test.dart | 18 +---- packages/flutter/test/material/app_test.dart | 10 +-- .../test/material/autocomplete_test.dart | 6 +- .../test/material/back_button_test.dart | 20 ++--- .../flutter/test/material/badge_test.dart | 17 ++--- .../test/material/badge_theme_test.dart | 2 +- .../test/material/banner_theme_test.dart | 4 +- .../test/material/bottom_app_bar_test.dart | 26 +++---- .../material/bottom_app_bar_theme_test.dart | 10 +-- .../test/material/bottom_sheet_test.dart | 28 ++----- .../material/bottom_sheet_theme_test.dart | 3 +- .../material/calendar_date_picker_test.dart | 2 - .../test/material/card_theme_test.dart | 6 +- .../material/checkbox_list_tile_test.dart | 6 +- .../flutter/test/material/checkbox_test.dart | 20 ++--- packages/flutter/test/material/chip_test.dart | 12 +-- .../test/material/chip_theme_test.dart | 2 +- .../test/material/choice_chip_test.dart | 2 - .../test/material/data_table_test.dart | 2 +- .../test/material/date_picker_test.dart | 4 +- .../test/material/date_picker_theme_test.dart | 16 ++-- .../test/material/date_range_picker_test.dart | 16 ++-- .../flutter/test/material/dialog_test.dart | 2 +- .../test/material/dialog_theme_test.dart | 18 +---- .../flutter/test/material/divider_test.dart | 11 +-- .../test/material/divider_theme_test.dart | 12 +-- .../test/material/drawer_button_test.dart | 10 +-- .../flutter/test/material/drawer_test.dart | 20 ++--- .../test/material/drawer_theme_test.dart | 4 +- .../test/material/elevated_button_test.dart | 8 +- .../material/elevated_button_theme_test.dart | 7 +- .../test/material/expansion_tile_test.dart | 2 +- .../test/material/filled_button_test.dart | 10 +-- .../material/floating_action_button_test.dart | 2 +- .../floating_action_button_theme_test.dart | 6 +- .../test/material/icon_button_test.dart | 76 +++++++++---------- .../test/material/icon_button_theme_test.dart | 8 +- .../test/material/ink_sparkle_test.dart | 1 - .../flutter/test/material/list_tile_test.dart | 37 ++------- .../test/material/list_tile_theme_test.dart | 3 - .../flutter/test/material/material_test.dart | 20 ++--- .../test/material/navigation_bar_test.dart | 6 +- .../material/navigation_bar_theme_test.dart | 1 - .../test/material/navigation_drawer_test.dart | 5 +- .../test/material/navigation_rail_test.dart | 7 +- .../material/navigation_rail_theme_test.dart | 2 +- .../test/material/outlined_button_test.dart | 8 +- .../material/outlined_button_theme_test.dart | 7 +- packages/flutter/test/material/page_test.dart | 1 - .../material/page_transitions_theme_test.dart | 1 - .../material/paginated_data_table_test.dart | 2 +- .../test/material/popup_menu_test.dart | 10 +-- .../test/material/popup_menu_theme_test.dart | 8 +- .../material/progress_indicator_test.dart | 4 +- .../test/material/radio_list_tile_test.dart | 5 +- .../flutter/test/material/radio_test.dart | 13 ++-- .../test/material/range_slider_test.dart | 6 +- .../test/material/refresh_indicator_test.dart | 1 - .../flutter/test/material/scaffold_test.dart | 2 +- .../test/material/search_anchor_test.dart | 14 ++-- .../test/material/search_bar_theme_test.dart | 1 - .../test/material/search_view_theme_test.dart | 1 - .../test/material/segmented_button_test.dart | 10 +-- .../material/segmented_button_theme_test.dart | 7 +- .../flutter/test/material/slider_test.dart | 10 +-- .../test/material/slider_theme_test.dart | 4 +- .../flutter/test/material/snack_bar_test.dart | 52 +++++-------- .../test/material/snack_bar_theme_test.dart | 2 +- .../flutter/test/material/stepper_test.dart | 14 ++-- .../test/material/switch_list_tile_test.dart | 11 +-- .../flutter/test/material/switch_test.dart | 38 +++++----- .../test/material/switch_theme_test.dart | 5 -- .../test/material/tab_bar_theme_test.dart | 35 +++------ packages/flutter/test/material/tabs_test.dart | 30 +++----- .../test/material/text_button_test.dart | 10 +-- .../test/material/text_button_theme_test.dart | 7 +- .../test/material/text_field_splash_test.dart | 4 +- .../test/material/text_field_test.dart | 6 +- .../material/text_selection_theme_test.dart | 2 +- .../material/text_selection_toolbar_test.dart | 2 +- ...xt_selection_toolbar_text_button_test.dart | 2 +- .../test/material/theme_data_test.dart | 32 ++++---- .../test/material/theme_defaults_test.dart | 4 +- .../flutter/test/material/theme_test.dart | 34 +++------ .../test/material/time_picker_test.dart | 5 +- .../test/material/time_picker_theme_test.dart | 6 +- .../test/material/typography_test.dart | 4 +- .../test/rendering/localized_fonts_test.dart | 3 - .../test/widgets/backdrop_filter_test.dart | 2 - .../test/widgets/editable_text_test.dart | 2 +- .../widgets/implicit_animations_test.dart | 2 +- .../flutter/test/widgets/page_view_test.dart | 2 - .../flutter/test/widgets/scrollable_test.dart | 2 +- .../test/widgets/two_dimensional_utils.dart | 1 - .../test/basics_test.dart | 1 - .../test/material/date_picker_test.dart | 3 - .../flutter_localizations/test/text_test.dart | 2 - .../flutter_test/test/accessibility_test.dart | 1 - 227 files changed, 464 insertions(+), 898 deletions(-) diff --git a/dev/benchmarks/complex_layout/lib/src/app.dart b/dev/benchmarks/complex_layout/lib/src/app.dart index 43328d9132..8a8f70d0af 100644 --- a/dev/benchmarks/complex_layout/lib/src/app.dart +++ b/dev/benchmarks/complex_layout/lib/src/app.dart @@ -23,7 +23,7 @@ class ComplexLayoutAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: lightTheme ? ThemeData.light() : ThemeData.dark(), + theme: lightTheme ? ThemeData() : ThemeData.dark(), title: 'Advanced Layout', home: scrollMode == ScrollMode.complex diff --git a/dev/benchmarks/platform_views_layout/lib/main.dart b/dev/benchmarks/platform_views_layout/lib/main.dart index 377859b670..ce2597e668 100644 --- a/dev/benchmarks/platform_views_layout/lib/main.dart +++ b/dev/benchmarks/platform_views_layout/lib/main.dart @@ -20,11 +20,7 @@ class PlatformViewApp extends StatefulWidget { class PlatformViewAppState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(), - title: 'Advanced Layout', - home: const PlatformViewLayout(), - ); + return const MaterialApp(title: 'Advanced Layout', home: PlatformViewLayout()); } } diff --git a/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart b/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart index 077e32102c..d1bc05b7da 100644 --- a/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart +++ b/dev/benchmarks/platform_views_layout/lib/main_ad_banners.dart @@ -40,7 +40,6 @@ class PlatformViewAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData.light(), title: 'Advanced Layout', home: Scaffold( appBar: AppBar(title: const Text('Platform View Ad Banners')), diff --git a/dev/benchmarks/platform_views_layout/lib/main_bottom_ad_banner.dart b/dev/benchmarks/platform_views_layout/lib/main_bottom_ad_banner.dart index a829aaad69..6dd754bf04 100644 --- a/dev/benchmarks/platform_views_layout/lib/main_bottom_ad_banner.dart +++ b/dev/benchmarks/platform_views_layout/lib/main_bottom_ad_banner.dart @@ -44,7 +44,6 @@ class PlatformViewAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData.light(), title: 'Advanced Layout', home: Scaffold( appBar: AppBar(title: const Text('Platform View Bottom Ad Banner')), diff --git a/dev/benchmarks/platform_views_layout/lib/main_hcpp.dart b/dev/benchmarks/platform_views_layout/lib/main_hcpp.dart index e50212e0eb..ba23f62e58 100644 --- a/dev/benchmarks/platform_views_layout/lib/main_hcpp.dart +++ b/dev/benchmarks/platform_views_layout/lib/main_hcpp.dart @@ -22,11 +22,7 @@ class PlatformViewApp extends StatefulWidget { class PlatformViewAppState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(), - title: 'Advanced Layout', - home: const PlatformViewLayout(), - ); + return const MaterialApp(title: 'Advanced Layout', home: PlatformViewLayout()); } } diff --git a/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart b/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart index 13ad272be9..c6c8345717 100644 --- a/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart +++ b/dev/benchmarks/platform_views_layout/lib/main_non_intersecting.dart @@ -20,11 +20,7 @@ class PlatformViewApp extends StatefulWidget { class PlatformViewAppState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(), - title: 'Advanced Layout', - home: const PlatformViewLayout(), - ); + return const MaterialApp(title: 'Advanced Layout', home: PlatformViewLayout()); } } diff --git a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart index 418f687996..c4d00ccd1c 100644 --- a/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart +++ b/dev/benchmarks/platform_views_layout_hybrid_composition/lib/main.dart @@ -24,11 +24,7 @@ class PlatformViewApp extends StatefulWidget { class PlatformViewAppState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(), - title: 'Advanced Layout', - home: const PlatformViewLayout(), - ); + return const MaterialApp(title: 'Advanced Layout', home: PlatformViewLayout()); } } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/fortnightly/fortnightly.dart b/dev/integration_tests/flutter_gallery/lib/demo/fortnightly/fortnightly.dart index 31ef979ed8..e865499f68 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/fortnightly/fortnightly.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/fortnightly/fortnightly.dart @@ -176,7 +176,7 @@ over water meant for the whole central valley of California? The story will shoc final ThemeData _fortnightlyTheme = _buildFortnightlyTheme(); ThemeData _buildFortnightlyTheme() { - final ThemeData base = ThemeData.light(); + final ThemeData base = ThemeData(); return base.copyWith( primaryTextTheme: _buildTextTheme(base.primaryTextTheme), scaffoldBackgroundColor: Colors.white, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart index f7c6344912..476b324ca0 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart @@ -81,7 +81,7 @@ IconThemeData _customIconTheme(IconThemeData original) { } ThemeData _buildShrineTheme() { - final ThemeData base = ThemeData.light(); + final ThemeData base = ThemeData(); return base.copyWith( colorScheme: kShrineColorScheme, primaryColor: kShrinePink100, diff --git a/dev/integration_tests/new_gallery/lib/studies/crane/theme.dart b/dev/integration_tests/new_gallery/lib/studies/crane/theme.dart index a2fa16a01a..e57efa8459 100644 --- a/dev/integration_tests/new_gallery/lib/studies/crane/theme.dart +++ b/dev/integration_tests/new_gallery/lib/studies/crane/theme.dart @@ -15,7 +15,7 @@ IconThemeData _customIconTheme(IconThemeData original, Color color) { } ThemeData _buildCraneTheme() { - final ThemeData base = ThemeData.light(); + final ThemeData base = ThemeData(); return base.copyWith( colorScheme: const ColorScheme.light().copyWith( diff --git a/dev/integration_tests/new_gallery/lib/studies/fortnightly/shared.dart b/dev/integration_tests/new_gallery/lib/studies/fortnightly/shared.dart index 39c28a7947..93440b4a79 100644 --- a/dev/integration_tests/new_gallery/lib/studies/fortnightly/shared.dart +++ b/dev/integration_tests/new_gallery/lib/studies/fortnightly/shared.dart @@ -509,7 +509,7 @@ List buildVideoPreviewItems(BuildContext context) { } ThemeData buildTheme(BuildContext context) { - final TextTheme lightTextTheme = ThemeData.light().textTheme; + final TextTheme lightTextTheme = ThemeData().textTheme; return ThemeData( scaffoldBackgroundColor: Colors.white, appBarTheme: AppBarTheme( diff --git a/dev/integration_tests/new_gallery/lib/studies/reply/app.dart b/dev/integration_tests/new_gallery/lib/studies/reply/app.dart index 4d68ff3b36..fa1b74c2f1 100644 --- a/dev/integration_tests/new_gallery/lib/studies/reply/app.dart +++ b/dev/integration_tests/new_gallery/lib/studies/reply/app.dart @@ -150,7 +150,7 @@ class _RestorableEmailState extends RestorableListenable { } ThemeData _buildReplyLightTheme(BuildContext context) { - final ThemeData base = ThemeData.light(); + final ThemeData base = ThemeData(); return base.copyWith( bottomAppBarTheme: const BottomAppBarTheme(color: ReplyColors.blue700), bottomSheetTheme: BottomSheetThemeData( diff --git a/dev/integration_tests/new_gallery/lib/studies/shrine/theme.dart b/dev/integration_tests/new_gallery/lib/studies/shrine/theme.dart index 6cb0742095..68eed016e6 100644 --- a/dev/integration_tests/new_gallery/lib/studies/shrine/theme.dart +++ b/dev/integration_tests/new_gallery/lib/studies/shrine/theme.dart @@ -21,7 +21,7 @@ IconThemeData _customIconTheme(IconThemeData original) { } ThemeData _buildShrineTheme() { - final ThemeData base = ThemeData.light(); + final ThemeData base = ThemeData(); return base.copyWith( appBarTheme: const AppBarTheme(systemOverlayStyle: SystemUiOverlayStyle.dark, elevation: 0), scaffoldBackgroundColor: shrineBackgroundWhite, diff --git a/examples/api/lib/material/action_buttons/action_icon_theme.0.dart b/examples/api/lib/material/action_buttons/action_icon_theme.0.dart index 1466e88064..f5a45b1c93 100644 --- a/examples/api/lib/material/action_buttons/action_icon_theme.0.dart +++ b/examples/api/lib/material/action_buttons/action_icon_theme.0.dart @@ -38,7 +38,6 @@ class ActionIconThemeExampleApp extends StatelessWidget { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( - useMaterial3: true, actionIconTheme: ActionIconThemeData( backButtonIconBuilder: (BuildContext context) { return const Icon(Icons.arrow_back_ios_new_rounded); diff --git a/examples/api/lib/material/action_chip/action_chip.0.dart b/examples/api/lib/material/action_chip/action_chip.0.dart index 882cf0830a..c3835ca584 100644 --- a/examples/api/lib/material/action_chip/action_chip.0.dart +++ b/examples/api/lib/material/action_chip/action_chip.0.dart @@ -14,7 +14,7 @@ class ChipApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const ActionChipExample(), ); } diff --git a/examples/api/lib/material/animated_icon/animated_icon.0.dart b/examples/api/lib/material/animated_icon/animated_icon.0.dart index ef9318fb50..d096df1d6e 100644 --- a/examples/api/lib/material/animated_icon/animated_icon.0.dart +++ b/examples/api/lib/material/animated_icon/animated_icon.0.dart @@ -16,7 +16,7 @@ class AnimatedIconApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const Scaffold(body: AnimatedIconExample()), ); } diff --git a/examples/api/lib/material/animated_icon/animated_icons_data.0.dart b/examples/api/lib/material/animated_icon/animated_icons_data.0.dart index 2cae7b2e98..596b904ca4 100644 --- a/examples/api/lib/material/animated_icon/animated_icons_data.0.dart +++ b/examples/api/lib/material/animated_icon/animated_icons_data.0.dart @@ -33,7 +33,7 @@ class AnimatedIconApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const Scaffold(body: AnimatedIconExample()), ); } diff --git a/examples/api/lib/material/app_bar/app_bar.1.dart b/examples/api/lib/material/app_bar/app_bar.1.dart index 84ad94549b..c1167f4f73 100644 --- a/examples/api/lib/material/app_bar/app_bar.1.dart +++ b/examples/api/lib/material/app_bar/app_bar.1.dart @@ -16,7 +16,7 @@ class AppBarApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const AppBarExample(), ); } diff --git a/examples/api/lib/material/app_bar/app_bar.3.dart b/examples/api/lib/material/app_bar/app_bar.3.dart index 86972e78b6..61c46ab04f 100644 --- a/examples/api/lib/material/app_bar/app_bar.3.dart +++ b/examples/api/lib/material/app_bar/app_bar.3.dart @@ -16,7 +16,7 @@ class AppBarApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const AppBarExample(), ); } diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.2.dart b/examples/api/lib/material/app_bar/sliver_app_bar.2.dart index 782a5e9375..8caf3e2808 100644 --- a/examples/api/lib/material/app_bar/sliver_app_bar.2.dart +++ b/examples/api/lib/material/app_bar/sliver_app_bar.2.dart @@ -16,7 +16,7 @@ class AppBarMediumApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750A4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750A4)), home: Material( child: CustomScrollView( slivers: [ diff --git a/examples/api/lib/material/app_bar/sliver_app_bar.3.dart b/examples/api/lib/material/app_bar/sliver_app_bar.3.dart index f08cef8480..47ffb651bb 100644 --- a/examples/api/lib/material/app_bar/sliver_app_bar.3.dart +++ b/examples/api/lib/material/app_bar/sliver_app_bar.3.dart @@ -16,7 +16,7 @@ class AppBarLargeApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750A4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750A4)), home: Material( child: CustomScrollView( slivers: [ diff --git a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart index 06843725bc..d340689b8d 100644 --- a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart +++ b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart @@ -101,7 +101,6 @@ class _BottomAppBarDemoState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Bottom App Bar Demo')), body: Column( diff --git a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart index 4fb3243fb2..3c879f6a85 100644 --- a/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart +++ b/examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart @@ -14,7 +14,7 @@ class BottomSheetApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('Bottom Sheet Sample')), body: const BottomSheetExample(), diff --git a/examples/api/lib/material/button_style/button_style.0.dart b/examples/api/lib/material/button_style/button_style.0.dart index 23ee83c53f..fbba8cc87a 100644 --- a/examples/api/lib/material/button_style/button_style.0.dart +++ b/examples/api/lib/material/button_style/button_style.0.dart @@ -16,7 +16,7 @@ class ButtonApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), title: 'Button Types', home: const Scaffold(body: ButtonTypesExample()), ); diff --git a/examples/api/lib/material/checkbox/checkbox.1.dart b/examples/api/lib/material/checkbox/checkbox.1.dart index 9e521a3a32..b98438e343 100644 --- a/examples/api/lib/material/checkbox/checkbox.1.dart +++ b/examples/api/lib/material/checkbox/checkbox.1.dart @@ -14,7 +14,7 @@ class CheckboxExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), title: 'Checkbox Sample', home: Scaffold( appBar: AppBar(title: const Text('Checkbox Sample')), diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart index 60887e705e..5807415a13 100644 --- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart +++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart @@ -14,7 +14,7 @@ class CheckboxListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const CheckboxListTileExample()); + return const MaterialApp(home: CheckboxListTileExample()); } } diff --git a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart index 54ca959bd8..251ceec0e4 100644 --- a/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart +++ b/examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart @@ -13,7 +13,7 @@ class CheckboxListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const CheckboxListTileExample()); + return const MaterialApp(home: CheckboxListTileExample()); } } diff --git a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart index be1747cc46..bbba9308db 100644 --- a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart +++ b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart @@ -15,7 +15,7 @@ class LabeledCheckboxApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const LabeledCheckboxExample()); + return const MaterialApp(home: LabeledCheckboxExample()); } } diff --git a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart index 2c6825bb47..00616c5bd4 100644 --- a/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart +++ b/examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart @@ -13,7 +13,7 @@ class LabeledCheckboxApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const LabeledCheckboxExample()); + return const MaterialApp(home: LabeledCheckboxExample()); } } diff --git a/examples/api/lib/material/choice_chip/choice_chip.0.dart b/examples/api/lib/material/choice_chip/choice_chip.0.dart index 2d77587713..55e070d88e 100644 --- a/examples/api/lib/material/choice_chip/choice_chip.0.dart +++ b/examples/api/lib/material/choice_chip/choice_chip.0.dart @@ -14,7 +14,7 @@ class ChipApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const ActionChoiceExample(), ); } diff --git a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart index 5db60cc88d..4fc59c6b7e 100644 --- a/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart +++ b/examples/api/lib/material/color_scheme/dynamic_content_color.0.dart @@ -96,7 +96,7 @@ class _DynamicColorExampleState extends State { } return MaterialApp( - theme: ThemeData(useMaterial3: true, colorScheme: colorScheme), + theme: ThemeData(colorScheme: colorScheme), debugShowCheckedModeBanner: false, home: Builder( builder: diff --git a/examples/api/lib/material/dialog/adaptive_alert_dialog.0.dart b/examples/api/lib/material/dialog/adaptive_alert_dialog.0.dart index c1fd9bd9bf..c39675d804 100644 --- a/examples/api/lib/material/dialog/adaptive_alert_dialog.0.dart +++ b/examples/api/lib/material/dialog/adaptive_alert_dialog.0.dart @@ -16,7 +16,7 @@ class AdaptiveAlertDialogApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( // Try this: set the platform to TargetPlatform.android and see the difference - theme: ThemeData(platform: TargetPlatform.iOS, useMaterial3: true), + theme: ThemeData(platform: TargetPlatform.iOS), home: Scaffold( appBar: AppBar(title: const Text('AlertDialog Sample')), body: const Center(child: AdaptiveDialogExample()), diff --git a/examples/api/lib/material/dialog/alert_dialog.1.dart b/examples/api/lib/material/dialog/alert_dialog.1.dart index 649fcd6a30..79bfc42e25 100644 --- a/examples/api/lib/material/dialog/alert_dialog.1.dart +++ b/examples/api/lib/material/dialog/alert_dialog.1.dart @@ -14,7 +14,7 @@ class AlertDialogExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('AlertDialog Sample')), body: const Center(child: DialogExample()), diff --git a/examples/api/lib/material/dialog/show_dialog.1.dart b/examples/api/lib/material/dialog/show_dialog.1.dart index 1d2b2efdad..2eef68574a 100644 --- a/examples/api/lib/material/dialog/show_dialog.1.dart +++ b/examples/api/lib/material/dialog/show_dialog.1.dart @@ -14,7 +14,7 @@ class ShowDialogExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const DialogExample(), ); } diff --git a/examples/api/lib/material/divider/divider.1.dart b/examples/api/lib/material/divider/divider.1.dart index e06558b8cb..0278a2c64a 100644 --- a/examples/api/lib/material/divider/divider.1.dart +++ b/examples/api/lib/material/divider/divider.1.dart @@ -14,7 +14,7 @@ class DividerExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('Divider Sample')), body: const DividerExample(), diff --git a/examples/api/lib/material/divider/vertical_divider.1.dart b/examples/api/lib/material/divider/vertical_divider.1.dart index 24d3038f3b..8c11ed6612 100644 --- a/examples/api/lib/material/divider/vertical_divider.1.dart +++ b/examples/api/lib/material/divider/vertical_divider.1.dart @@ -14,7 +14,7 @@ class VerticalDividerExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('Divider Sample')), body: const DividerExample(), diff --git a/examples/api/lib/material/drawer/drawer.0.dart b/examples/api/lib/material/drawer/drawer.0.dart index 10b1c56c92..3c463a580c 100644 --- a/examples/api/lib/material/drawer/drawer.0.dart +++ b/examples/api/lib/material/drawer/drawer.0.dart @@ -13,7 +13,7 @@ class DrawerApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const DrawerExample()); + return const MaterialApp(home: DrawerExample()); } } diff --git a/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart b/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart index 0610c344ae..5d32110dd7 100644 --- a/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart +++ b/examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart @@ -77,7 +77,7 @@ class _DropdownMenuExampleState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: Colors.green), + theme: ThemeData(colorSchemeSeed: Colors.green), home: Scaffold( body: SafeArea( child: Column( diff --git a/examples/api/lib/material/dropdown_menu/dropdown_menu.1.dart b/examples/api/lib/material/dropdown_menu/dropdown_menu.1.dart index 12d556eb7a..25dbdac8bc 100644 --- a/examples/api/lib/material/dropdown_menu/dropdown_menu.1.dart +++ b/examples/api/lib/material/dropdown_menu/dropdown_menu.1.dart @@ -17,7 +17,6 @@ class DropdownMenuApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('DropdownMenu Sample')), body: const Center(child: DropdownMenuExample()), diff --git a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart index 987ea165d6..5512caf11f 100644 --- a/examples/api/lib/material/expansion_tile/expansion_tile.0.dart +++ b/examples/api/lib/material/expansion_tile/expansion_tile.0.dart @@ -14,7 +14,6 @@ class ExpansionTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('ExpansionTile Sample')), body: const ExpansionTileExample(), diff --git a/examples/api/lib/material/expansion_tile/expansion_tile.1.dart b/examples/api/lib/material/expansion_tile/expansion_tile.1.dart index 76799ec989..f8c6a3ffa5 100644 --- a/examples/api/lib/material/expansion_tile/expansion_tile.1.dart +++ b/examples/api/lib/material/expansion_tile/expansion_tile.1.dart @@ -23,7 +23,6 @@ class _ExpansionTileControllerAppState extends State @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('ExpansionTileController Sample')), body: Column( diff --git a/examples/api/lib/material/filled_button/filled_button.0.dart b/examples/api/lib/material/filled_button/filled_button.0.dart index b7a98c0f7b..342b6c87cc 100644 --- a/examples/api/lib/material/filled_button/filled_button.0.dart +++ b/examples/api/lib/material/filled_button/filled_button.0.dart @@ -16,7 +16,7 @@ class FilledButtonApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('FilledButton Sample')), body: Center( diff --git a/examples/api/lib/material/filter_chip/filter_chip.0.dart b/examples/api/lib/material/filter_chip/filter_chip.0.dart index 1cf8de5919..d121ce8e1c 100644 --- a/examples/api/lib/material/filter_chip/filter_chip.0.dart +++ b/examples/api/lib/material/filter_chip/filter_chip.0.dart @@ -16,7 +16,6 @@ class ChipApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('FilterChip Sample')), body: const FilterChipExample(), diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart index 0e6b75a2b3..fd3fad4564 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart @@ -15,10 +15,7 @@ class FloatingActionButtonExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const FloatingActionButtonExample(), - ); + return const MaterialApp(home: FloatingActionButtonExample()); } } diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart index 406691e5fe..2c7b47ea3c 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.1.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.1.dart @@ -13,10 +13,7 @@ class FloatingActionButtonExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const FloatingActionButtonExample(), - ); + return const MaterialApp(home: FloatingActionButtonExample()); } } diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.2.dart b/examples/api/lib/material/floating_action_button/floating_action_button.2.dart index a97130001d..c62616b7a8 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.2.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.2.dart @@ -13,10 +13,7 @@ class FloatingActionButtonExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const FloatingActionButtonExample(), - ); + return const MaterialApp(home: FloatingActionButtonExample()); } } diff --git a/examples/api/lib/material/icon_button/icon_button.2.dart b/examples/api/lib/material/icon_button/icon_button.2.dart index c54dbd397e..9d7b0418c0 100644 --- a/examples/api/lib/material/icon_button/icon_button.2.dart +++ b/examples/api/lib/material/icon_button/icon_button.2.dart @@ -16,7 +16,7 @@ class IconButtonApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), title: 'Icon Button Types', home: const Scaffold(body: ButtonTypesExample()), ); diff --git a/examples/api/lib/material/icon_button/icon_button.3.dart b/examples/api/lib/material/icon_button/icon_button.3.dart index 6ce87debbb..caafd2e303 100644 --- a/examples/api/lib/material/icon_button/icon_button.3.dart +++ b/examples/api/lib/material/icon_button/icon_button.3.dart @@ -16,7 +16,7 @@ class IconButtonToggleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), title: 'Icon Button Types', home: const Scaffold(body: DemoIconToggleButtons()), ); diff --git a/examples/api/lib/material/input_chip/input_chip.0.dart b/examples/api/lib/material/input_chip/input_chip.0.dart index 7173e5ff44..7116c677ca 100644 --- a/examples/api/lib/material/input_chip/input_chip.0.dart +++ b/examples/api/lib/material/input_chip/input_chip.0.dart @@ -14,7 +14,7 @@ class ChipApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const InputChipExample(), ); } diff --git a/examples/api/lib/material/input_chip/input_chip.1.dart b/examples/api/lib/material/input_chip/input_chip.1.dart index b1829c5429..506944b69b 100644 --- a/examples/api/lib/material/input_chip/input_chip.1.dart +++ b/examples/api/lib/material/input_chip/input_chip.1.dart @@ -25,10 +25,7 @@ class EditableChipFieldApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const EditableChipFieldExample(), - ); + return const MaterialApp(home: EditableChipFieldExample()); } } diff --git a/examples/api/lib/material/input_decorator/input_decoration.0.dart b/examples/api/lib/material/input_decorator/input_decoration.0.dart index 40c0f1f3bd..51454591a8 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.0.dart @@ -14,7 +14,6 @@ class InputDecorationExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const InputDecorationExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.1.dart b/examples/api/lib/material/input_decorator/input_decoration.1.dart index cafda56034..350a9314d5 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.1.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.1.dart @@ -14,7 +14,6 @@ class InputDecorationExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const InputDecorationExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.2.dart b/examples/api/lib/material/input_decorator/input_decoration.2.dart index 07d1275a76..ce9493f1ae 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.2.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.2.dart @@ -14,7 +14,6 @@ class InputDecorationExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const InputDecorationExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.3.dart b/examples/api/lib/material/input_decorator/input_decoration.3.dart index 09b8e8f5c7..ce63e2e99c 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.3.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.3.dart @@ -14,7 +14,6 @@ class InputDecorationExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const InputDecorationExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart index 4882faa6c0..cc8c6cd4b5 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart @@ -14,7 +14,6 @@ class FloatingLabelStyleErrorExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecorator Sample')), body: const Center(child: InputDecoratorExample()), diff --git a/examples/api/lib/material/input_decorator/input_decoration.helper.0.dart b/examples/api/lib/material/input_decorator/input_decoration.helper.0.dart index 98ec9df554..e9cbd51d9a 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.helper.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.helper.0.dart @@ -14,7 +14,6 @@ class HelperExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration.helper Sample')), body: const HelperExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart index 02d0d04a5b..e2f1a4bf2f 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.label.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.label.0.dart @@ -14,7 +14,6 @@ class LabelExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration.label Sample')), body: const LabelExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart index 0ded27a885..8a70eb7ced 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart @@ -14,7 +14,6 @@ class LabelStyleErrorExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecorator Sample')), body: const Center(child: InputDecoratorExample()), diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart index 9dcf722841..cbaebf7471 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart @@ -13,10 +13,7 @@ class PrefixIconExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(body: InputDecoratorExample()), - ); + return const MaterialApp(home: Scaffold(body: InputDecoratorExample())); } } diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart index c0310b13ec..ee0053818e 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart @@ -14,7 +14,6 @@ class PrefixIconConstraintsExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const PrefixIconConstraintsExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart index 76bd678c2f..9d0cca3843 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart @@ -13,10 +13,7 @@ class SuffixIconExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(body: InputDecoratorExample()), - ); + return const MaterialApp(home: Scaffold(body: InputDecoratorExample())); } } diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart index fe65a7e2d3..9489a4201d 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart @@ -14,7 +14,6 @@ class SuffixIconConstraintsExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const SuffixIconConstraintsExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart b/examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart index 8a7f973d4f..f691c93b31 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart @@ -14,7 +14,6 @@ class MaterialStateExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const MaterialStateExample(), diff --git a/examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart b/examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart index 30a7b7c0dd..7a2ba13a4e 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart @@ -14,7 +14,6 @@ class MaterialStateExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('InputDecoration Sample')), body: const MaterialStateExample(), diff --git a/examples/api/lib/material/list_tile/custom_list_item.1.dart b/examples/api/lib/material/list_tile/custom_list_item.1.dart index f76e3ef610..f326e7659d 100644 --- a/examples/api/lib/material/list_tile/custom_list_item.1.dart +++ b/examples/api/lib/material/list_tile/custom_list_item.1.dart @@ -13,7 +13,7 @@ class CustomListItemApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const CustomListItemExample()); + return const MaterialApp(home: CustomListItemExample()); } } diff --git a/examples/api/lib/material/list_tile/list_tile.0.dart b/examples/api/lib/material/list_tile/list_tile.0.dart index 66eb27d865..f0d084b994 100644 --- a/examples/api/lib/material/list_tile/list_tile.0.dart +++ b/examples/api/lib/material/list_tile/list_tile.0.dart @@ -14,10 +14,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData( - listTileTheme: const ListTileThemeData(textColor: Colors.white), - useMaterial3: true, - ), + theme: ThemeData(listTileTheme: const ListTileThemeData(textColor: Colors.white)), home: const ListTileExample(), ); } diff --git a/examples/api/lib/material/list_tile/list_tile.1.dart b/examples/api/lib/material/list_tile/list_tile.1.dart index 23ff258a40..da7c6eab83 100644 --- a/examples/api/lib/material/list_tile/list_tile.1.dart +++ b/examples/api/lib/material/list_tile/list_tile.1.dart @@ -13,7 +13,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const ListTileExample()); + return const MaterialApp(home: ListTileExample()); } } diff --git a/examples/api/lib/material/list_tile/list_tile.2.dart b/examples/api/lib/material/list_tile/list_tile.2.dart index e5325f357d..21b81dca64 100644 --- a/examples/api/lib/material/list_tile/list_tile.2.dart +++ b/examples/api/lib/material/list_tile/list_tile.2.dart @@ -13,7 +13,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const ListTileExample()); + return const MaterialApp(home: ListTileExample()); } } diff --git a/examples/api/lib/material/list_tile/list_tile.3.dart b/examples/api/lib/material/list_tile/list_tile.3.dart index 9e5989d896..0b086555ab 100644 --- a/examples/api/lib/material/list_tile/list_tile.3.dart +++ b/examples/api/lib/material/list_tile/list_tile.3.dart @@ -13,7 +13,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const ListTileExample()); + return const MaterialApp(home: ListTileExample()); } } diff --git a/examples/api/lib/material/list_tile/list_tile.4.dart b/examples/api/lib/material/list_tile/list_tile.4.dart index 2245f0b987..e4f9f78141 100644 --- a/examples/api/lib/material/list_tile/list_tile.4.dart +++ b/examples/api/lib/material/list_tile/list_tile.4.dart @@ -13,7 +13,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const ListTileExample()); + return const MaterialApp(home: ListTileExample()); } } diff --git a/examples/api/lib/material/list_tile/list_tile.selected.0.dart b/examples/api/lib/material/list_tile/list_tile.selected.0.dart index b02b13f6b3..182860e371 100644 --- a/examples/api/lib/material/list_tile/list_tile.selected.0.dart +++ b/examples/api/lib/material/list_tile/list_tile.selected.0.dart @@ -13,7 +13,7 @@ class ListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const ListTileExample()); + return const MaterialApp(home: ListTileExample()); } } diff --git a/examples/api/lib/material/menu_anchor/menu_anchor.1.dart b/examples/api/lib/material/menu_anchor/menu_anchor.1.dart index 63a69e5623..b1e733fdfe 100644 --- a/examples/api/lib/material/menu_anchor/menu_anchor.1.dart +++ b/examples/api/lib/material/menu_anchor/menu_anchor.1.dart @@ -253,9 +253,6 @@ class ContextMenuApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(body: MyContextMenu(message: kMessage)), - ); + return const MaterialApp(home: Scaffold(body: MyContextMenu(message: kMessage))); } } diff --git a/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart b/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart index 442e023f0a..346956814a 100644 --- a/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart +++ b/examples/api/lib/material/menu_anchor/radio_menu_button.0.dart @@ -112,9 +112,6 @@ class MenuApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(body: SafeArea(child: MyRadioMenu())), - ); + return const MaterialApp(home: Scaffold(body: SafeArea(child: MyRadioMenu()))); } } diff --git a/examples/api/lib/material/navigation_bar/navigation_bar.0.dart b/examples/api/lib/material/navigation_bar/navigation_bar.0.dart index 617e474227..12f43f1c58 100644 --- a/examples/api/lib/material/navigation_bar/navigation_bar.0.dart +++ b/examples/api/lib/material/navigation_bar/navigation_bar.0.dart @@ -13,7 +13,7 @@ class NavigationBarApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const NavigationExample()); + return const MaterialApp(home: NavigationExample()); } } diff --git a/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart b/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart index c60d8c1259..11c0b53755 100644 --- a/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart +++ b/examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart @@ -32,11 +32,7 @@ class NavigationDrawerApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - debugShowCheckedModeBanner: false, - theme: ThemeData(useMaterial3: true), - home: const NavigationDrawerExample(), - ); + return const MaterialApp(debugShowCheckedModeBanner: false, home: NavigationDrawerExample()); } } diff --git a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart index 15d0158e1a..38ce8d7d76 100644 --- a/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart +++ b/examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart @@ -15,7 +15,6 @@ class PageTransitionsThemeApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( - useMaterial3: true, pageTransitionsTheme: const PageTransitionsTheme( builders: { TargetPlatform.android: ZoomPageTransitionsBuilder(allowSnapshotting: false), diff --git a/examples/api/lib/material/popup_menu/popup_menu.1.dart b/examples/api/lib/material/popup_menu/popup_menu.1.dart index 12ba0c5ab5..8740773b07 100644 --- a/examples/api/lib/material/popup_menu/popup_menu.1.dart +++ b/examples/api/lib/material/popup_menu/popup_menu.1.dart @@ -17,7 +17,7 @@ class PopupMenuApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const PopupMenuExample(), ); } diff --git a/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart b/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart index 2949600f23..60829d1305 100644 --- a/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart +++ b/examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart @@ -14,7 +14,7 @@ class ProgressIndicatorExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: const ProgressIndicatorExample(), ); } diff --git a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart index 34d953846b..8f618ef11a 100644 --- a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart +++ b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart @@ -16,7 +16,6 @@ class LabeledRadioApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Custom Labeled Radio Sample')), body: const LabeledRadioExample(), diff --git a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart index 1eaabbc809..215216d7ea 100644 --- a/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart +++ b/examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart @@ -14,7 +14,6 @@ class LabeledRadioApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Custom Labeled Radio Sample')), body: const LabeledRadioExample(), diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart index f54f252666..f5231720d1 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart @@ -14,7 +14,6 @@ class RadioListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('RadioListTile Sample')), body: const RadioListTileExample(), diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart index 0f1776be64..18c1a47ed0 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart @@ -13,7 +13,7 @@ class RadioListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const RadioListTileExample()); + return const MaterialApp(home: RadioListTileExample()); } } diff --git a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart index 6fdb158243..75bde750d6 100644 --- a/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart +++ b/examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart @@ -14,7 +14,6 @@ class RadioListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('RadioListTile.toggleable Sample')), body: const RadioListTileExample(), diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.2.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.2.dart index 397226babb..17b1981f8a 100644 --- a/examples/api/lib/material/reorderable_list/reorderable_list_view.2.dart +++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.2.dart @@ -16,7 +16,6 @@ class ReorderableApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('ReorderableListView Sample')), body: const ReorderableExample(), diff --git a/examples/api/lib/material/search_anchor/search_anchor.0.dart b/examples/api/lib/material/search_anchor/search_anchor.0.dart index 5986bb8f0b..f5b09b5c0c 100644 --- a/examples/api/lib/material/search_anchor/search_anchor.0.dart +++ b/examples/api/lib/material/search_anchor/search_anchor.0.dart @@ -70,7 +70,7 @@ class _SearchBarAppState extends State { @override Widget build(BuildContext context) { - final ThemeData themeData = ThemeData(useMaterial3: true, colorSchemeSeed: selectedColorSeed); + final ThemeData themeData = ThemeData(colorSchemeSeed: selectedColorSeed); final ColorScheme colors = themeData.colorScheme; return MaterialApp( diff --git a/examples/api/lib/material/search_anchor/search_anchor.1.dart b/examples/api/lib/material/search_anchor/search_anchor.1.dart index ce505daae9..dcf3ef4b01 100644 --- a/examples/api/lib/material/search_anchor/search_anchor.1.dart +++ b/examples/api/lib/material/search_anchor/search_anchor.1.dart @@ -21,7 +21,7 @@ class _PinnedSearchBarAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4)), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( body: SafeArea( child: CustomScrollView( diff --git a/examples/api/lib/material/search_anchor/search_anchor.2.dart b/examples/api/lib/material/search_anchor/search_anchor.2.dart index f32f8f08c5..fa391fcf2c 100644 --- a/examples/api/lib/material/search_anchor/search_anchor.2.dart +++ b/examples/api/lib/material/search_anchor/search_anchor.2.dart @@ -20,10 +20,7 @@ class _SearchBarAppState extends State { @override Widget build(BuildContext context) { - final ThemeData themeData = ThemeData(useMaterial3: true); - return MaterialApp( - theme: themeData, home: Scaffold( appBar: AppBar(title: const Text('Search Anchor Sample')), body: Column( diff --git a/examples/api/lib/material/search_anchor/search_bar.0.dart b/examples/api/lib/material/search_anchor/search_bar.0.dart index 89f3f54fbf..5ca2318cc3 100644 --- a/examples/api/lib/material/search_anchor/search_bar.0.dart +++ b/examples/api/lib/material/search_anchor/search_bar.0.dart @@ -20,10 +20,7 @@ class _SearchBarAppState extends State { @override Widget build(BuildContext context) { - final ThemeData themeData = ThemeData( - useMaterial3: true, - brightness: isDark ? Brightness.dark : Brightness.light, - ); + final ThemeData themeData = ThemeData(brightness: isDark ? Brightness.dark : Brightness.light); return MaterialApp( theme: themeData, diff --git a/examples/api/lib/material/segmented_button/segmented_button.0.dart b/examples/api/lib/material/segmented_button/segmented_button.0.dart index f499bf55cb..6f5a4d4c28 100644 --- a/examples/api/lib/material/segmented_button/segmented_button.0.dart +++ b/examples/api/lib/material/segmented_button/segmented_button.0.dart @@ -15,9 +15,8 @@ class SegmentedButtonApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold( + return const MaterialApp( + home: Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/examples/api/lib/material/selection_area/selection_area.1.dart b/examples/api/lib/material/selection_area/selection_area.1.dart index d0919a2edf..6710e66d01 100644 --- a/examples/api/lib/material/selection_area/selection_area.1.dart +++ b/examples/api/lib/material/selection_area/selection_area.1.dart @@ -16,10 +16,7 @@ class SelectionAreaSelectionListenerExampleApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), + theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple)), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } diff --git a/examples/api/lib/material/selection_area/selection_area.2.dart b/examples/api/lib/material/selection_area/selection_area.2.dart index a884a37f4a..953421c5e7 100644 --- a/examples/api/lib/material/selection_area/selection_area.2.dart +++ b/examples/api/lib/material/selection_area/selection_area.2.dart @@ -18,10 +18,7 @@ class SelectionAreaColorTextRedExampleApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), + theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple)), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } diff --git a/examples/api/lib/material/snack_bar/snack_bar.2.dart b/examples/api/lib/material/snack_bar/snack_bar.2.dart index 0e37c41a24..bbfc8ac87b 100644 --- a/examples/api/lib/material/snack_bar/snack_bar.2.dart +++ b/examples/api/lib/material/snack_bar/snack_bar.2.dart @@ -15,7 +15,7 @@ class SnackBarExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const SnackBarExample()); + return const MaterialApp(home: SnackBarExample()); } } diff --git a/examples/api/lib/material/switch/switch.0.dart b/examples/api/lib/material/switch/switch.0.dart index 5abffdf5c8..cc7898bc0e 100644 --- a/examples/api/lib/material/switch/switch.0.dart +++ b/examples/api/lib/material/switch/switch.0.dart @@ -14,7 +14,6 @@ class SwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Switch Sample')), body: const Center(child: SwitchExample()), diff --git a/examples/api/lib/material/switch/switch.1.dart b/examples/api/lib/material/switch/switch.1.dart index 99774064a1..045821f190 100644 --- a/examples/api/lib/material/switch/switch.1.dart +++ b/examples/api/lib/material/switch/switch.1.dart @@ -14,7 +14,6 @@ class SwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Switch Sample')), body: const Center(child: SwitchExample()), diff --git a/examples/api/lib/material/switch/switch.2.dart b/examples/api/lib/material/switch/switch.2.dart index 0718a12de7..c70bf8e355 100644 --- a/examples/api/lib/material/switch/switch.2.dart +++ b/examples/api/lib/material/switch/switch.2.dart @@ -14,7 +14,6 @@ class SwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Switch Sample')), body: const Center(child: SwitchExample()), diff --git a/examples/api/lib/material/switch/switch.3.dart b/examples/api/lib/material/switch/switch.3.dart index 1fa3b734d7..81afb98a6e 100644 --- a/examples/api/lib/material/switch/switch.3.dart +++ b/examples/api/lib/material/switch/switch.3.dart @@ -15,7 +15,7 @@ class SwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData.light(useMaterial3: true).copyWith( + theme: ThemeData( // Use the ambient CupertinoThemeData to style all widgets which would // otherwise use iOS defaults. cupertinoOverrideTheme: const CupertinoThemeData(applyThemeToAll: true), diff --git a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart index 21352e9b5b..f8e27fc501 100644 --- a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart +++ b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart @@ -16,7 +16,6 @@ class LabeledSwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Custom Labeled Switch Sample')), body: const Center(child: LabeledSwitchExample()), diff --git a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart index 8b803be92b..62af782ec6 100644 --- a/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart +++ b/examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart @@ -14,7 +14,6 @@ class LabeledSwitchApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('Custom Labeled Switch Sample')), body: const Center(child: LabeledSwitchExample()), diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart index 915e72ac19..002567edf7 100644 --- a/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart +++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart @@ -14,7 +14,6 @@ class SwitchListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('SwitchListTile Sample')), body: const Center(child: SwitchListTileExample()), diff --git a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart index baec8601c9..9674e81fc9 100644 --- a/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart +++ b/examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart @@ -14,7 +14,6 @@ class SwitchListTileApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar(title: const Text('SwitchListTile Sample')), body: const SwitchListTileExample(), diff --git a/examples/api/lib/material/tabs/tab_bar.0.dart b/examples/api/lib/material/tabs/tab_bar.0.dart index d13592a891..c35224f7a0 100644 --- a/examples/api/lib/material/tabs/tab_bar.0.dart +++ b/examples/api/lib/material/tabs/tab_bar.0.dart @@ -13,7 +13,7 @@ class TabBarApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample()); + return const MaterialApp(home: TabBarExample()); } } diff --git a/examples/api/lib/material/tabs/tab_bar.1.dart b/examples/api/lib/material/tabs/tab_bar.1.dart index b60060a133..b3ba502cd8 100644 --- a/examples/api/lib/material/tabs/tab_bar.1.dart +++ b/examples/api/lib/material/tabs/tab_bar.1.dart @@ -13,7 +13,7 @@ class TabBarApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample()); + return const MaterialApp(home: TabBarExample()); } } diff --git a/examples/api/lib/material/tabs/tab_bar.2.dart b/examples/api/lib/material/tabs/tab_bar.2.dart index 96413c3db6..7f14e9eabf 100644 --- a/examples/api/lib/material/tabs/tab_bar.2.dart +++ b/examples/api/lib/material/tabs/tab_bar.2.dart @@ -13,7 +13,7 @@ class TabBarApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const TabBarExample()); + return const MaterialApp(home: TabBarExample()); } } diff --git a/examples/api/lib/material/text_field/text_field.2.dart b/examples/api/lib/material/text_field/text_field.2.dart index a00487fe27..fdfe1efc6a 100644 --- a/examples/api/lib/material/text_field/text_field.2.dart +++ b/examples/api/lib/material/text_field/text_field.2.dart @@ -16,7 +16,7 @@ class TextFieldExamplesApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), + theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4)), home: Scaffold( appBar: AppBar(title: const Text('TextField Examples')), body: const Column( diff --git a/examples/api/lib/material/theme/theme_extension.1.dart b/examples/api/lib/material/theme/theme_extension.1.dart index 8623e98082..1855ecd849 100644 --- a/examples/api/lib/material/theme/theme_extension.1.dart +++ b/examples/api/lib/material/theme/theme_extension.1.dart @@ -58,9 +58,9 @@ class _ThemeExtensionExampleAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData.light().copyWith( - extensions: >[ - const MyColors(brandColor: Color(0xFF1E88E5), danger: Color(0xFFE53935)), + theme: ThemeData( + extensions: const >[ + MyColors(brandColor: Color(0xFF1E88E5), danger: Color(0xFFE53935)), ], ), darkTheme: ThemeData.dark().copyWith( diff --git a/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart b/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart index c734162028..3693828815 100644 --- a/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart +++ b/examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart @@ -19,10 +19,7 @@ class ToggleButtonsExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const ToggleButtonsSample(title: 'ToggleButtons Sample'), - ); + return const MaterialApp(home: ToggleButtonsSample(title: 'ToggleButtons Sample')); } } diff --git a/examples/api/lib/material/toggle_buttons/toggle_buttons.1.dart b/examples/api/lib/material/toggle_buttons/toggle_buttons.1.dart index 72e90b999c..6c805504f7 100644 --- a/examples/api/lib/material/toggle_buttons/toggle_buttons.1.dart +++ b/examples/api/lib/material/toggle_buttons/toggle_buttons.1.dart @@ -14,10 +14,7 @@ class ToggleButtonsApp extends StatelessWidget { const ToggleButtonsApp({super.key}); @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(body: ToggleButtonsExample()), - ); + return const MaterialApp(home: Scaffold(body: ToggleButtonsExample())); } } diff --git a/examples/api/lib/painting/linear_border/linear_border.0.dart b/examples/api/lib/painting/linear_border/linear_border.0.dart index 741e83758b..7a3c4c915e 100644 --- a/examples/api/lib/painting/linear_border/linear_border.0.dart +++ b/examples/api/lib/painting/linear_border/linear_border.0.dart @@ -15,9 +15,8 @@ class ExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData.light(useMaterial3: true), - home: const Directionality( + return const MaterialApp( + home: Directionality( // TRY THIS: Switch to TextDirection.rtl to see how the borders change. textDirection: TextDirection.ltr, child: Home(), diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart index 453c6996fa..36aa16798c 100644 --- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart +++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.0.dart @@ -16,10 +16,7 @@ class SystemOverlayStyleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true, brightness: Brightness.light), - home: const SystemOverlayStyleExample(), - ); + return const MaterialApp(home: SystemOverlayStyleExample()); } } diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart index 5ba2375001..6b5e217e5a 100644 --- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart +++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart @@ -16,10 +16,7 @@ class SystemOverlayStyleApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - theme: ThemeData(useMaterial3: true, brightness: Brightness.light), - home: const SystemOverlayStyleExample(), - ); + return const MaterialApp(home: SystemOverlayStyleExample()); } } diff --git a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart index 7e1da0c7f2..66f852f2ab 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart @@ -13,7 +13,7 @@ class AnimatedSlideApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp(theme: ThemeData(useMaterial3: true), home: const AnimatedSlideExample()); + return const MaterialApp(home: AnimatedSlideExample()); } } diff --git a/examples/api/lib/widgets/raw_menu_anchor/raw_menu_anchor.0.dart b/examples/api/lib/widgets/raw_menu_anchor/raw_menu_anchor.0.dart index ff889eea19..f104f7ddbb 100644 --- a/examples/api/lib/widgets/raw_menu_anchor/raw_menu_anchor.0.dart +++ b/examples/api/lib/widgets/raw_menu_anchor/raw_menu_anchor.0.dart @@ -168,7 +168,6 @@ class RawMenuAnchorApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( theme: ThemeData.from( - useMaterial3: true, colorScheme: ColorScheme.fromSeed( seedColor: Colors.blue, dynamicSchemeVariant: DynamicSchemeVariant.vibrant, diff --git a/examples/api/lib/widgets/scroll_notification_observer/scroll_notification_observer.0.dart b/examples/api/lib/widgets/scroll_notification_observer/scroll_notification_observer.0.dart index ffb406f627..e8ff62b077 100644 --- a/examples/api/lib/widgets/scroll_notification_observer/scroll_notification_observer.0.dart +++ b/examples/api/lib/widgets/scroll_notification_observer/scroll_notification_observer.0.dart @@ -14,7 +14,6 @@ class ScrollNotificationObserverApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), // The Scaffold widget contains a [ScrollNotificationObserver]. // This is used by [AppBar] for its scrolled under behavior. // diff --git a/examples/api/lib/widgets/scroll_position/scroll_controller_notification.0.dart b/examples/api/lib/widgets/scroll_position/scroll_controller_notification.0.dart index 0a1186a3ce..e187843645 100644 --- a/examples/api/lib/widgets/scroll_position/scroll_controller_notification.0.dart +++ b/examples/api/lib/widgets/scroll_position/scroll_controller_notification.0.dart @@ -89,10 +89,7 @@ class _ScrollNotificationDemoState extends State { } return MaterialApp( - theme: ThemeData.from( - useMaterial3: true, - colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueGrey), - ), + theme: ThemeData.from(colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueGrey)), home: Scaffold( appBar: AppBar( title: const Text('Listening to a ScrollPosition'), diff --git a/examples/api/lib/widgets/sliver/decorated_sliver.1.dart b/examples/api/lib/widgets/sliver/decorated_sliver.1.dart index a037e95dbe..3b9f335c78 100644 --- a/examples/api/lib/widgets/sliver/decorated_sliver.1.dart +++ b/examples/api/lib/widgets/sliver/decorated_sliver.1.dart @@ -16,10 +16,7 @@ class DecoratedSliverClipExampleApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( title: 'DecoratedSliver Clip Example', - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), + theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple)), home: const DecoratedSliverClipExample(), ); } diff --git a/examples/api/lib/widgets/text/text.0.dart b/examples/api/lib/widgets/text/text.0.dart index 0b8a7ee243..3013ffb171 100644 --- a/examples/api/lib/widgets/text/text.0.dart +++ b/examples/api/lib/widgets/text/text.0.dart @@ -14,11 +14,7 @@ class DefaultTextStyleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData( - useMaterial3: true, - brightness: Brightness.light, - colorSchemeSeed: Colors.purple, - ), + theme: ThemeData(brightness: Brightness.light, colorSchemeSeed: Colors.purple), home: const DefaultTextStyleExample(), ); } diff --git a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart index eed5ac5f85..3d9452e4a8 100644 --- a/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart +++ b/examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart @@ -20,7 +20,6 @@ class TextMagnifierExampleApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Padding( padding: const EdgeInsets.symmetric(horizontal: 48.0), diff --git a/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart index 54ce8f2316..2d26a9db43 100644 --- a/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart +++ b/examples/api/test/material/floating_action_button/floating_action_button.1_test.dart @@ -15,7 +15,7 @@ void main() { await tester.pumpWidget(const example.FloatingActionButtonExampleApp()); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); expect(find.byType(FloatingActionButton), findsNWidgets(4)); expect(find.byIcon(Icons.add), findsNWidgets(4)); diff --git a/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart b/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart index 56135c1ba7..675790b15e 100644 --- a/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart +++ b/examples/api/test/material/floating_action_button/floating_action_button.2_test.dart @@ -15,7 +15,7 @@ void main() { return tester.widget(finder); } - final ColorScheme colorScheme = ThemeData(useMaterial3: true).colorScheme; + final ColorScheme colorScheme = ThemeData().colorScheme; // Test the FAB with surface color mapping. FloatingActionButton fab = getFAB(find.byType(FloatingActionButton).at(0)); diff --git a/examples/api/test/material/theme/theme_extension.1_test.dart b/examples/api/test/material/theme/theme_extension.1_test.dart index c43362d07e..0b73e7f467 100644 --- a/examples/api/test/material/theme/theme_extension.1_test.dart +++ b/examples/api/test/material/theme/theme_extension.1_test.dart @@ -40,9 +40,9 @@ void main() { testWidgets('Home uses MyColors extension correctly', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith( - extensions: >[ - const example.MyColors(brandColor: Color(0xFF0000FF), danger: Color(0xFFFF0000)), + theme: ThemeData( + extensions: const >[ + example.MyColors(brandColor: Color(0xFF0000FF), danger: Color(0xFFFF0000)), ], ), home: example.Home(isLightTheme: true, toggleTheme: () {}), diff --git a/examples/api/test/material/toggle_buttons/toggle_buttons.1_test.dart b/examples/api/test/material/toggle_buttons/toggle_buttons.1_test.dart index 3c2dce3270..b253141ee5 100644 --- a/examples/api/test/material/toggle_buttons/toggle_buttons.1_test.dart +++ b/examples/api/test/material/toggle_buttons/toggle_buttons.1_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('ToggleButtons allows multiple or no selection', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Finder findButton(String text) { return find.descendant( of: find.byType(ToggleButtons), @@ -71,7 +71,7 @@ void main() { }); testWidgets('SegmentedButton allows multiple or no selection', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Finder findButton(String text) { return find.descendant( of: find.byType(SegmentedButton), diff --git a/examples/api/test/painting/gradient/linear_gradient.0_test.dart b/examples/api/test/painting/gradient/linear_gradient.0_test.dart index 351eab54c3..3b5803e6a2 100644 --- a/examples/api/test/painting/gradient/linear_gradient.0_test.dart +++ b/examples/api/test/painting/gradient/linear_gradient.0_test.dart @@ -15,9 +15,8 @@ void main() { testWidgets('gradient matches golden', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const SizedBox( + const MaterialApp( + home: SizedBox( width: 800, height: 600, child: RepaintBoundary(child: example.MoodyGradient()), diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart index 97dff6c9eb..97a1551c4a 100644 --- a/examples/layers/widgets/sectors.dart +++ b/examples/layers/widgets/sectors.dart @@ -169,7 +169,6 @@ class SectorAppState extends State { @override Widget build(BuildContext context) { return MaterialApp( - theme: ThemeData.light(), title: 'Sector Layout', home: Scaffold( appBar: AppBar(title: const Text('Sector Layout in a Widget Tree')), diff --git a/examples/layers/widgets/styled_text.dart b/examples/layers/widgets/styled_text.dart index ba4ba120b3..a3656afbfd 100644 --- a/examples/layers/widgets/styled_text.dart +++ b/examples/layers/widgets/styled_text.dart @@ -106,7 +106,6 @@ class _StyledTextDemoState extends State { void main() { runApp( MaterialApp( - theme: ThemeData.light(), home: Scaffold( appBar: AppBar(title: const Text('Hal and Dave')), body: Material(color: Colors.grey.shade50, child: const StyledTextDemo()), diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index 9e3cc9d054..bab92ee235 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -1008,7 +1008,7 @@ class _MaterialAppState extends State { } else if (highContrast && widget.highContrastTheme != null) { theme = widget.highContrastTheme; } - theme ??= widget.theme ?? ThemeData.light(); + theme ??= widget.theme ?? ThemeData(); SystemChrome.setSystemUIOverlayStyle( theme.brightness == Brightness.dark ? SystemUiOverlayStyle.light : SystemUiOverlayStyle.dark, ); diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index c6565b74cc..fa3952ec9d 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -19,7 +19,6 @@ void main() { testWidgets('Material3 has sentence case labels', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), builder: (BuildContext context, Widget? child) { return MediaQuery( // Display has a vertical hinge down the middle @@ -127,7 +126,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), title: 'Pirate app', home: Scaffold( appBar: AppBar(title: const Text('Home')), @@ -362,7 +360,6 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - useMaterial3: true, textTheme: const TextTheme(titleLarge: titleTextStyle, titleSmall: subtitleTextStyle), ), home: const Center(child: LicensePage()), @@ -462,9 +459,8 @@ void main() { }); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const MediaQuery( + const MaterialApp( + home: MediaQuery( data: MediaQueryData(padding: EdgeInsets.all(safeareaPadding)), child: LicensePage(), ), @@ -1097,9 +1093,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light( - useMaterial3: true, - ).copyWith(scaffoldBackgroundColor: scaffoldColor, cardColor: cardColor), + theme: ThemeData(scaffoldBackgroundColor: scaffoldColor, cardColor: cardColor), home: Scaffold( body: Center( child: Builder( @@ -1347,12 +1341,7 @@ void main() { testWidgets('Material3 - Error handling test', (WidgetTester tester) async { LicenseRegistry.addLicense(() => Stream.error(Exception('Injected failure'))); - await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material(child: AboutListTile()), - ), - ); + await tester.pumpWidget(const MaterialApp(home: Material(child: AboutListTile()))); await tester.tap(find.byType(ListTile)); await tester.pump(); await tester.pump(const Duration(seconds: 2)); @@ -1450,12 +1439,9 @@ void main() { await tester.binding.setSurfaceSize(defaultSize); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( title: title, - home: const Scaffold( - body: Directionality(textDirection: textDirection, child: LicensePage()), - ), + home: Scaffold(body: Directionality(textDirection: textDirection, child: LicensePage())), ), ); @@ -1571,12 +1557,9 @@ void main() { await tester.binding.setSurfaceSize(defaultSize); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( title: title, - home: const Scaffold( - body: Directionality(textDirection: textDirection, child: LicensePage()), - ), + home: Scaffold(body: Directionality(textDirection: textDirection, child: LicensePage())), ), ); @@ -1618,7 +1601,6 @@ void main() { // This is a regression test for https://github.com/flutter/flutter/issues/108991 final ThemeData theme = ThemeData( appBarTheme: const AppBarTheme(foregroundColor: Color(0xFFFFFFFF)), - useMaterial3: true, ); const String title = 'License ABC'; LicenseRegistry.addLicense(() { @@ -1654,7 +1636,7 @@ void main() { WidgetTester tester, ) async { // This is a regression test for https://github.com/flutter/flutter/issues/108991 - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const String title = 'License ABC'; LicenseRegistry.addLicense(() { return Stream.fromIterable([ diff --git a/packages/flutter/test/material/action_icons_theme_test.dart b/packages/flutter/test/material/action_icons_theme_test.dart index 966012b5ee..b53ef04e7b 100644 --- a/packages/flutter/test/material/action_icons_theme_test.dart +++ b/packages/flutter/test/material/action_icons_theme_test.dart @@ -115,7 +115,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(useMaterial3: true).copyWith(actionIconTheme: actionIconTheme), + theme: ThemeData(actionIconTheme: actionIconTheme), home: const Material( child: Column( children: [BackButton(), CloseButton(), DrawerButton(), EndDrawerButton()], diff --git a/packages/flutter/test/material/app_bar_sliver_test.dart b/packages/flutter/test/material/app_bar_sliver_test.dart index 98ca58de31..ef3029c7ee 100644 --- a/packages/flutter/test/material/app_bar_sliver_test.dart +++ b/packages/flutter/test/material/app_bar_sliver_test.dart @@ -211,7 +211,6 @@ void main() { const String title = 'Medium AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery.withClampedTextScaling( minScaleFactor: textScaleFactor, maxScaleFactor: textScaleFactor, @@ -248,7 +247,6 @@ void main() { const String title = 'Large AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery.withClampedTextScaling( minScaleFactor: textScaleFactor, maxScaleFactor: textScaleFactor, @@ -282,7 +280,6 @@ void main() { const String title = 'Medium AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery.withClampedTextScaling( minScaleFactor: textScaleFactor, maxScaleFactor: textScaleFactor, @@ -319,7 +316,6 @@ void main() { const String title = 'Large AppBar'; Widget buildAppBar({double textScaleFactor = 1.0}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery.withClampedTextScaling( minScaleFactor: textScaleFactor, maxScaleFactor: textScaleFactor, @@ -1217,7 +1213,7 @@ void main() { }); testWidgets('Material3 - SliverAppBar.medium defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 112; @@ -1300,7 +1296,7 @@ void main() { }); testWidgets('Material3 - SliverAppBar.large defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const double collapsedAppBarHeight = 64; const double expandedAppBarHeight = 152; diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index b9ea812bb8..12995e66a4 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -458,10 +458,7 @@ void main() { }); testWidgets('Material3 - AppBar drawer icon has default color', (WidgetTester tester) async { - final ThemeData themeData = ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ); + final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); await tester.pumpWidget( MaterialApp( theme: themeData, @@ -513,10 +510,7 @@ void main() { }); testWidgets('Material3 - AppBar endDrawer icon has default color', (WidgetTester tester) async { - final ThemeData themeData = ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ); + final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); await tester.pumpWidget( MaterialApp( theme: themeData, @@ -559,7 +553,7 @@ void main() { testWidgets('Material3 - leading widget extends to edge and is square', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(platform: TargetPlatform.android, useMaterial3: true); + final ThemeData themeData = ThemeData(platform: TargetPlatform.android); await tester.pumpWidget( MaterialApp( theme: themeData, @@ -609,7 +603,7 @@ void main() { }); testWidgets('Material3 - Action is 4dp from edge and 48dp min', (WidgetTester tester) async { - final ThemeData theme = ThemeData(platform: TargetPlatform.android, useMaterial3: true); + final ThemeData theme = ThemeData(platform: TargetPlatform.android); await tester.pumpWidget( MaterialApp( theme: theme, @@ -645,7 +639,6 @@ void main() { ) async { Widget buildAppBar([double? elevation]) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold(appBar: AppBar(title: const Text('Title'), elevation: elevation)), ); } @@ -700,7 +693,6 @@ void main() { ) async { Widget buildAppBar({double? scrolledUnderElevation}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( appBar: AppBar( title: const Text('Title'), @@ -1006,7 +998,7 @@ void main() { await tester.pumpWidget( MaterialApp( // Test was designed against InkSplash so need to make sure that is used. - theme: ThemeData(useMaterial3: true, splashFactory: InkSplash.splashFactory), + theme: ThemeData(splashFactory: InkSplash.splashFactory), home: Center( child: AppBar( title: const Text('Abc'), @@ -1428,7 +1420,7 @@ void main() { testWidgets('Material3 - AppBar draws a light system bar for a dark background', ( WidgetTester tester, ) async { - final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); + final ThemeData darkTheme = ThemeData.dark(); await tester.pumpWidget( MaterialApp(theme: darkTheme, home: Scaffold(appBar: AppBar(title: const Text('test')))), ); @@ -1447,7 +1439,7 @@ void main() { testWidgets('Material3 - AppBar draws a dark system bar for a light background', ( WidgetTester tester, ) async { - final ThemeData lightTheme = ThemeData(useMaterial3: true); + final ThemeData lightTheme = ThemeData(); await tester.pumpWidget( MaterialApp(theme: lightTheme, home: Scaffold(appBar: AppBar(title: const Text('test')))), ); @@ -1475,7 +1467,7 @@ void main() { // Using a light theme. { - await tester.pumpWidget(buildAppBar(ThemeData(useMaterial3: true))); + await tester.pumpWidget(buildAppBar(ThemeData())); final Material appBarMaterial = tester.widget( find.descendant(of: find.byType(AppBar), matching: find.byType(Material)), ); @@ -1497,7 +1489,7 @@ void main() { // Using a dark theme. { - await tester.pumpWidget(buildAppBar(ThemeData.dark(useMaterial3: true))); + await tester.pumpWidget(buildAppBar(ThemeData.dark())); final Material appBarMaterial = tester.widget( find.descendant(of: find.byType(AppBar), matching: find.byType(Material)), ); @@ -1523,7 +1515,7 @@ void main() { await tester.pumpWidget( MaterialApp( key: GlobalKey(), - theme: ThemeData.light().copyWith(useMaterial3: true, appBarTheme: const AppBarTheme()), + theme: ThemeData(appBarTheme: const AppBarTheme()), home: Scaffold(appBar: AppBar(title: const Text('title'))), ), ); @@ -1873,7 +1865,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( appBar: AppBar( iconTheme: const IconThemeData(color: iconColor), @@ -1900,10 +1892,7 @@ void main() { testWidgets('Material3 - Action icons and IconButtons are colored by ActionIconTheme', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ); + final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); const Color actionsIconColor = Color(0xff0000ff); final Key leadingIconKey = UniqueKey(); @@ -1938,10 +1927,7 @@ void main() { testWidgets('Material3 - The actionIconTheme property overrides iconTheme', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ); + final ThemeData themeData = ThemeData.from(colorScheme: const ColorScheme.light()); const Color overallIconColor = Color(0xff00ff00); const Color actionsIconColor = Color(0xff0000ff); @@ -1982,7 +1968,6 @@ void main() { iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red, iconSize: 32.0), ), - useMaterial3: true, ); const IconThemeData overallIconTheme = IconThemeData(color: Colors.yellow, size: 30.0); @@ -2019,7 +2004,6 @@ void main() { iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red, iconSize: 32.0), ), - useMaterial3: true, ); const IconThemeData overallIconTheme = IconThemeData(color: Colors.yellow, size: 30.0); @@ -2051,7 +2035,6 @@ void main() { iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red, iconSize: 32.0), ), - useMaterial3: true, ); const IconThemeData actionsIconTheme = IconThemeData(color: Colors.yellow, size: 30.0); @@ -2089,7 +2072,6 @@ void main() { iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red, iconSize: 32.0), ), - useMaterial3: true, ); const IconThemeData actionsIconTheme = IconThemeData(color: Colors.yellow, size: 30.0); @@ -2121,7 +2103,6 @@ void main() { iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.red), ), - useMaterial3: true, ); await tester.pumpWidget( @@ -2152,7 +2133,6 @@ void main() { ) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.dark().copyWith(onSurfaceVariant: Colors.red), - useMaterial3: true, ); await tester.pumpWidget( MaterialApp( @@ -2180,7 +2160,6 @@ void main() { ) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.dark().copyWith(onSurfaceVariant: Colors.red), - useMaterial3: true, ); await tester.pumpWidget( MaterialApp( @@ -2208,7 +2187,6 @@ void main() { ) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.light().copyWith(onSurfaceVariant: Colors.red), - useMaterial3: true, ); await tester.pumpWidget( MaterialApp( @@ -2236,7 +2214,6 @@ void main() { ) async { final ThemeData themeData = ThemeData( colorScheme: const ColorScheme.light().copyWith(onSurfaceVariant: Colors.red), - useMaterial3: true, ); await tester.pumpWidget( MaterialApp( @@ -2756,9 +2733,7 @@ void main() { Widget buildFrame({double? themeToolbarHeight, double? appBarToolbarHeight}) { final AppBar appBar = AppBar(toolbarHeight: appBarToolbarHeight); return MaterialApp( - theme: ThemeData.light().copyWith( - appBarTheme: AppBarTheme(toolbarHeight: themeToolbarHeight), - ), + theme: ThemeData(appBarTheme: AppBarTheme(toolbarHeight: themeToolbarHeight)), home: Builder( builder: (BuildContext context) { preferredHeight = AppBar.preferredHeightFor(context, appBar.preferredSize); @@ -3420,7 +3395,7 @@ void main() { await tester.pumpWidget( MaterialApp( key: GlobalKey(), - theme: ThemeData.light().copyWith(useMaterial3: false, appBarTheme: const AppBarTheme()), + theme: ThemeData(useMaterial3: false, appBarTheme: const AppBarTheme()), home: Scaffold(appBar: AppBar(title: const Text('title'))), ), ); diff --git a/packages/flutter/test/material/app_bar_theme_test.dart b/packages/flutter/test/material/app_bar_theme_test.dart index 75a94120db..a1e2acb9e1 100644 --- a/packages/flutter/test/material/app_bar_theme_test.dart +++ b/packages/flutter/test/material/app_bar_theme_test.dart @@ -79,7 +79,7 @@ void main() { }); testWidgets('Material3 - Passing no AppBarTheme returns defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -369,14 +369,8 @@ void main() { testWidgets('Material3 - ThemeData colorScheme is used when no AppBarTheme is set', ( WidgetTester tester, ) async { - final ThemeData lightTheme = ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ); - final ThemeData darkTheme = ThemeData.from( - colorScheme: const ColorScheme.dark(), - useMaterial3: true, - ); + final ThemeData lightTheme = ThemeData.from(colorScheme: const ColorScheme.light()); + final ThemeData darkTheme = ThemeData.from(colorScheme: const ColorScheme.dark()); Widget buildFrame(ThemeData appTheme) { return MaterialApp( theme: appTheme, @@ -582,7 +576,6 @@ void main() { style: IconButton.styleFrom(foregroundColor: Colors.red), ), appBarTheme: const AppBarTheme(iconTheme: overallIconTheme), - useMaterial3: true, ), home: Scaffold( appBar: AppBar( @@ -611,7 +604,6 @@ void main() { theme: ThemeData( iconButtonTheme: IconButtonThemeData(style: IconButton.styleFrom(iconSize: 32.0)), appBarTheme: const AppBarTheme(iconTheme: overallIconTheme), - useMaterial3: true, ), home: Scaffold( appBar: AppBar( @@ -644,7 +636,6 @@ void main() { theme: ThemeData( iconButtonTheme: iconButtonTheme, appBarTheme: const AppBarTheme(actionsIconTheme: actionsIconTheme), - useMaterial3: true, ), home: Scaffold( appBar: AppBar( @@ -676,7 +667,6 @@ void main() { theme: ThemeData( iconButtonTheme: iconButtonTheme, appBarTheme: const AppBarTheme(actionsIconTheme: actionsIconTheme), - useMaterial3: true, ), home: Scaffold( appBar: AppBar( @@ -709,7 +699,6 @@ void main() { final ThemeData themeData = ThemeData( iconButtonTheme: iconButtonTheme, appBarTheme: appBarTheme, - useMaterial3: true, ); await tester.pumpWidget( @@ -1213,7 +1202,6 @@ void main() { 'Material3 - AppBarTheme.iconTheme correctly applies custom white color in dark mode', (WidgetTester tester) async { final ThemeData themeData = ThemeData( - useMaterial3: true, brightness: Brightness.dark, appBarTheme: const AppBarTheme(iconTheme: IconThemeData(color: Colors.white)), ); diff --git a/packages/flutter/test/material/app_test.dart b/packages/flutter/test/material/app_test.dart index 10b5523085..28fd4fa940 100644 --- a/packages/flutter/test/material/app_test.dart +++ b/packages/flutter/test/material/app_test.dart @@ -798,7 +798,7 @@ void main() { }); testWidgets('MaterialApp animates theme changes', (WidgetTester tester) async { - final ThemeData lightTheme = ThemeData.light(); + final ThemeData lightTheme = ThemeData(); final ThemeData darkTheme = ThemeData.dark(); await tester.pumpWidget( MaterialApp( @@ -820,7 +820,6 @@ void main() { // Change to dark theme await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(), darkTheme: ThemeData.dark(), themeMode: ThemeMode.dark, home: Builder( @@ -842,7 +841,7 @@ void main() { }); testWidgets('MaterialApp theme animation can be turned off', (WidgetTester tester) async { - final ThemeData lightTheme = ThemeData.light(); + final ThemeData lightTheme = ThemeData(); final ThemeData darkTheme = ThemeData.dark(); int scaffoldRebuilds = 0; @@ -872,7 +871,6 @@ void main() { // Change to dark theme await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(), darkTheme: ThemeData.dark(), themeMode: ThemeMode.dark, themeAnimationDuration: Duration.zero, @@ -1338,7 +1336,6 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), scrollBehavior: const MaterialScrollBehavior(), home: ListView( children: const [SizedBox(height: 1000.0, width: 1000.0, child: Text('Test'))], @@ -1393,7 +1390,6 @@ void main() { (WidgetTester tester) async { Widget buildFrame(Clip clipBehavior) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Column( children: [ SizedBox( @@ -1580,7 +1576,7 @@ void main() { ); testWidgets('Override theme animation using AnimationStyle', (WidgetTester tester) async { - final ThemeData lightTheme = ThemeData.light(); + final ThemeData lightTheme = ThemeData(); final ThemeData darkTheme = ThemeData.dark(); Widget buildWidget({ThemeMode themeMode = ThemeMode.light, AnimationStyle? animationStyle}) { diff --git a/packages/flutter/test/material/autocomplete_test.dart b/packages/flutter/test/material/autocomplete_test.dart index 80ee55b210..71aa6d28d2 100644 --- a/packages/flutter/test/material/autocomplete_test.dart +++ b/packages/flutter/test/material/autocomplete_test.dart @@ -439,7 +439,7 @@ void main() { const Color highlightColor = Color(0xFF112233); await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith(focusColor: highlightColor), + theme: ThemeData(focusColor: highlightColor), home: Scaffold( body: Autocomplete( optionsBuilder: (TextEditingValue textEditingValue) { @@ -478,7 +478,7 @@ void main() { const Color highlightColor = Color(0xFF112233); await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith(focusColor: highlightColor), + theme: ThemeData(focusColor: highlightColor), home: Scaffold( body: Autocomplete( optionsBuilder: (TextEditingValue textEditingValue) { @@ -601,7 +601,7 @@ void main() { const Color highlightColor = Color(0xFF112233); await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith(focusColor: highlightColor), + theme: ThemeData(focusColor: highlightColor), home: Scaffold( body: Autocomplete( optionsBuilder: (TextEditingValue textEditingValue) { diff --git a/packages/flutter/test/material/back_button_test.dart b/packages/flutter/test/material/back_button_test.dart index 8ee540995b..77755232ca 100644 --- a/packages/flutter/test/material/back_button_test.dart +++ b/packages/flutter/test/material/back_button_test.dart @@ -132,9 +132,8 @@ void main() { testWidgets('BackButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: BackButton( style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), ), @@ -152,9 +151,8 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: BackButton( color: Colors.green, style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), @@ -269,9 +267,8 @@ void main() { testWidgets('CloseButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: CloseButton( style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), ), @@ -289,9 +286,8 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: CloseButton( color: Colors.green, style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), diff --git a/packages/flutter/test/material/badge_test.dart b/packages/flutter/test/material/badge_test.dart index 76b1d32009..6a767a0425 100644 --- a/packages/flutter/test/material/badge_test.dart +++ b/packages/flutter/test/material/badge_test.dart @@ -12,7 +12,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Align( alignment: Alignment.topLeft, child: Builder( @@ -53,7 +52,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Directionality( textDirection: TextDirection.rtl, child: Align( @@ -91,7 +89,6 @@ void main() { Widget buildFrame(int count) { return MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Align( alignment: Alignment.topLeft, child: Builder( @@ -141,7 +138,7 @@ void main() { }); testWidgets('Small Badge defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -173,7 +170,7 @@ void main() { }); testWidgets('Small Badge RTL defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -207,7 +204,7 @@ void main() { }); testWidgets('Large Badge textStyle and colors', (WidgetTester tester) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color green = Color(0xff00ff00); const Color black = Color(0xff000000); @@ -235,9 +232,8 @@ void main() { testWidgets('isLabelVisible', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData.light(useMaterial3: true), - home: const Align( + const MaterialApp( + home: Align( alignment: Alignment.topLeft, child: Badge(label: Text('0'), isLabelVisible: false, child: Icon(Icons.add)), ), @@ -258,7 +254,6 @@ void main() { Widget buildFrame(Alignment alignment, [Offset offset = Offset.zero]) { return MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Align( alignment: Alignment.topLeft, child: Badge( @@ -356,7 +351,6 @@ void main() { Widget buildFrame(Alignment alignment, [Offset offset = Offset.zero]) { return MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Align( alignment: Alignment.topLeft, child: Badge( @@ -426,7 +420,6 @@ void main() { Widget buildFrame(Alignment alignment, [Offset offset = Offset.zero]) { return MaterialApp( - theme: ThemeData.light(useMaterial3: true), home: Align( alignment: Alignment.topLeft, child: Badge( diff --git a/packages/flutter/test/material/badge_theme_test.dart b/packages/flutter/test/material/badge_theme_test.dart index 70fb8a505c..befd3a6b9d 100644 --- a/packages/flutter/test/material/badge_theme_test.dart +++ b/packages/flutter/test/material/badge_theme_test.dart @@ -90,7 +90,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(useMaterial3: true).copyWith(badgeTheme: badgeTheme), + theme: ThemeData(badgeTheme: badgeTheme), home: const Scaffold(body: Badge(label: Text('1234'), child: Icon(Icons.add))), ), ); diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index a5c1fb10d0..4cba28b9e1 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -77,7 +77,7 @@ void main() { WidgetTester tester, ) async { const String contentText = 'Content'; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); late final ThemeData localizedTheme; await tester.pumpWidget( @@ -123,7 +123,7 @@ void main() { (WidgetTester tester) async { const String contentText = 'Content'; const Key tapTarget = Key('tap-target'); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); late final ThemeData localizedTheme; await tester.pumpWidget( diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index 05f94c804f..1a26ae62b3 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -20,9 +20,8 @@ void main() { const Color shadowColor = Colors.black; await tester.pumpWidget( - MaterialApp( - theme: ThemeData.light(useMaterial3: true), - home: const Scaffold( + const MaterialApp( + home: Scaffold( bottomNavigationBar: BottomAppBar(elevation: elevation, shadowColor: shadowColor), ), ), @@ -40,9 +39,8 @@ void main() { const Color bottomAppBarColor = Colors.black45; await tester.pumpWidget( - MaterialApp( - theme: ThemeData.light(useMaterial3: true), - home: const Scaffold( + const MaterialApp( + home: Scaffold( bottomNavigationBar: BottomAppBar( color: bottomAppBarColor, // Avoid getting a surface tint color, to keep the color check below simple @@ -140,7 +138,7 @@ void main() { child: RepaintBoundary( key: key, child: MaterialApp( - theme: ThemeData(useMaterial3: true), + theme: ThemeData(), home: Scaffold( floatingActionButton: FloatingActionButton(onPressed: () {}), floatingActionButtonLocation: location, @@ -253,9 +251,7 @@ void main() { testWidgets('Material3 - Color overrides theme color', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light( - useMaterial3: true, - ).copyWith(bottomAppBarTheme: const BottomAppBarTheme(color: Color(0xffffff00))), + theme: ThemeData(bottomAppBarTheme: const BottomAppBarTheme(color: Color(0xffffff00))), home: Builder( builder: (BuildContext context) { return const Scaffold( @@ -280,7 +276,7 @@ void main() { testWidgets('Material3 - Shadow color is transparent', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), + theme: ThemeData(), home: const Scaffold( floatingActionButton: FloatingActionButton(onPressed: null), bottomNavigationBar: BottomAppBar(color: Color(0xff0000ff)), @@ -317,7 +313,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.dark(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold(bottomNavigationBar: BottomAppBar(color: colorScheme.surfaceContainer)), ), ); @@ -488,7 +484,7 @@ void main() { const double safeAreaPadding = 50.0; await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), + theme: ThemeData(), home: const MediaQuery( data: MediaQueryData(padding: EdgeInsets.all(safeAreaPadding)), child: Scaffold(bottomNavigationBar: BottomAppBar(child: Center(child: Text('safe')))), @@ -583,7 +579,7 @@ void main() { WidgetTester tester, ) async { // Regression test for https://github.com/flutter/flutter/issues/80878 - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -712,7 +708,7 @@ void main() { viewPadding: EdgeInsets.only(bottom: bottomPadding), ), child: MaterialApp( - theme: ThemeData(useMaterial3: true), + theme: ThemeData(), home: Scaffold( floatingActionButtonLocation: FloatingActionButtonLocation.endContained, floatingActionButton: FloatingActionButton(onPressed: () {}), diff --git a/packages/flutter/test/material/bottom_app_bar_theme_test.dart b/packages/flutter/test/material/bottom_app_bar_theme_test.dart index 9cb9b91130..9f052d4a18 100644 --- a/packages/flutter/test/material/bottom_app_bar_theme_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_theme_test.dart @@ -136,7 +136,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, bottomAppBarTheme: theme), + theme: ThemeData(bottomAppBarTheme: theme), home: const Scaffold( body: BottomAppBar(color: babColor, surfaceTintColor: Colors.transparent), ), @@ -153,7 +153,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, bottomAppBarTheme: theme), + theme: ThemeData(bottomAppBarTheme: theme), home: const Scaffold(body: BottomAppBar(surfaceTintColor: Colors.transparent)), ), ); @@ -163,7 +163,7 @@ void main() { }); testWidgets('Material3 - BAB theme does not affect defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -210,7 +210,7 @@ void main() { const BottomAppBarTheme theme = BottomAppBarTheme(surfaceTintColor: babThemeSurfaceTintColor); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, bottomAppBarTheme: theme), + theme: ThemeData(bottomAppBarTheme: theme), home: const Scaffold( body: BottomAppBar(color: color, surfaceTintColor: babSurfaceTintColor), ), @@ -228,7 +228,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, bottomAppBarTheme: theme), + theme: ThemeData(bottomAppBarTheme: theme), home: const Scaffold(body: BottomAppBar(color: color)), ), ); diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 6003fd614f..1c58dd9a4e 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -937,7 +937,6 @@ void main() { surface: surfaceColor, surfaceTint: surfaceTintColor, ), - useMaterial3: true, ), home: Scaffold( body: BottomSheet( @@ -967,7 +966,6 @@ void main() { testWidgets('Material3 - BottomSheet has transparent shadow', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: BottomSheet( onClosing: () {}, @@ -1065,10 +1063,7 @@ void main() { final GlobalKey scaffoldKey = GlobalKey(); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: Scaffold(key: scaffoldKey, body: const Center(child: Text('body'))), - ), + MaterialApp(home: Scaffold(key: scaffoldKey, body: const Center(child: Text('body')))), ); showModalBottomSheet( @@ -1145,10 +1140,7 @@ void main() { final GlobalKey scaffoldKey = GlobalKey(); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: Scaffold(key: scaffoldKey, body: const Center(child: Text('body'))), - ), + MaterialApp(home: Scaffold(key: scaffoldKey, body: const Center(child: Text('body')))), ); showModalBottomSheet( @@ -1269,7 +1261,7 @@ void main() { Widget buildScaffold(GlobalKey scaffoldKey) { return MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( bottomSheetTheme: BottomSheetThemeData( dragHandleColor: MaterialStateColor.resolveWith((Set states) { if (states.contains(MaterialState.hovered)) { @@ -1316,9 +1308,7 @@ void main() { ) async { Widget buildScaffold(GlobalKey scaffoldKey, {Size? dragHandleSize}) { return MaterialApp( - theme: ThemeData.light().copyWith( - bottomSheetTheme: BottomSheetThemeData(dragHandleSize: dragHandleSize), - ), + theme: ThemeData(bottomSheetTheme: BottomSheetThemeData(dragHandleSize: dragHandleSize)), home: Scaffold(key: scaffoldKey), ); } @@ -1351,9 +1341,7 @@ void main() { ) async { Widget buildScaffold(GlobalKey scaffoldKey, {Size? dragHandleSize}) { return MaterialApp( - theme: ThemeData.light().copyWith( - bottomSheetTheme: BottomSheetThemeData(dragHandleSize: dragHandleSize), - ), + theme: ThemeData(bottomSheetTheme: BottomSheetThemeData(dragHandleSize: dragHandleSize)), home: Scaffold(key: scaffoldKey), ); } @@ -2011,9 +1999,8 @@ void main() { group('constraints', () { testWidgets('Material3 - Default constraints are max width 640', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const MediaQuery( + const MaterialApp( + home: MediaQuery( data: MediaQueryData(size: Size(1000, 1000)), child: Scaffold( body: Center(child: Text('body')), @@ -2107,7 +2094,6 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - useMaterial3: true, bottomSheetTheme: const BottomSheetThemeData( constraints: BoxConstraints(maxWidth: sheetMaxWidth), ), diff --git a/packages/flutter/test/material/bottom_sheet_theme_test.dart b/packages/flutter/test/material/bottom_sheet_theme_test.dart index 6a78120a61..05fd173dfc 100644 --- a/packages/flutter/test/material/bottom_sheet_theme_test.dart +++ b/packages/flutter/test/material/bottom_sheet_theme_test.dart @@ -85,7 +85,6 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: BottomSheet( onClosing: () {}, @@ -314,7 +313,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( bottomSheetTheme: const BottomSheetThemeData( elevation: lightElevation, backgroundColor: lightBackgroundColor, diff --git a/packages/flutter/test/material/calendar_date_picker_test.dart b/packages/flutter/test/material/calendar_date_picker_test.dart index 0af4a8ca28..3742776896 100644 --- a/packages/flutter/test/material/calendar_date_picker_test.dart +++ b/packages/flutter/test/material/calendar_date_picker_test.dart @@ -481,7 +481,6 @@ void main() { testWidgets('Material3 - currentDate is highlighted', (WidgetTester tester) async { await tester.pumpWidget( calendarDatePicker( - useMaterial3: true, initialDate: DateTime(2016, DateTime.january, 15), currentDate: DateTime(2016, 1, 2), ), @@ -519,7 +518,6 @@ void main() { ) async { await tester.pumpWidget( calendarDatePicker( - useMaterial3: true, firstDate: DateTime(2016, 1, 3), lastDate: DateTime(2016, 1, 31), currentDate: DateTime(2016, 1, 2), // not between first and last diff --git a/packages/flutter/test/material/card_theme_test.dart b/packages/flutter/test/material/card_theme_test.dart index 4aea6563c1..e1ad7af35e 100644 --- a/packages/flutter/test/material/card_theme_test.dart +++ b/packages/flutter/test/material/card_theme_test.dart @@ -91,7 +91,7 @@ void main() { }); testWidgets('Material3 - Passing no CardTheme returns defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget(MaterialApp(theme: theme, home: const Scaffold(body: Card()))); final Padding padding = _getCardPadding(tester); @@ -180,7 +180,7 @@ void main() { testWidgets('Material3 - ThemeData properties are used when no CardTheme is set', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); await tester.pumpWidget(MaterialApp(theme: themeData, home: const Scaffold(body: Card()))); @@ -199,7 +199,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(cardTheme: cardTheme, useMaterial3: true), + theme: ThemeData(cardTheme: cardTheme), home: Scaffold( body: RepaintBoundary( key: painterKey, diff --git a/packages/flutter/test/material/checkbox_list_tile_test.dart b/packages/flutter/test/material/checkbox_list_tile_test.dart index a522e5e4ff..5ccdc5e4d5 100644 --- a/packages/flutter/test/material/checkbox_list_tile_test.dart +++ b/packages/flutter/test/material/checkbox_list_tile_test.dart @@ -82,7 +82,6 @@ void main() { Widget buildFrame(Color? color) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: CheckboxListTile(value: true, checkColor: color, onChanged: (bool? value) {}), ), @@ -352,7 +351,7 @@ void main() { Widget buildFrame({Color? activeColor, Color? fillColor}) { return MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( checkboxTheme: CheckboxThemeData( fillColor: MaterialStateProperty.resolveWith((Set states) { return states.contains(MaterialState.selected) ? fillColor : null; @@ -918,7 +917,6 @@ void main() { Widget buildCheckbox({bool active = false, bool useOverlay = true}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: CheckboxListTile( value: active, @@ -1077,7 +1075,7 @@ void main() { }); testWidgets('Material3 - CheckboxListTile respects isError', (WidgetTester tester) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp() { diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart index e05c02d5e2..bd0f10f31e 100644 --- a/packages/flutter/test/material/checkbox_test.dart +++ b/packages/flutter/test/material/checkbox_test.dart @@ -455,7 +455,7 @@ void main() { testWidgets('Material3 - Checkbox tristate rendering, programmatic transitions', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildFrame(bool? checkboxValue) { return Theme( data: theme, @@ -585,7 +585,7 @@ void main() { }); testWidgets('Material3 - Checkbox color rendering', (WidgetTester tester) async { - ThemeData theme = ThemeData(useMaterial3: true); + ThemeData theme = ThemeData(); const Color borderColor = Color(0xFF6750A4); Color checkColor = const Color(0xffFFFFFF); Color activeColor; @@ -733,7 +733,7 @@ void main() { ) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp({bool enabled = true}) { @@ -948,7 +948,7 @@ void main() { ) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp({bool enabled = true}) { return MaterialApp( theme: theme, @@ -1557,7 +1557,7 @@ void main() { addTearDown(focusNode.dispose); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; Widget buildCheckbox({bool active = false, bool focused = false}) { return MaterialApp( @@ -1991,7 +1991,7 @@ void main() { ) async { const Color borderColor = Color(0xfff44336); const BorderSide side = BorderSide(width: 4, color: borderColor); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp({bool? value, bool enabled = true}) { return MaterialApp( @@ -2093,7 +2093,7 @@ void main() { ) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = true; Widget buildApp({bool autoFocus = true}) { @@ -2179,7 +2179,7 @@ void main() { ) async { final FocusNode focusNode = FocusNode(debugLabel: 'Checkbox'); addTearDown(focusNode.dispose); - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); const Color borderColor = Color(0xffffeb3b); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool? value = false; @@ -2261,7 +2261,7 @@ void main() { }); testWidgets('Material3 - Checkbox has correct default shape', (WidgetTester tester) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); Widget buildApp() { return MaterialApp( @@ -2427,7 +2427,7 @@ void main() { testWidgets('Material3 - Checkbox respects fillColor when it is unchecked', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color activeBackgroundColor = Color(0xff123456); const Color inactiveBackgroundColor = Color(0xff654321); diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index ccc794ed2f..975b195eec 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -213,7 +213,7 @@ Finder findTooltipContainer(String tooltipText) { void main() { testWidgets('M3 Chip defaults', (WidgetTester tester) async { late TextTheme textTheme; - final ThemeData lightTheme = ThemeData.light(); + final ThemeData lightTheme = ThemeData(); final ThemeData darkTheme = ThemeData.dark(); Widget buildFrame(ThemeData theme) { @@ -2503,7 +2503,7 @@ void main() { Widget buildChip() { return wrapForChip( child: Theme( - data: ThemeData.light().copyWith( + data: ThemeData( chipTheme: const ChipThemeData( labelStyle: TextStyle(height: 4), // inherit: true ), @@ -3953,7 +3953,7 @@ void main() { body: Focus( focusNode: focusNode, child: ChipTheme( - data: ThemeData.light().chipTheme.copyWith(side: defaultBorderSide), + data: ThemeData().chipTheme.copyWith(side: defaultBorderSide), child: ChoiceChip( label: const Text('Chip'), selected: selected, @@ -4068,7 +4068,7 @@ void main() { body: Focus( focusNode: focusNode, child: ChipTheme( - data: ThemeData.light().chipTheme.copyWith(side: defaultBorderSide), + data: ThemeData().chipTheme.copyWith(side: defaultBorderSide), child: ChoiceChip( label: const Text('Chip'), selected: selected, @@ -4283,7 +4283,7 @@ void main() { return MaterialApp( theme: ThemeData( useMaterial3: false, - chipTheme: ThemeData.light().chipTheme.copyWith(shape: themeShape, side: themeBorderSide), + chipTheme: ThemeData().chipTheme.copyWith(shape: themeShape, side: themeBorderSide), ), home: Scaffold( body: ChoiceChip( @@ -4343,7 +4343,7 @@ void main() { Widget chipWidget({bool enabled = true, bool selected = false}) { return MaterialApp( theme: ThemeData( - chipTheme: ThemeData.light().chipTheme.copyWith(shape: themeShape, side: themeBorderSide), + chipTheme: ThemeData().chipTheme.copyWith(shape: themeShape, side: themeBorderSide), ), home: Scaffold( body: ChoiceChip( diff --git a/packages/flutter/test/material/chip_theme_test.dart b/packages/flutter/test/material/chip_theme_test.dart index eced9a31af..1b955a0afe 100644 --- a/packages/flutter/test/material/chip_theme_test.dart +++ b/packages/flutter/test/material/chip_theme_test.dart @@ -886,7 +886,7 @@ void main() { return MaterialApp( theme: ThemeData( useMaterial3: false, - chipTheme: ThemeData.light().chipTheme.copyWith( + chipTheme: ThemeData().chipTheme.copyWith( side: MaterialStateBorderSide.resolveWith(getBorderSide), ), ), diff --git a/packages/flutter/test/material/choice_chip_test.dart b/packages/flutter/test/material/choice_chip_test.dart index fe9653acd7..85b0dbd630 100644 --- a/packages/flutter/test/material/choice_chip_test.dart +++ b/packages/flutter/test/material/choice_chip_test.dart @@ -432,7 +432,6 @@ void main() { }); Widget buildApp({required bool enabled, required bool selected}) { return wrapForChip( - useMaterial3: true, child: Column( children: [ ChoiceChip( @@ -506,7 +505,6 @@ void main() { const Color selectedColor = Color(0xffff0000); Widget buildApp({required bool enabled, required bool selected}) { return wrapForChip( - useMaterial3: true, child: Column( children: [ ChoiceChip( diff --git a/packages/flutter/test/material/data_table_test.dart b/packages/flutter/test/material/data_table_test.dart index 243aedc888..6316f17614 100644 --- a/packages/flutter/test/material/data_table_test.dart +++ b/packages/flutter/test/material/data_table_test.dart @@ -1248,7 +1248,7 @@ void main() { }); testWidgets('DataRow renders default selected row colors', (WidgetTester tester) async { - final ThemeData themeData = ThemeData.light(); + final ThemeData themeData = ThemeData(); Widget buildTable({bool selected = false}) { return MaterialApp( theme: themeData, diff --git a/packages/flutter/test/material/date_picker_test.dart b/packages/flutter/test/material/date_picker_test.dart index dc643e80d2..9ff376a6ce 100644 --- a/packages/flutter/test/material/date_picker_test.dart +++ b/packages/flutter/test/material/date_picker_test.dart @@ -177,7 +177,7 @@ void main() { }); testWidgets('Default dialog properties', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await prepareDatePicker(tester, (Future date) async { final Material dialogMaterial = tester.widget( find.descendant(of: find.byType(Dialog), matching: find.byType(Material)).first, @@ -846,7 +846,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: DatePickerDialog( initialDate: initialDate, @@ -948,7 +947,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: DatePickerDialog( initialDate: initialDate, diff --git a/packages/flutter/test/material/date_picker_theme_test.dart b/packages/flutter/test/material/date_picker_theme_test.dart index 41af68d57f..0b5afd1d27 100644 --- a/packages/flutter/test/material/date_picker_theme_test.dart +++ b/packages/flutter/test/material/date_picker_theme_test.dart @@ -150,7 +150,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Builder( builder: (BuildContext context) { m3 = DatePickerTheme.defaults(context); @@ -526,7 +525,7 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(datePickerTheme: datePickerTheme, useMaterial3: true), + theme: ThemeData(datePickerTheme: datePickerTheme), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -661,7 +660,7 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(datePickerTheme: datePickerTheme, useMaterial3: true), + theme: ThemeData(datePickerTheme: datePickerTheme), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -712,7 +711,7 @@ void main() { testWidgets('DateRangePickerDialog uses ThemeData datePicker theme', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(datePickerTheme: datePickerTheme, useMaterial3: true), + theme: ThemeData(datePickerTheme: datePickerTheme), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -852,7 +851,7 @@ void main() { addTearDown(tester.view.reset); await tester.pumpWidget( MaterialApp( - theme: ThemeData(datePickerTheme: datePickerTheme, useMaterial3: true), + theme: ThemeData(datePickerTheme: datePickerTheme), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -892,7 +891,6 @@ void main() { }) { return MaterialApp( theme: ThemeData( - useMaterial3: true, inputDecorationTheme: inputDecorationTheme, datePickerTheme: datePickerTheme, ), @@ -1064,10 +1062,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData( - datePickerTheme: DatePickerThemeData(yearOverlayColor: yearOverlayColor), - useMaterial3: true, - ), + theme: ThemeData(datePickerTheme: DatePickerThemeData(yearOverlayColor: yearOverlayColor)), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -1146,7 +1141,6 @@ void main() { datePickerTheme: DatePickerThemeData( rangeSelectionOverlayColor: rangeSelectionOverlayColor, ), - useMaterial3: true, ), home: Directionality( textDirection: TextDirection.ltr, diff --git a/packages/flutter/test/material/date_range_picker_test.dart b/packages/flutter/test/material/date_range_picker_test.dart index ce876fe84c..34b24b875d 100644 --- a/packages/flutter/test/material/date_range_picker_test.dart +++ b/packages/flutter/test/material/date_range_picker_test.dart @@ -171,7 +171,7 @@ void main() { }); testWidgets('Default Dialog properties (calendar mode)', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await preparePicker(tester, (Future range) async { final Material dialogMaterial = tester.widget( find.descendant(of: find.byType(Dialog), matching: find.byType(Material)).first, @@ -190,7 +190,7 @@ void main() { }); testWidgets('Default Dialog properties (input mode)', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await preparePicker(tester, (Future range) async { final Material dialogMaterial = tester.widget( find.descendant(of: find.byType(Dialog), matching: find.byType(Material)).first, @@ -209,7 +209,7 @@ void main() { }); testWidgets('Scaffold and AppBar defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await preparePicker(tester, (Future range) async { final Scaffold scaffold = tester.widget(find.byType(Scaffold)); expect(scaffold.backgroundColor, null); @@ -946,7 +946,7 @@ void main() { }); testWidgets('Default Dialog properties (input mode)', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await preparePicker(tester, (Future range) async { final Material dialogMaterial = tester.widget( find.descendant(of: find.byType(Dialog), matching: find.byType(Material)).first, @@ -1187,9 +1187,7 @@ void main() { const InputBorder border = InputBorder.none; await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith( - inputDecorationTheme: const InputDecorationTheme(border: border), - ), + theme: ThemeData(inputDecorationTheme: const InputDecorationTheme(border: border)), home: Material( child: Builder( builder: (BuildContext context) { @@ -1487,9 +1485,7 @@ void main() { const InputBorder border = InputBorder.none; await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith( - inputDecorationTheme: const InputDecorationTheme(border: border), - ), + theme: ThemeData(inputDecorationTheme: const InputDecorationTheme(border: border)), home: Material( child: Builder( builder: (BuildContext context) { diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index c2f1baf063..f01c488b7c 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -76,7 +76,7 @@ final ShapeBorder _defaultM3DialogShape = RoundedRectangleBorder( ); void main() { - final ThemeData material3Theme = ThemeData(useMaterial3: true, brightness: Brightness.dark); + final ThemeData material3Theme = ThemeData(brightness: Brightness.dark); final ThemeData material2Theme = ThemeData(useMaterial3: false, brightness: Brightness.dark); testWidgets('Dialog is scrollable', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index 7f531243b3..6e47b24201 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -416,7 +416,6 @@ void main() { alignment: Alignment.topRight, ); final ThemeData theme = ThemeData( - useMaterial3: true, dialogTheme: const DialogThemeData(alignment: Alignment.bottomLeft), ); @@ -460,10 +459,7 @@ void main() { borderRadius: BorderRadius.all(Radius.circular(16.0)), ); const AlertDialog dialog = AlertDialog(title: Text('Title'), actions: []); - final ThemeData theme = ThemeData( - useMaterial3: true, - dialogTheme: const DialogThemeData(shape: customBorder), - ); + final ThemeData theme = ThemeData(dialogTheme: const DialogThemeData(shape: customBorder)); await tester.pumpWidget(_appWithDialog(tester, dialog, theme: theme)); await tester.tap(find.text('X')); @@ -542,7 +538,7 @@ void main() { testWidgets('Material3 - Custom Icon Color - Theme - lowest preference', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const AlertDialog dialog = AlertDialog(icon: Icon(Icons.ac_unit), actions: []); await tester.pumpWidget(_appWithDialog(tester, dialog, theme: theme)); @@ -610,10 +606,7 @@ void main() { const String titleText = 'Title'; const TextStyle titleTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(title: Text(titleText)); - final ThemeData theme = ThemeData( - useMaterial3: true, - textTheme: const TextTheme(headlineSmall: titleTextStyle), - ); + final ThemeData theme = ThemeData(textTheme: const TextTheme(headlineSmall: titleTextStyle)); await tester.pumpWidget(_appWithDialog(tester, dialog, theme: theme)); await tester.tap(find.text('X')); @@ -727,10 +720,7 @@ void main() { const String contentText = 'Content'; const TextStyle contentTextStyle = TextStyle(color: Colors.pink); const AlertDialog dialog = AlertDialog(content: Text(contentText)); - final ThemeData theme = ThemeData( - useMaterial3: true, - textTheme: const TextTheme(bodyMedium: contentTextStyle), - ); + final ThemeData theme = ThemeData(textTheme: const TextTheme(bodyMedium: contentTextStyle)); await tester.pumpWidget(_appWithDialog(tester, dialog, theme: theme)); await tester.tap(find.text('X')); diff --git a/packages/flutter/test/material/divider_test.dart b/packages/flutter/test/material/divider_test.dart index 040df20f19..c67f84a36c 100644 --- a/packages/flutter/test/material/divider_test.dart +++ b/packages/flutter/test/material/divider_test.dart @@ -7,9 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { testWidgets('Material3 - Divider control test', (WidgetTester tester) async { - await tester.pumpWidget( - MaterialApp(theme: ThemeData(useMaterial3: true), home: const Center(child: Divider())), - ); + await tester.pumpWidget(const MaterialApp(home: Center(child: Divider()))); final RenderBox box = tester.firstRenderObject(find.byType(Divider)); expect(box.size.height, 16.0); final Container container = tester.widget(find.byType(Container)); @@ -97,12 +95,7 @@ void main() { }); testWidgets('Material3 - Vertical Divider Test', (WidgetTester tester) async { - await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Center(child: VerticalDivider()), - ), - ); + await tester.pumpWidget(const MaterialApp(home: Center(child: VerticalDivider()))); final RenderBox box = tester.firstRenderObject(find.byType(VerticalDivider)); expect(box.size.width, 16.0); final Container container = tester.widget(find.byType(Container)); diff --git a/packages/flutter/test/material/divider_theme_test.dart b/packages/flutter/test/material/divider_theme_test.dart index 1277deec62..79853f10eb 100644 --- a/packages/flutter/test/material/divider_theme_test.dart +++ b/packages/flutter/test/material/divider_theme_test.dart @@ -61,7 +61,7 @@ void main() { group('Material3 - Horizontal Divider', () { testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget(MaterialApp(theme: theme, home: const Scaffold(body: Divider()))); final RenderBox box = tester.firstRenderObject(find.byType(Divider)); @@ -83,7 +83,7 @@ void main() { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, dividerTheme: dividerTheme), + theme: ThemeData(dividerTheme: dividerTheme), home: const Scaffold(body: Divider()), ), ); @@ -105,10 +105,7 @@ void main() { testWidgets('DividerTheme overrides defaults', (WidgetTester tester) async { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: Scaffold(body: DividerTheme(data: dividerTheme, child: const Divider())), - ), + MaterialApp(home: Scaffold(body: DividerTheme(data: dividerTheme, child: const Divider()))), ); final Container container = tester.widget(find.byType(Container)); @@ -157,7 +154,7 @@ void main() { group('Material3 - Vertical Divider', () { testWidgets('Passing no DividerThemeData returns defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp(theme: theme, home: const Scaffold(body: VerticalDivider())), ); @@ -206,7 +203,6 @@ void main() { final DividerThemeData dividerTheme = _dividerTheme(); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold(body: DividerTheme(data: dividerTheme, child: const VerticalDivider())), ), ); diff --git a/packages/flutter/test/material/drawer_button_test.dart b/packages/flutter/test/material/drawer_button_test.dart index b61fbb1bb5..d87b639a44 100644 --- a/packages/flutter/test/material/drawer_button_test.dart +++ b/packages/flutter/test/material/drawer_button_test.dart @@ -121,9 +121,8 @@ void main() { testWidgets('DrawerButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: DrawerButton( style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), ), @@ -235,9 +234,8 @@ void main() { testWidgets('EndDrawerButton color with ButtonStyle', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Material( + const MaterialApp( + home: Material( child: EndDrawerButton( style: ButtonStyle(iconColor: MaterialStatePropertyAll(Colors.red)), ), diff --git a/packages/flutter/test/material/drawer_test.dart b/packages/flutter/test/material/drawer_test.dart index 9d70a68fbd..0476c3ad68 100644 --- a/packages/flutter/test/material/drawer_test.dart +++ b/packages/flutter/test/material/drawer_test.dart @@ -54,7 +54,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( drawer: Drawer( child: ListView( @@ -617,9 +616,8 @@ void main() { testWidgets('Material3 - Drawer default shape (ltr)', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Directionality( + const MaterialApp( + home: Directionality( textDirection: TextDirection.ltr, child: Scaffold(drawer: Drawer(), endDrawer: Drawer()), ), @@ -674,9 +672,8 @@ void main() { testWidgets('Material3 - Drawer default shape (rtl)', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Directionality( + const MaterialApp( + home: Directionality( textDirection: TextDirection.rtl, child: Scaffold(drawer: Drawer(), endDrawer: Drawer()), ), @@ -730,9 +727,7 @@ void main() { }); testWidgets('Material3 - Drawer clip behavior', (WidgetTester tester) async { - await tester.pumpWidget( - MaterialApp(theme: ThemeData(useMaterial3: true), home: const Scaffold(drawer: Drawer())), - ); + await tester.pumpWidget(const MaterialApp(home: Scaffold(drawer: Drawer()))); final Finder drawerMaterial = find.descendant( of: find.byType(Drawer), @@ -755,10 +750,7 @@ void main() { // Provide a custom clip behavior. await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(drawer: Drawer(clipBehavior: Clip.antiAlias)), - ), + const MaterialApp(home: Scaffold(drawer: Drawer(clipBehavior: Clip.antiAlias))), ); // Open the drawer again. diff --git a/packages/flutter/test/material/drawer_theme_test.dart b/packages/flutter/test/material/drawer_theme_test.dart index 82361e3625..1d2939759e 100644 --- a/packages/flutter/test/material/drawer_theme_test.dart +++ b/packages/flutter/test/material/drawer_theme_test.dart @@ -88,7 +88,7 @@ void main() { 'Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified', (WidgetTester tester) async { final GlobalKey scaffoldKey = GlobalKey(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp(theme: theme, home: Scaffold(key: scaffoldKey, drawer: const Drawer())), ); @@ -137,7 +137,7 @@ void main() { 'Material3 - Default values are used when no Drawer or DrawerThemeData properties are specified in end drawer', (WidgetTester tester) async { final GlobalKey scaffoldKey = GlobalKey(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp(theme: theme, home: Scaffold(key: scaffoldKey, endDrawer: const Drawer())), ); diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index 282ec93863..cfcb2d58c8 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -367,7 +367,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1438,7 +1438,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: ElevatedButton(key: key, onPressed: () {}, child: const Text('ElevatedButton')), @@ -1457,7 +1457,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: ElevatedButton.icon( @@ -1636,7 +1636,7 @@ void main() { testWidgets( 'ElevatedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/elevated_button_theme_test.dart b/packages/flutter/test/material/elevated_button_theme_test.dart index 536aa0bee8..382361572a 100644 --- a/packages/flutter/test/material/elevated_button_theme_test.dart +++ b/packages/flutter/test/material/elevated_button_theme_test.dart @@ -25,7 +25,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: colorScheme, useMaterial3: true), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold( body: Center(child: ElevatedButton(onPressed: () {}, child: const Text('button'))), ), @@ -277,10 +277,7 @@ void main() { Widget buildFrame({Color? overallShadowColor, Color? themeShadowColor, Color? shadowColor}) { return MaterialApp( - theme: ThemeData.from( - useMaterial3: true, - colorScheme: colorScheme.copyWith(shadow: overallShadowColor), - ), + theme: ThemeData.from(colorScheme: colorScheme.copyWith(shadow: overallShadowColor)), home: Scaffold( body: Center( child: ElevatedButtonTheme( diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 14b168c15d..1bdb32afe8 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -553,7 +553,7 @@ void main() { }); testWidgets('ExpansionTile default iconColor, textColor', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/filled_button_test.dart b/packages/flutter/test/material/filled_button_test.dart index 8e36e80e09..7db4699276 100644 --- a/packages/flutter/test/material/filled_button_test.dart +++ b/packages/flutter/test/material/filled_button_test.dart @@ -471,7 +471,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -543,7 +543,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1619,7 +1619,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: FilledButton(key: key, onPressed: () {}, child: const Text('FilledButton')), @@ -1638,7 +1638,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: FilledButton.icon( @@ -1768,7 +1768,7 @@ void main() { testWidgets( 'FilledButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/floating_action_button_test.dart b/packages/flutter/test/material/floating_action_button_test.dart index d9acebc660..d81b2b6b1e 100644 --- a/packages/flutter/test/material/floating_action_button_test.dart +++ b/packages/flutter/test/material/floating_action_button_test.dart @@ -17,7 +17,7 @@ import '../widgets/feedback_tester.dart'; import '../widgets/semantics_tester.dart'; void main() { - final ThemeData material3Theme = ThemeData(useMaterial3: true); + final ThemeData material3Theme = ThemeData(); final ThemeData material2Theme = ThemeData(useMaterial3: false); testWidgets('Floating Action Button control test', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/floating_action_button_theme_test.dart b/packages/flutter/test/material/floating_action_button_theme_test.dart index e341205bf4..aa3b33d6ce 100644 --- a/packages/flutter/test/material/floating_action_button_theme_test.dart +++ b/packages/flutter/test/material/floating_action_button_theme_test.dart @@ -28,7 +28,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold( floatingActionButton: FloatingActionButton( onPressed: () {}, @@ -273,7 +273,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, colorScheme: colorScheme).copyWith( + theme: ThemeData(colorScheme: colorScheme).copyWith( floatingActionButtonTheme: const FloatingActionButtonThemeData( extendedSizeConstraints: constraints, extendedIconLabelSpacing: iconLabelSpacing, @@ -378,7 +378,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, colorScheme: colorScheme).copyWith( + theme: ThemeData(colorScheme: colorScheme).copyWith( floatingActionButtonTheme: const FloatingActionButtonThemeData( extendedIconLabelSpacing: 25.0, extendedPadding: EdgeInsetsDirectional.only(start: 7.0, end: 8.0), diff --git a/packages/flutter/test/material/icon_button_test.dart b/packages/flutter/test/material/icon_button_test.dart index 735e52cbb3..76e089c825 100644 --- a/packages/flutter/test/material/icon_button_test.dart +++ b/packages/flutter/test/material/icon_button_test.dart @@ -354,7 +354,7 @@ void main() { // Test for Material 3 await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: colorScheme, useMaterial3: true), + theme: ThemeData.from(colorScheme: colorScheme), home: Directionality( textDirection: TextDirection.ltr, child: Row( @@ -1114,7 +1114,7 @@ void main() { }); testWidgets('IconButton defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled IconButton await tester.pumpWidget( @@ -1192,7 +1192,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1251,7 +1251,7 @@ void main() { }); testWidgets('IconButton.fill defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled IconButton await tester.pumpWidget( @@ -1332,7 +1332,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1391,7 +1391,7 @@ void main() { }); testWidgets('Toggleable IconButton.fill defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled selected IconButton await tester.pumpWidget( @@ -1504,7 +1504,7 @@ void main() { }); testWidgets('IconButton.filledTonal defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled IconButton.tonal await tester.pumpWidget( @@ -1589,7 +1589,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1648,7 +1648,7 @@ void main() { }); testWidgets('Toggleable IconButton.filledTonal defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled selected IconButton await tester.pumpWidget( @@ -1765,7 +1765,7 @@ void main() { }); testWidgets('IconButton.outlined defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled IconButton.tonal await tester.pumpWidget( @@ -1849,7 +1849,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1908,7 +1908,7 @@ void main() { }); testWidgets('Toggleable IconButton.outlined defaults - M3', (WidgetTester tester) async { - final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme, useMaterial3: true); + final ThemeData themeM3 = ThemeData.from(colorScheme: colorScheme); // Enabled selected IconButton await tester.pumpWidget( @@ -2027,7 +2027,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: IconButton( @@ -2101,7 +2101,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return Scaffold( @@ -2168,7 +2168,7 @@ void main() { textDirection: TextDirection.ltr, child: Center( child: Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: IconButton( style: const ButtonStyle( // Specifying minimumSize to mimic the original minimumSize for @@ -2214,7 +2214,7 @@ void main() { ) async { Widget buildFrame(MaterialTapTargetSize tapTargetSize) { return Theme( - data: ThemeData(materialTapTargetSize: tapTargetSize, useMaterial3: true), + data: ThemeData(materialTapTargetSize: tapTargetSize), child: Directionality( textDirection: TextDirection.ltr, child: Center( @@ -2239,7 +2239,7 @@ void main() { // Use [IconButton]'s padding property to override default value. await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: IconButton( @@ -2260,7 +2260,7 @@ void main() { // Use [IconButton.style]'s padding property to override default value. await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: IconButton( @@ -2282,7 +2282,7 @@ void main() { // values are not null. await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: IconButton( @@ -2305,7 +2305,7 @@ void main() { testWidgets('Default IconButton is not selectable - M3', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: IconButton(icon: const Icon(Icons.ac_unit), onPressed: () {}), ), ); @@ -2341,7 +2341,7 @@ void main() { bool isSelected = false; await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return IconButton( @@ -2393,7 +2393,7 @@ void main() { bool isSelected = true; await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return IconButton( @@ -2438,7 +2438,7 @@ void main() { bool isSelected = false; await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return IconButton( @@ -2480,7 +2480,7 @@ void main() { bool isSelected = false; await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { return IconButton( @@ -2518,7 +2518,7 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: const IconButton( isSelected: true, icon: Icon(Icons.account_box), @@ -2544,7 +2544,7 @@ void main() { }) async { return tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: colorScheme, useMaterial3: true).copyWith( + theme: ThemeData.from(colorScheme: colorScheme).copyWith( iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(visualDensity: iconButtonThemeVisualDensity), ), @@ -2741,7 +2741,6 @@ void main() { MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.light(), - useMaterial3: true, ).copyWith(iconTheme: const IconThemeData(color: Colors.red, size: 37)), home: IconButton(icon: const Icon(Icons.account_box), onPressed: () {}), ), @@ -2754,7 +2753,7 @@ void main() { // custom IconTheme outside of IconButton await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: IconTheme.merge( data: const IconThemeData(color: Colors.pink, size: 35), child: IconButton(icon: const Icon(Icons.account_box), onPressed: () {}), @@ -2773,10 +2772,7 @@ void main() { // When IconButtonTheme and IconTheme both exist in ThemeData, the IconButtonTheme can override IconTheme. await tester.pumpWidget( MaterialApp( - theme: ThemeData.from( - colorScheme: const ColorScheme.light(), - useMaterial3: true, - ).copyWith( + theme: ThemeData.from(colorScheme: const ColorScheme.light()).copyWith( iconTheme: const IconThemeData(color: Colors.red, size: 25), iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: Colors.green, iconSize: 27), @@ -2797,7 +2793,7 @@ void main() { // When IconButtonTheme is closer to IconButton, IconButtonTheme overrides IconTheme await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: IconTheme.merge( data: const IconThemeData(color: Colors.orange, size: 36), child: IconButtonTheme( @@ -2817,7 +2813,7 @@ void main() { // When IconTheme is closer to IconButton, IconButtonTheme still overrides IconTheme await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: IconTheme.merge( data: const IconThemeData(color: Colors.blue, size: 35), child: IconButtonTheme( @@ -2842,7 +2838,6 @@ void main() { MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.dark(), - useMaterial3: true, ).copyWith(iconTheme: const IconThemeData(color: Colors.white)), home: IconButton(icon: const Icon(Icons.account_box), onPressed: () {}), ), @@ -2862,7 +2857,7 @@ void main() { // Brightness.dark await tester.pumpWidget( MaterialApp( - theme: ThemeData(colorScheme: darkScheme, useMaterial3: true), + theme: ThemeData(colorScheme: darkScheme), home: Scaffold( body: IconTheme.merge( data: const IconThemeData(size: 26), @@ -2887,7 +2882,7 @@ void main() { // Brightness.dark await tester.pumpWidget( MaterialApp( - theme: ThemeData(colorScheme: lightScheme, useMaterial3: true), + theme: ThemeData(colorScheme: lightScheme), home: Scaffold( body: IconTheme.merge( data: const IconThemeData(size: 26), @@ -2931,10 +2926,7 @@ void main() { // This is a regression test for https://github.com/flutter/flutter/issues/130708. Widget buildWidget(bool showIconButton) { return showIconButton - ? MaterialApp( - theme: ThemeData(useMaterial3: true), - home: IconButton(onPressed: () {}, icon: const Icon(Icons.search)), - ) + ? MaterialApp(home: IconButton(onPressed: () {}, icon: const Icon(Icons.search))) : const SizedBox(); } @@ -3423,7 +3415,7 @@ Widget buildAllVariants({ Widget wrap({required Widget child, required bool useMaterial3}) { return useMaterial3 ? MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: FocusTraversalGroup( policy: ReadingOrderTraversalPolicy(), child: Directionality(textDirection: TextDirection.ltr, child: Center(child: child)), diff --git a/packages/flutter/test/material/icon_button_theme_test.dart b/packages/flutter/test/material/icon_button_theme_test.dart index eae0d9d762..f8ae3676c3 100644 --- a/packages/flutter/test/material/icon_button_theme_test.dart +++ b/packages/flutter/test/material/icon_button_theme_test.dart @@ -24,7 +24,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: colorScheme, useMaterial3: true), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold( body: Center(child: IconButton(onPressed: () {}, icon: const Icon(Icons.ac_unit))), ), @@ -103,7 +103,6 @@ void main() { return MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.light(), - useMaterial3: true, ).copyWith(iconButtonTheme: IconButtonThemeData(style: overallStyle)), home: Scaffold( body: Center( @@ -228,10 +227,7 @@ void main() { Widget buildFrame({Color? overallShadowColor, Color? themeShadowColor, Color? shadowColor}) { return MaterialApp( - theme: ThemeData.from( - colorScheme: colorScheme, - useMaterial3: true, - ).copyWith(shadowColor: overallShadowColor), + theme: ThemeData.from(colorScheme: colorScheme).copyWith(shadowColor: overallShadowColor), home: Scaffold( body: Center( child: IconButtonTheme( diff --git a/packages/flutter/test/material/ink_sparkle_test.dart b/packages/flutter/test/material/ink_sparkle_test.dart index 50fdaf220f..5438e7a852 100644 --- a/packages/flutter/test/material/ink_sparkle_test.dart +++ b/packages/flutter/test/material/ink_sparkle_test.dart @@ -199,7 +199,6 @@ Future _runM3Test( await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Center( child: RepaintBoundary( diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index ddcf420e81..ec52249f1e 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -69,7 +69,6 @@ void main() { hasSubtitle = isTwoLine || isThreeLine; subtitleScaler ??= textScaler; return MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery( data: MediaQueryData( padding: const EdgeInsets.only(left: leftPadding, right: rightPadding), @@ -186,9 +185,8 @@ void main() { const double leftPadding = 10.0; const double rightPadding = 20.0; await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const MediaQuery( + const MaterialApp( + home: MediaQuery( data: MediaQueryData(padding: EdgeInsets.only(left: leftPadding, right: rightPadding)), child: Directionality( textDirection: TextDirection.rtl, @@ -385,7 +383,6 @@ void main() { Widget buildFrame(double leadingWidth, TextDirection textDirection) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Directionality( textDirection: textDirection, child: Material( @@ -453,7 +450,6 @@ void main() { // "ONE"-LINE await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -505,7 +501,6 @@ void main() { // "TWO"-LINE await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -559,7 +554,6 @@ void main() { // THREE-LINE await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -611,7 +605,6 @@ void main() { // "ONE-LINE" with Small Leading Widget await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -669,7 +662,6 @@ void main() { // One line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -693,7 +685,6 @@ void main() { // Two line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -717,7 +708,6 @@ void main() { // Three line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -758,7 +748,6 @@ void main() { // One line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -782,7 +771,6 @@ void main() { // Two line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -816,7 +804,6 @@ void main() { // Three line await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: ListView( children: const [ @@ -1393,7 +1380,7 @@ void main() { testWidgets('ListTile default tile color', (WidgetTester tester) async { bool isSelected = false; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color defaultColor = Colors.transparent; await tester.pumpWidget( @@ -1431,7 +1418,7 @@ void main() { ) async { // This is a regression test for https://github.com/flutter/flutter/issues/117700 bool isSelected = false; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color defaultColor = Colors.transparent; await tester.pumpWidget( @@ -1647,7 +1634,6 @@ void main() { double? widgetHorizontalTitleGap, }) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Directionality( textDirection: textDirection, child: Material( @@ -1705,7 +1691,6 @@ void main() { ) async { Widget buildFrame(TextDirection textDirection) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Directionality( textDirection: textDirection, child: Material( @@ -1737,7 +1722,6 @@ void main() { testWidgets('ListTile horizontalTitleGap with visualDensity', (WidgetTester tester) async { Widget buildFrame({double? horizontalTitleGap, VisualDensity? visualDensity}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -1787,7 +1771,6 @@ void main() { double? widgetMinVerticalPadding, }) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Directionality( textDirection: textDirection, child: Material( @@ -1975,7 +1958,7 @@ void main() { }); testWidgets('selected, enabled ListTile default icon color', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; final Key leadingKey = UniqueKey(); final Key titleKey = UniqueKey(); @@ -2017,7 +2000,6 @@ void main() { testWidgets('ListTile font size', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Builder( @@ -2050,7 +2032,6 @@ void main() { testWidgets('ListTile text color', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Builder( @@ -2068,7 +2049,7 @@ void main() { ); } - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); // ListTile default text colors. await tester.pumpWidget(buildFrame()); @@ -2174,7 +2155,6 @@ void main() { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Builder( @@ -2231,7 +2211,6 @@ void main() { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Builder( @@ -2287,7 +2266,6 @@ void main() { Widget buildFrame() { return MaterialApp( theme: ThemeData( - useMaterial3: true, iconButtonTheme: IconButtonThemeData( style: IconButton.styleFrom(foregroundColor: iconButtonThemeColor), ), @@ -2358,7 +2336,6 @@ void main() { Widget buildFrame({ListTileTitleAlignment? titleAlignment}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: ListTile( @@ -2460,7 +2437,6 @@ void main() { Widget buildFrame({ListTileTitleAlignment? titleAlignment}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: ListTile( @@ -2562,7 +2538,6 @@ void main() { Widget buildFrame({ListTileTitleAlignment? titleAlignment, bool isThreeLine = false}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: ListTile( diff --git a/packages/flutter/test/material/list_tile_theme_test.dart b/packages/flutter/test/material/list_tile_theme_test.dart index a725bb8e59..3c12053b7a 100644 --- a/packages/flutter/test/material/list_tile_theme_test.dart +++ b/packages/flutter/test/material/list_tile_theme_test.dart @@ -420,7 +420,6 @@ void main() { ); final ThemeData theme = ThemeData( - useMaterial3: true, listTileTheme: const ListTileThemeData( titleTextStyle: titleTextStyle, subtitleTextStyle: subtitleTextStyle, @@ -540,7 +539,6 @@ void main() { "Material3 - ListTile's titleTextStyle, subtitleTextStyle & leadingAndTrailingTextStyle are overridden by ListTile properties", (WidgetTester tester) async { final ThemeData theme = ThemeData( - useMaterial3: true, listTileTheme: const ListTileThemeData( titleTextStyle: TextStyle(fontSize: 20.0), subtitleTextStyle: TextStyle(fontSize: 17.5), @@ -993,7 +991,6 @@ void main() { Widget buildFrame({ListTileTitleAlignment? alignment}) { return MaterialApp( theme: ThemeData( - useMaterial3: true, listTileTheme: const ListTileThemeData(titleAlignment: ListTileTitleAlignment.center), ), home: Material( diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 9c9dfa3ebf..d40d94ce30 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -194,16 +194,12 @@ void main() { expect(getModel(tester).shadowColor, ThemeData().shadowColor); // Default M3 shadow color - await tester.pumpWidget( - Theme(data: ThemeData(useMaterial3: true), child: buildWithShadow(null)), - ); + await tester.pumpWidget(Theme(data: ThemeData(), child: buildWithShadow(null))); await tester.pumpAndSettle(); expect(getModel(tester).shadowColor, ThemeData().colorScheme.shadow); // Drop shadow can be turned off with a transparent color. - await tester.pumpWidget( - Theme(data: ThemeData(useMaterial3: true), child: buildWithShadow(Colors.transparent)), - ); + await tester.pumpWidget(Theme(data: ThemeData(), child: buildWithShadow(Colors.transparent))); await tester.pumpAndSettle(); expect(getModel(tester).shadowColor, Colors.transparent); }); @@ -317,7 +313,6 @@ void main() { await tester.pumpWidget( Theme( data: ThemeData( - useMaterial3: true, applyElevationOverlayColor: true, colorScheme: const ColorScheme.dark().copyWith(surface: surfaceColor), ), @@ -337,10 +332,7 @@ void main() { // With no surfaceTintColor specified, it should not apply an overlay await tester.pumpWidget( - Theme( - data: ThemeData(useMaterial3: true), - child: buildMaterial(color: baseColor, elevation: 12.0), - ), + Theme(data: ThemeData(), child: buildMaterial(color: baseColor, elevation: 12.0)), ); await tester.pumpAndSettle(); final RenderPhysicalShape noTintModel = getModel(tester); @@ -349,7 +341,7 @@ void main() { // With transparent surfaceTintColor, it should not apply an overlay await tester.pumpWidget( Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: buildMaterial( color: baseColor, surfaceTintColor: Colors.transparent, @@ -365,7 +357,7 @@ void main() { // on the elevation. await tester.pumpWidget( Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: buildMaterial( color: baseColor, surfaceTintColor: surfaceTintColor, @@ -941,7 +933,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: RepaintBoundary( key: painterKey, @@ -1014,7 +1005,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: RepaintBoundary( key: painterKey, diff --git a/packages/flutter/test/material/navigation_bar_test.dart b/packages/flutter/test/material/navigation_bar_test.dart index 9a41b54310..249a13d8ce 100644 --- a/packages/flutter/test/material/navigation_bar_test.dart +++ b/packages/flutter/test/material/navigation_bar_test.dart @@ -231,7 +231,7 @@ void main() { WidgetTester tester, ) async { // M3 settings from the token database. - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( _buildWidget( NavigationBar( @@ -329,7 +329,6 @@ void main() { DefaultWidgetsLocalizations.delegate, ], child: MaterialApp( - theme: ThemeData(useMaterial3: true), home: Navigator( onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( @@ -641,7 +640,6 @@ void main() { Widget buildWidget({NavigationDestinationLabelBehavior? labelBehavior}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( bottomNavigationBar: Center( child: NavigationBar( @@ -843,7 +841,6 @@ void main() { Widget buildWidget({NavigationDestinationLabelBehavior? labelBehavior}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( bottomNavigationBar: Center( child: NavigationBar( @@ -904,7 +901,6 @@ void main() { Widget buildNavigationBar() { return MaterialApp( - theme: ThemeData.light(), home: Scaffold( bottomNavigationBar: Center( child: NavigationBar( diff --git a/packages/flutter/test/material/navigation_bar_theme_test.dart b/packages/flutter/test/material/navigation_bar_theme_test.dart index fb6a86c9e7..e47a3ff752 100644 --- a/packages/flutter/test/material/navigation_bar_theme_test.dart +++ b/packages/flutter/test/material/navigation_bar_theme_test.dart @@ -214,7 +214,6 @@ void main() { TextStyle(fontSize: 25, color: Color(0xff0000ff)), ), ), - useMaterial3: true, ), home: Scaffold( bottomNavigationBar: Center( diff --git a/packages/flutter/test/material/navigation_drawer_test.dart b/packages/flutter/test/material/navigation_drawer_test.dart index 20f324a712..421df9b305 100644 --- a/packages/flutter/test/material/navigation_drawer_test.dart +++ b/packages/flutter/test/material/navigation_drawer_test.dart @@ -168,7 +168,7 @@ void main() { WidgetTester tester, ) async { final GlobalKey scaffoldKey = GlobalKey(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( _buildWidget( scaffoldKey, @@ -260,7 +260,6 @@ void main() { data: const MediaQueryData(padding: EdgeInsets.all(20.0)), child: MaterialApp( useInheritedMediaQuery: true, - theme: ThemeData.light(), home: Scaffold( key: scaffoldKey, drawer: NavigationDrawer( @@ -373,7 +372,7 @@ void main() { WidgetTester tester, ) async { final GlobalKey scaffoldKey = GlobalKey(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color color = Color(0xff0000ff); const ShapeBorder shape = RoundedRectangleBorder(); diff --git a/packages/flutter/test/material/navigation_rail_test.dart b/packages/flutter/test/material/navigation_rail_test.dart index 1e27fd6316..5e0e10631a 100644 --- a/packages/flutter/test/material/navigation_rail_test.dart +++ b/packages/flutter/test/material/navigation_rail_test.dart @@ -1820,7 +1820,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { stateSetter = setState; @@ -1966,7 +1965,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { stateSetter = setState; @@ -2110,7 +2108,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { stateSetter = setState; @@ -2168,7 +2165,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { stateSetter = setState; @@ -2211,7 +2207,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { stateSetter = setState; @@ -3704,7 +3699,7 @@ void main() { testWidgets('Navigation destination updates indicator color and shape', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const Color color = Color(0xff0000ff); const ShapeBorder shape = RoundedRectangleBorder(); diff --git a/packages/flutter/test/material/navigation_rail_theme_test.dart b/packages/flutter/test/material/navigation_rail_theme_test.dart index 8c828c8378..07236c9e63 100644 --- a/packages/flutter/test/material/navigation_rail_theme_test.dart +++ b/packages/flutter/test/material/navigation_rail_theme_test.dart @@ -18,7 +18,7 @@ void main() { testWidgets( 'Material3 - Default values are used when no NavigationRail or NavigationRailThemeData properties are specified', (WidgetTester tester) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); // Material 3 defaults await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index 2ec683286b..7d459de498 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -343,7 +343,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1683,7 +1683,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: OutlinedButton(key: key, onPressed: () {}, child: const Text('OutlinedButton')), @@ -1702,7 +1702,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: OutlinedButton.icon( @@ -1798,7 +1798,7 @@ void main() { testWidgets( 'OutlinedButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/outlined_button_theme_test.dart b/packages/flutter/test/material/outlined_button_theme_test.dart index 45242e6e39..9875cdf5ea 100644 --- a/packages/flutter/test/material/outlined_button_theme_test.dart +++ b/packages/flutter/test/material/outlined_button_theme_test.dart @@ -25,7 +25,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold( body: Center(child: OutlinedButton(onPressed: () {}, child: const Text('button'))), ), @@ -280,10 +280,7 @@ void main() { Widget buildFrame({Color? overallShadowColor, Color? themeShadowColor, Color? shadowColor}) { return MaterialApp( - theme: ThemeData.from( - useMaterial3: true, - colorScheme: colorScheme.copyWith(shadow: overallShadowColor), - ), + theme: ThemeData.from(colorScheme: colorScheme.copyWith(shadow: overallShadowColor)), home: Scaffold( body: Center( child: OutlinedButtonTheme( diff --git a/packages/flutter/test/material/page_test.dart b/packages/flutter/test/material/page_test.dart index 2c97371374..65f8f15a44 100644 --- a/packages/flutter/test/material/page_test.dart +++ b/packages/flutter/test/material/page_test.dart @@ -312,7 +312,6 @@ void main() { key: key, child: MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - theme: ThemeData(useMaterial3: true), onGenerateRoute: (RouteSettings settings) { return MaterialPageRoute( builder: (BuildContext context) { diff --git a/packages/flutter/test/material/page_transitions_theme_test.dart b/packages/flutter/test/material/page_transitions_theme_test.dart index 6af8ed3d57..c733d81722 100644 --- a/packages/flutter/test/material/page_transitions_theme_test.dart +++ b/packages/flutter/test/material/page_transitions_theme_test.dart @@ -727,7 +727,6 @@ void main() { }) { return MaterialApp( theme: ThemeData( - useMaterial3: true, pageTransitionsTheme: PageTransitionsTheme( builders: { TargetPlatform.android: ZoomPageTransitionsBuilder( diff --git a/packages/flutter/test/material/paginated_data_table_test.dart b/packages/flutter/test/material/paginated_data_table_test.dart index 1db43a6df4..11aa16d885 100644 --- a/packages/flutter/test/material/paginated_data_table_test.dart +++ b/packages/flutter/test/material/paginated_data_table_test.dart @@ -1112,7 +1112,7 @@ void main() { addTearDown(source.dispose); return MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( dataTableTheme: const DataTableThemeData(decoration: BoxDecoration(color: Colors.white)), ), home: PaginatedDataTable( diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index e400736e51..e4793ca4b2 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -1719,7 +1719,7 @@ void main() { final Key popupMenuButtonKey = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), + theme: ThemeData(), home: Scaffold( body: Center( child: PopupMenuButton( @@ -3406,7 +3406,7 @@ void main() { ); await tester.pumpWidget( MaterialApp( - theme: ThemeData(scrollbarTheme: scrollbarTheme, useMaterial3: true), + theme: ThemeData(scrollbarTheme: scrollbarTheme), home: Material( child: Column( children: [ @@ -3438,7 +3438,7 @@ void main() { // Test local ScrollbarTheme overrides global ScrollbarTheme. await tester.pumpWidget( MaterialApp( - theme: ThemeData(scrollbarTheme: scrollbarTheme, useMaterial3: true), + theme: ThemeData(scrollbarTheme: scrollbarTheme), home: Material( child: Column( children: [ @@ -3584,7 +3584,7 @@ void main() { WidgetTester tester, ) async { final Key popupMenuButtonKey = UniqueKey(); - ThemeData theme = ThemeData(useMaterial3: true); + ThemeData theme = ThemeData(); Widget buildMenu() { return MaterialApp( @@ -3780,7 +3780,7 @@ void main() { WidgetTester tester, ) async { final Key popupMenuButtonKey = UniqueKey(); - ThemeData theme = ThemeData(useMaterial3: true); + ThemeData theme = ThemeData(); Widget buildMenu() { return MaterialApp( diff --git a/packages/flutter/test/material/popup_menu_theme_test.dart b/packages/flutter/test/material/popup_menu_theme_test.dart index fb816f5f57..e1d6c8794e 100644 --- a/packages/flutter/test/material/popup_menu_theme_test.dart +++ b/packages/flutter/test/material/popup_menu_theme_test.dart @@ -137,7 +137,7 @@ void main() { final Key popupButtonApp = UniqueKey(); final Key enabledPopupItemKey = UniqueKey(); final Key disabledPopupItemKey = UniqueKey(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -259,7 +259,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, popupMenuTheme: popupMenuTheme), + theme: ThemeData(popupMenuTheme: popupMenuTheme), key: popupButtonApp, home: Material( child: Column( @@ -386,7 +386,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, popupMenuTheme: popupMenuTheme), + theme: ThemeData(popupMenuTheme: popupMenuTheme), key: popupButtonApp, home: Material( child: Column( @@ -690,7 +690,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true, popupMenuTheme: popupMenuTheme), + theme: ThemeData(popupMenuTheme: popupMenuTheme), key: popupButtonApp, home: Material( child: Column( diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index 3d5cfd31f7..57e41efe86 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -761,7 +761,7 @@ void main() { await tester.pumpFrames( animationSheet.record( - Theme(data: ThemeData(useMaterial3: true), child: const _RefreshProgressIndicatorGolden()), + Theme(data: ThemeData(), child: const _RefreshProgressIndicatorGolden()), ), const Duration(seconds: 3), ); @@ -1063,7 +1063,7 @@ void main() { await tester.pumpFrames( animationSheet.record( Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: const Directionality( textDirection: TextDirection.ltr, child: Padding(padding: EdgeInsets.all(4), child: CircularProgressIndicator()), diff --git a/packages/flutter/test/material/radio_list_tile_test.dart b/packages/flutter/test/material/radio_list_tile_test.dart index a5138f336e..0c6047bdfd 100644 --- a/packages/flutter/test/material/radio_list_tile_test.dart +++ b/packages/flutter/test/material/radio_list_tile_test.dart @@ -725,7 +725,7 @@ void main() { Widget buildFrame({Color? activeColor, Color? fillColor}) { return MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( radioTheme: RadioThemeData( fillColor: MaterialStateProperty.resolveWith((Set states) { return states.contains(MaterialState.selected) ? fillColor : null; @@ -1046,7 +1046,7 @@ void main() { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; final Color? hoverColor = Colors.orange[500]; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp({bool enabled = true}) { return wrap( child: MaterialApp( @@ -1140,7 +1140,6 @@ void main() { Widget buildRadio({bool active = false, bool useOverlay = true}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: RadioListTile( value: active, diff --git a/packages/flutter/test/material/radio_test.dart b/packages/flutter/test/material/radio_test.dart index d0ac4e2933..283be4b551 100644 --- a/packages/flutter/test/material/radio_test.dart +++ b/packages/flutter/test/material/radio_test.dart @@ -458,7 +458,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: RepaintBoundary( key: painterKey, @@ -622,7 +621,7 @@ void main() { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; const Key radioKey = Key('radio'); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp({bool enabled = true}) { return MaterialApp( theme: theme, @@ -802,7 +801,7 @@ void main() { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; int? groupValue = 0; const Key radioKey = Key('radio'); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp({bool enabled = true}) { return MaterialApp( theme: theme, @@ -1335,7 +1334,7 @@ void main() { int? groupValue = 0; const Key radioKey = Key('radio'); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildApp() { return MaterialApp( theme: theme, @@ -1658,7 +1657,7 @@ void main() { }); testWidgets('Material3 - Radio button default colors', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildRadio({bool enabled = true, bool selected = true}) { return MaterialApp( theme: theme, @@ -1815,7 +1814,7 @@ void main() { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; Widget buildRadio({bool enabled = true, bool focused = false, bool selected = true}) { return MaterialApp( @@ -2023,7 +2022,7 @@ void main() { ) async { final FocusNode focusNode = FocusNode(debugLabel: 'Radio'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); Finder findRadio() { return find.byWidgetPredicate((Widget widget) => widget is Radio); diff --git a/packages/flutter/test/material/range_slider_test.dart b/packages/flutter/test/material/range_slider_test.dart index 434ce29ca1..1b88c55f12 100644 --- a/packages/flutter/test/material/range_slider_test.dart +++ b/packages/flutter/test/material/range_slider_test.dart @@ -1901,7 +1901,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light(), + data: ThemeData(), child: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -1959,7 +1959,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light(), + data: ThemeData(), child: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -2043,7 +2043,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light(), + data: ThemeData(), child: Directionality( textDirection: TextDirection.rtl, child: Material( diff --git a/packages/flutter/test/material/refresh_indicator_test.dart b/packages/flutter/test/material/refresh_indicator_test.dart index 832b15e70f..a22968e59f 100644 --- a/packages/flutter/test/material/refresh_indicator_test.dart +++ b/packages/flutter/test/material/refresh_indicator_test.dart @@ -1039,7 +1039,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith(useMaterial3: true), home: RefreshIndicator( onRefresh: refresh, child: Builder( diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 8259f95d18..387e6ddbb8 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -2695,7 +2695,7 @@ void main() { builder: (BuildContext context, StateSetter stateSetter) { setState = stateSetter; return MaterialApp( - theme: themeIsLight ? ThemeData.light() : ThemeData.dark(), + theme: themeIsLight ? ThemeData() : ThemeData.dark(), home: Scaffold( bottomSheet: defaultBottomSheet == null diff --git a/packages/flutter/test/material/search_anchor_test.dart b/packages/flutter/test/material/search_anchor_test.dart index 2ee65186f2..e20f8e9186 100644 --- a/packages/flutter/test/material/search_anchor_test.dart +++ b/packages/flutter/test/material/search_anchor_test.dart @@ -51,7 +51,7 @@ void main() { } testWidgets('SearchBar defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; await tester.pumpWidget( @@ -1013,9 +1013,8 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Center( + const MaterialApp( + home: Center( child: Material(child: SearchBar(constraints: BoxConstraints.tightFor(height: 35.0))), ), ), @@ -1030,7 +1029,7 @@ void main() { }); testWidgets('The search view defaults', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; await tester.pumpWidget( MaterialApp( @@ -2796,10 +2795,7 @@ void main() { disabledBorder: UnderlineInputBorder(), constraints: BoxConstraints(maxWidth: 300), ); - final ThemeData theme = ThemeData( - useMaterial3: true, - inputDecorationTheme: inputDecorationTheme, - ); + final ThemeData theme = ThemeData(inputDecorationTheme: inputDecorationTheme); void checkDecorationInSearchBar(WidgetTester tester) { final Finder textField = findTextField(); diff --git a/packages/flutter/test/material/search_bar_theme_test.dart b/packages/flutter/test/material/search_bar_theme_test.dart index d98136e26b..f1ee05d469 100644 --- a/packages/flutter/test/material/search_bar_theme_test.dart +++ b/packages/flutter/test/material/search_bar_theme_test.dart @@ -211,7 +211,6 @@ void main() { return MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.light(), - useMaterial3: true, ).copyWith(searchBarTheme: overallTheme), home: Scaffold( body: Center( diff --git a/packages/flutter/test/material/search_view_theme_test.dart b/packages/flutter/test/material/search_view_theme_test.dart index 336f2868f4..7343c5b4ce 100644 --- a/packages/flutter/test/material/search_view_theme_test.dart +++ b/packages/flutter/test/material/search_view_theme_test.dart @@ -176,7 +176,6 @@ void main() { return MaterialApp( theme: ThemeData.from( colorScheme: const ColorScheme.light(), - useMaterial3: true, ).copyWith(searchViewTheme: overallTheme), home: Scaffold( body: Center( diff --git a/packages/flutter/test/material/segmented_button_test.dart b/packages/flutter/test/material/segmented_button_test.dart index 4e84d30c52..229ecb04b8 100644 --- a/packages/flutter/test/material/segmented_button_test.dart +++ b/packages/flutter/test/material/segmented_button_test.dart @@ -62,7 +62,7 @@ void main() { testWidgets('SegmentedButton releases state controllers for deleted segments', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final Key key = UniqueKey(); Widget buildApp(Widget button) { @@ -104,7 +104,7 @@ void main() { testWidgets('SegmentedButton is built with Material of type MaterialType.transparency', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -558,7 +558,7 @@ void main() { testWidgets('SegmentedButton default overlayColor and foregroundColor resolve pressed state', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -607,7 +607,7 @@ void main() { }); testWidgets('SegmentedButton has no tooltips by default', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -631,7 +631,7 @@ void main() { }); testWidgets('SegmentedButton has correct tooltips', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, diff --git a/packages/flutter/test/material/segmented_button_theme_test.dart b/packages/flutter/test/material/segmented_button_theme_test.dart index e065b9f0b8..ed85a29b22 100644 --- a/packages/flutter/test/material/segmented_button_theme_test.dart +++ b/packages/flutter/test/material/segmented_button_theme_test.dart @@ -53,7 +53,7 @@ void main() { }); testWidgets('With no other configuration, defaults are used', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -121,7 +121,6 @@ void main() { testWidgets('ThemeData.segmentedButtonTheme overrides defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData( - useMaterial3: true, segmentedButtonTheme: SegmentedButtonThemeData( style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith((Set states) { @@ -261,7 +260,7 @@ void main() { ), selectedIcon: const Icon(Icons.plus_one), ); - final ThemeData theme = ThemeData(useMaterial3: true, segmentedButtonTheme: global); + final ThemeData theme = ThemeData(segmentedButtonTheme: global); await tester.pumpWidget( MaterialApp( theme: theme, @@ -396,7 +395,7 @@ void main() { ), selectedIcon: const Icon(Icons.plus_one), ); - final ThemeData theme = ThemeData(useMaterial3: true, segmentedButtonTheme: global); + final ThemeData theme = ThemeData(segmentedButtonTheme: global); await tester.pumpWidget( MaterialApp( theme: theme, diff --git a/packages/flutter/test/material/slider_test.dart b/packages/flutter/test/material/slider_test.dart index d664a0c30c..52381822d3 100644 --- a/packages/flutter/test/material/slider_test.dart +++ b/packages/flutter/test/material/slider_test.dart @@ -1470,7 +1470,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light(), + data: ThemeData(), child: Directionality( textDirection: TextDirection.ltr, child: Material(child: Slider(value: 100.0, max: 200.0, onChanged: (double v) {})), @@ -2006,7 +2006,7 @@ void main() { testWidgets('Slider can be hovered and has correct hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); double value = 0.5; Widget buildApp({bool enabled = true}) { return MaterialApp( @@ -3395,8 +3395,8 @@ void main() { Widget buildFrame(ThemeMode themeMode) { return MaterialApp( themeMode: themeMode, - theme: ThemeData(brightness: Brightness.light, useMaterial3: true), - darkTheme: ThemeData(brightness: Brightness.dark, useMaterial3: true), + theme: ThemeData(brightness: Brightness.light), + darkTheme: ThemeData(brightness: Brightness.dark), home: Directionality( textDirection: TextDirection.ltr, child: Material( @@ -3956,7 +3956,7 @@ void main() { testWidgets( 'Value indicator disappears after adjusting the slider on desktop', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const double currentValue = 0.5; await tester.pumpWidget( MaterialApp( diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index c0fce54606..71c24828a5 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -116,7 +116,7 @@ void main() { testWidgets('Slider defaults', (WidgetTester tester) async { debugDisableShadows = false; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colorScheme = theme.colorScheme; const double trackHeight = 4.0; final Color activeTrackColor = Color(colorScheme.primary.value); @@ -2236,7 +2236,7 @@ void main() { testWidgets('Default value indicator color', (WidgetTester tester) async { debugDisableShadows = false; try { - final ThemeData theme = ThemeData(useMaterial3: true, platform: TargetPlatform.android); + final ThemeData theme = ThemeData(platform: TargetPlatform.android); Widget buildApp( String value, { double sliderValue = 0.5, diff --git a/packages/flutter/test/material/snack_bar_test.dart b/packages/flutter/test/material/snack_bar_test.dart index be8c5f1433..b3837aa031 100644 --- a/packages/flutter/test/material/snack_bar_test.dart +++ b/packages/flutter/test/material/snack_bar_test.dart @@ -470,7 +470,7 @@ void main() { }); testWidgets('Material3 - Light theme SnackBar has dark background', (WidgetTester tester) async { - final ThemeData lightTheme = ThemeData.light(useMaterial3: true); + final ThemeData lightTheme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: lightTheme, @@ -586,7 +586,7 @@ void main() { testWidgets('Material3 - Dark theme SnackBar has primary text buttons', ( WidgetTester tester, ) async { - final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); + final ThemeData darkTheme = ThemeData.dark(); await tester.pumpWidget( MaterialApp( theme: darkTheme, @@ -975,7 +975,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Builder( builder: (BuildContext context) { @@ -1027,7 +1026,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Builder( builder: (BuildContext context) { @@ -1128,7 +1126,6 @@ void main() { testWidgets('Material3 - SnackBar button text alignment', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery( data: const MediaQueryData( padding: EdgeInsets.only(left: 10.0, top: 20.0, right: 30.0, bottom: 40.0), @@ -1245,7 +1242,6 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: MediaQuery( data: const MediaQueryData( padding: EdgeInsets.only(left: 10.0, top: 20.0, right: 30.0, bottom: 40.0), @@ -1416,7 +1412,6 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - useMaterial3: true, snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating), ), home: MediaQuery( @@ -1539,7 +1534,6 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - useMaterial3: true, snackBarTheme: const SnackBarThemeData(behavior: SnackBarBehavior.floating), ), home: MediaQuery( @@ -2469,9 +2463,8 @@ void main() { (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(persistentFooterButtons: [SizedBox(height: 1000)]), + const MaterialApp( + home: Scaffold(persistentFooterButtons: [SizedBox(height: 1000)]), ), ); @@ -2512,10 +2505,7 @@ void main() { (WidgetTester tester) async { // Regression test for https://github.com/flutter/flutter/issues/84263 await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), - home: const Scaffold(bottomNavigationBar: SizedBox(height: 1000)), - ), + const MaterialApp(home: Scaffold(bottomNavigationBar: SizedBox(height: 1000))), ); final FlutterExceptionHandler? handler = FlutterError.onError; @@ -2882,10 +2872,9 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), @@ -3014,7 +3003,6 @@ void main() { (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 home: Scaffold( body: const Scaffold(), @@ -3256,7 +3244,6 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/98205 await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 home: Scaffold( body: const Scaffold(), @@ -3390,10 +3377,9 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), @@ -3455,10 +3441,9 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), @@ -3519,10 +3504,9 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), @@ -3585,10 +3569,9 @@ void main() { WidgetTester tester, ) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), @@ -3657,10 +3640,9 @@ void main() { 'Material3 - Floating multi-line snackbar with icon and actionOverflowThreshold=1 is aligned correctly', (WidgetTester tester) async { await tester.pumpWidget( - MaterialApp( - theme: ThemeData(useMaterial3: true), + const MaterialApp( debugShowCheckedModeBanner: false, // https://github.com/flutter/flutter/issues/143616 - home: const Scaffold( + home: Scaffold( bottomSheet: SizedBox(width: 200, height: 50, child: ColoredBox(color: Colors.pink)), ), ), diff --git a/packages/flutter/test/material/snack_bar_theme_test.dart b/packages/flutter/test/material/snack_bar_theme_test.dart index 4e654dcffb..573f089ed1 100644 --- a/packages/flutter/test/material/snack_bar_theme_test.dart +++ b/packages/flutter/test/material/snack_bar_theme_test.dart @@ -139,7 +139,7 @@ void main() { WidgetTester tester, ) async { const String text = 'I am a snack bar.'; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: theme, diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index c9e6c00864..bd7a60f24e 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -10,7 +10,6 @@ void main() { testWidgets('Material3 has sentence case labels', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Stepper( onStepTapped: (int i) {}, @@ -186,7 +185,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Stepper( type: StepperType.horizontal, @@ -778,7 +776,7 @@ void main() { borderRadius: BorderRadius.all(Radius.circular(2)), ); - final ThemeData themeLight = ThemeData(useMaterial3: true); + final ThemeData themeLight = ThemeData(); await tester.pumpWidget(buildFrame(themeLight)); const String continueStr = 'Continue'; @@ -801,7 +799,7 @@ void main() { rectMoreOrLessEquals(cancelButtonRect, epsilon: 0.001), ); - final ThemeData themeDark = ThemeData.dark(useMaterial3: true); + final ThemeData themeDark = ThemeData.dark(); await tester.pumpWidget(buildFrame(themeDark)); await tester.pumpAndSettle(); // Complete the theme animation. @@ -895,7 +893,7 @@ void main() { ); } - final ThemeData themeLight = ThemeData(useMaterial3: true); + final ThemeData themeLight = ThemeData(); final ColorScheme colorsLight = themeLight.colorScheme; await tester.pumpWidget(buildFrame(themeLight)); @@ -913,7 +911,7 @@ void main() { colorsLight.onSurface.withOpacity(0.38).value, ); - final ThemeData themeDark = ThemeData.dark(useMaterial3: true); + final ThemeData themeDark = ThemeData.dark(); final ColorScheme colorsDark = themeDark.colorScheme; await tester.pumpWidget(buildFrame(themeDark)); await tester.pumpAndSettle(); // Complete the theme animation. @@ -985,7 +983,7 @@ void main() { // Regression test for https://github.com/flutter/flutter/pull/77732 Widget buildFrame({bool isActive = true, Brightness? brightness}) { return MaterialApp( - theme: brightness == Brightness.dark ? ThemeData.dark() : ThemeData.light(), + theme: brightness == Brightness.dark ? ThemeData.dark() : ThemeData(), home: Scaffold( body: Center( child: Stepper( @@ -1005,7 +1003,7 @@ void main() { } // Light theme - final ColorScheme light = ThemeData.light().colorScheme; + final ColorScheme light = ThemeData().colorScheme; await tester.pumpWidget(buildFrame(brightness: Brightness.light)); expect(circleFillColor(), light.primary); await tester.pumpWidget(buildFrame(isActive: false, brightness: Brightness.light)); diff --git a/packages/flutter/test/material/switch_list_tile_test.dart b/packages/flutter/test/material/switch_list_tile_test.dart index b0e7104e69..d6b92d19d6 100644 --- a/packages/flutter/test/material/switch_list_tile_test.dart +++ b/packages/flutter/test/material/switch_list_tile_test.dart @@ -196,7 +196,7 @@ void main() { MediaQuery( data: const MediaQueryData(padding: EdgeInsets.all(8.0)), child: Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: Directionality( textDirection: TextDirection.ltr, child: StatefulBuilder( @@ -507,7 +507,7 @@ void main() { Widget buildFrame({Color? activeColor, Color? thumbColor}) { return MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith((Set states) { return states.contains(MaterialState.selected) ? thumbColor : null; @@ -844,7 +844,6 @@ void main() { Widget buildSwitchListTile({required bool enabled, required bool selected}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { @@ -990,7 +989,6 @@ void main() { Widget buildSwitchListTile() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { @@ -1156,7 +1154,6 @@ void main() { Icon? inactiveIcon, }) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: wrap( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { @@ -1280,7 +1277,6 @@ void main() { ) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { @@ -1353,7 +1349,7 @@ void main() { ) async { Widget buildSwitchListTile(bool applyCupertinoTheme, TargetPlatform platform) { return MaterialApp( - theme: ThemeData(useMaterial3: true, platform: platform), + theme: ThemeData(platform: platform), home: Material( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { @@ -1426,7 +1422,6 @@ void main() { ) async { Widget buildSwitchListTile(MaterialTapTargetSize materialTapTargetSize) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { diff --git a/packages/flutter/test/material/switch_test.dart b/packages/flutter/test/material/switch_test.dart index 8fa0f07ee0..8b6af7cf73 100644 --- a/packages/flutter/test/material/switch_test.dart +++ b/packages/flutter/test/material/switch_test.dart @@ -164,7 +164,6 @@ void main() { Widget buildSwitch({required double width, required double height}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Directionality( textDirection: TextDirection.ltr, @@ -448,7 +447,7 @@ void main() { }); testWidgets('Material3 - Switch has default colors when enabled', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; bool value = false; await tester.pumpWidget( @@ -515,7 +514,7 @@ void main() { testWidgets('Switch.adaptive(Cupertino) has default colors when enabled', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; bool value = false; await tester.pumpWidget( @@ -634,7 +633,7 @@ void main() { testWidgets('Material3 - Inactive Switch has default colors when disabled', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; await tester.pumpWidget( @@ -671,7 +670,7 @@ void main() { testWidgets('Material3 - Active Switch has default colors when disabled', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; await tester.pumpWidget( MaterialApp( @@ -740,7 +739,7 @@ void main() { testWidgets('Material3 - Switch default overlayColor resolves hovered/focused state', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -848,7 +847,7 @@ void main() { }); testWidgets('Material3 - Switch can be set color', (WidgetTester tester) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; bool value = false; @@ -1751,7 +1750,7 @@ void main() { testWidgets('Material3 - Switch is focusable and has correct focus color', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -1963,7 +1962,7 @@ void main() { testWidgets('Material3 - Switch can be hovered and has correct hover color', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; bool value = true; @@ -2373,7 +2372,7 @@ void main() { testWidgets('Material3 - Switch thumb color resolves in active/enabled states', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; const Color activeEnabledThumbColor = Color(0xFF000001); const Color activeDisabledThumbColor = Color(0xFF000002); @@ -2564,7 +2563,7 @@ void main() { testWidgets('Material3 - Switch thumb color resolves in hovered/focused states', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; @@ -2731,7 +2730,7 @@ void main() { testWidgets('Material3 - Track color resolves in active/enabled states', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); const Color activeEnabledTrackColor = Color(0xFF000001); const Color activeDisabledTrackColor = Color(0xFF000002); const Color inactiveEnabledTrackColor = Color(0xFF000003); @@ -2892,7 +2891,7 @@ void main() { testWidgets('Material3 - Switch track color resolves in hovered/focused states', ( WidgetTester tester, ) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final FocusNode focusNode = FocusNode(debugLabel: 'Switch'); tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; const Color hoveredTrackColor = Color(0xFF000001); @@ -3021,7 +3020,7 @@ void main() { WidgetTester tester, ) async { final Color activeDisabledThumbColor = Colors.blue.withOpacity(.60); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final ColorScheme colors = theme.colorScheme; Color getThumbColor(Set states) { @@ -3399,7 +3398,7 @@ void main() { group('Switch M3 only tests', () { testWidgets('M3 Switch has a 300-millisecond animation in total', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); bool value = false; await tester.pumpWidget( MaterialApp( @@ -3441,7 +3440,7 @@ void main() { testWidgets('M3 Switch has a stadium shape in the middle of the track', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true, colorSchemeSeed: Colors.deepPurple); + final ThemeData theme = ThemeData(colorSchemeSeed: Colors.deepPurple); bool value = false; await tester.pumpWidget( MaterialApp( @@ -3483,7 +3482,7 @@ void main() { }); testWidgets('M3 Switch thumb bounces in the end of the animation', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); bool value = false; await tester.pumpWidget( MaterialApp( @@ -3532,7 +3531,7 @@ void main() { }); testWidgets('Switch thumb shows correct pressed color - M3', (WidgetTester tester) async { - final ThemeData themeData = ThemeData(useMaterial3: true); + final ThemeData themeData = ThemeData(); final ColorScheme colors = themeData.colorScheme; Widget buildApp({bool enabled = true, bool value = true}) { return MaterialApp( @@ -3817,7 +3816,6 @@ void main() { Widget buildSwitch({required bool enabled, required bool active}) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Switch( @@ -3898,7 +3896,6 @@ void main() { Widget buildSwitch() { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Switch( @@ -3944,7 +3941,6 @@ void main() { testWidgets('Switch can set icon - M3', (WidgetTester tester) async { final ThemeData themeData = ThemeData( - useMaterial3: true, colorSchemeSeed: const Color(0xff6750a4), brightness: Brightness.light, ); diff --git a/packages/flutter/test/material/switch_theme_test.dart b/packages/flutter/test/material/switch_theme_test.dart index 2ea6a2070f..13fdc22028 100644 --- a/packages/flutter/test/material/switch_theme_test.dart +++ b/packages/flutter/test/material/switch_theme_test.dart @@ -239,7 +239,6 @@ void main() { const Icon icon2 = Icon(Icons.close); final ThemeData themeData = ThemeData( - useMaterial3: true, switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { @@ -553,7 +552,6 @@ void main() { const double splashRadius = 2.0; final ThemeData themeData = ThemeData( - useMaterial3: true, switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { @@ -784,7 +782,6 @@ void main() { const Color selectedTrackColor = Color(0xffffff3f); final ThemeData themeData = ThemeData( - useMaterial3: true, switchTheme: SwitchThemeData( thumbColor: MaterialStateProperty.resolveWith((Set states) { if (states.contains(MaterialState.selected)) { @@ -916,7 +913,6 @@ void main() { const double splashRadius = 24.0; final ThemeData themeData = ThemeData( - useMaterial3: true, switchTheme: SwitchThemeData( overlayColor: MaterialStateProperty.resolveWith(getOverlayColor), splashRadius: splashRadius, @@ -1021,7 +1017,6 @@ void main() { const double localThemeOutlineWidth = 4.0; final ThemeData themeData = ThemeData( - useMaterial3: true, switchTheme: const SwitchThemeData( thumbColor: MaterialStatePropertyAll(globalThemeThumbColor), trackColor: MaterialStatePropertyAll(globalThemeTrackColor), diff --git a/packages/flutter/test/material/tab_bar_theme_test.dart b/packages/flutter/test/material/tab_bar_theme_test.dart index 3b9bc6d8f3..f043ab4113 100644 --- a/packages/flutter/test/material/tab_bar_theme_test.dart +++ b/packages/flutter/test/material/tab_bar_theme_test.dart @@ -195,7 +195,7 @@ void main() { // Test default label color and label styles. await tester.pumpWidget(buildTabBar(useMaterial3: true)); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final RenderParagraph selectedLabel = _getText(tester, _tab1Text); expect(selectedLabel.text.style!.fontFamily, equals(theme.textTheme.titleSmall!.fontFamily)); expect(selectedLabel.text.style!.fontSize, equals(14.0)); @@ -250,7 +250,7 @@ void main() { // Test default label color and label styles. await tester.pumpWidget(buildTabBar(secondaryTabBar: true, useMaterial3: true)); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final RenderParagraph selectedLabel = _getText(tester, _tab1Text); expect(selectedLabel.text.style!.fontFamily, equals(theme.textTheme.titleSmall!.fontFamily)); expect(selectedLabel.text.style!.fontSize, equals(14.0)); @@ -508,7 +508,7 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(tabBarTheme: tabBarTheme, useMaterial3: true), + theme: ThemeData(tabBarTheme: tabBarTheme), home: Scaffold( body: RepaintBoundary( key: _painterKey, @@ -703,7 +703,6 @@ void main() { ) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarThemeData(indicatorSize: TabBarIndicatorSize.tab), - useMaterial3: true, ); final List tabs = List.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -752,7 +751,6 @@ void main() { ) async { final ThemeData theme = ThemeData( tabBarTheme: const TabBarThemeData(indicatorSize: TabBarIndicatorSize.label), - useMaterial3: true, ); final List tabs = List.generate(4, (int index) { return Tab(text: 'Tab $index'); @@ -810,7 +808,6 @@ void main() { dividerColor: dividerColor, dividerHeight: dividerHeight, ), - useMaterial3: true, ), home: Scaffold( appBar: AppBar( @@ -840,7 +837,6 @@ void main() { await tester.pumpWidget( MaterialApp( theme: ThemeData( - useMaterial3: true, tabBarTheme: const TabBarThemeData(dividerColor: Colors.pink, dividerHeight: 5.0), ), home: Scaffold( @@ -868,10 +864,7 @@ void main() { // Test non-scrollable tab bar. await tester.pumpWidget( MaterialApp( - theme: ThemeData( - tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.center), - useMaterial3: true, - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.center)), home: Scaffold( appBar: AppBar( bottom: TabBar( @@ -898,10 +891,7 @@ void main() { // Test scrollable tab bar. await tester.pumpWidget( MaterialApp( - theme: ThemeData( - tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.start), - useMaterial3: true, - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.start)), home: Scaffold( appBar: AppBar( bottom: TabBar( @@ -934,10 +924,7 @@ void main() { /// Test non-scrollable tab bar. await tester.pumpWidget( MaterialApp( - theme: ThemeData( - tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.fill), - useMaterial3: true, - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.fill)), home: Scaffold( appBar: AppBar( bottom: TabBar( @@ -965,10 +952,7 @@ void main() { /// Test scrollable tab bar. await tester.pumpWidget( MaterialApp( - theme: ThemeData( - tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.center), - useMaterial3: true, - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(tabAlignment: TabAlignment.center)), home: Scaffold( appBar: AppBar( bottom: TabBar( @@ -1444,15 +1428,14 @@ void main() { ); } - await tester.pumpWidget(buildTabBar(theme: ThemeData(useMaterial3: true))); + await tester.pumpWidget(buildTabBar(theme: ThemeData())); RenderBox tabBarBox = tester.firstRenderObject(find.byType(TabBar)); - expect(tabBarBox, paints..rrect(color: ThemeData(useMaterial3: true).colorScheme.primary)); + expect(tabBarBox, paints..rrect(color: ThemeData().colorScheme.primary)); await tester.pumpWidget( buildTabBar( theme: ThemeData( - useMaterial3: true, tabBarTheme: const TabBarThemeData(indicatorColor: tabBarThemeIndicatorColor), ), ), diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 887e9d65db..0e71d0a9ca 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -334,7 +334,7 @@ void main() { testWidgets('TabBar default selected/unselected label style (primary)', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B', 'C']; const String selectedValue = 'A'; @@ -362,7 +362,7 @@ void main() { testWidgets('TabBar default selected/unselected label style (secondary)', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B', 'C']; const String selectedValue = 'A'; @@ -508,7 +508,7 @@ void main() { }); testWidgets('TabBar default overlay (primary)', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B']; const String selectedValue = 'A'; @@ -557,7 +557,7 @@ void main() { }); testWidgets('TabBar default overlay (secondary)', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B']; const String selectedValue = 'A'; @@ -6189,7 +6189,7 @@ void main() { // TabBarTheme splashFactory and overlayColor await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith( + theme: ThemeData( tabBarTheme: TabBarThemeData(splashFactory: splashFactory, overlayColor: overlayColor), ), home: DefaultTabController( @@ -6458,7 +6458,7 @@ void main() { testWidgets('Tab has correct selected/unselected hover color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B', 'C']; await tester.pumpWidget(buildFrame(tabs: tabs, value: 'C', useMaterial3: theme.useMaterial3)); @@ -6485,7 +6485,7 @@ void main() { testWidgets('Tab has correct selected/unselected focus color', (WidgetTester tester) async { tester.binding.focusManager.highlightStrategy = FocusHighlightStrategy.alwaysTraditional; - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B', 'C']; await tester.pumpWidget( @@ -6511,7 +6511,7 @@ void main() { }); testWidgets('Tab has correct selected/unselected pressed color', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B', 'C']; await tester.pumpWidget( @@ -6579,7 +6579,7 @@ void main() { testWidgets('TabAlignment.fill only supports non-scrollable tab bar', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B']; // Test TabAlignment.fill with non-scrollable tab bar. @@ -6611,7 +6611,7 @@ void main() { testWidgets('TabAlignment.start & TabAlignment.startOffset only supports scrollable tab bar', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final List tabs = ['A', 'B']; // Test TabAlignment.start with scrollable tab bar. @@ -6896,10 +6896,7 @@ void main() { const Color dividerColor = Colors.yellow; await tester.pumpWidget( MaterialApp( - theme: ThemeData( - useMaterial3: true, - tabBarTheme: const TabBarThemeData(dividerColor: dividerColor), - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(dividerColor: dividerColor)), home: Scaffold( appBar: AppBar( bottom: TabBar( @@ -6921,10 +6918,7 @@ void main() { const Color dividerColor = Colors.yellow; await tester.pumpWidget( MaterialApp( - theme: ThemeData( - useMaterial3: true, - tabBarTheme: const TabBarThemeData(dividerColor: dividerColor), - ), + theme: ThemeData(tabBarTheme: const TabBarThemeData(dividerColor: dividerColor)), home: Scaffold( body: DefaultTabController( length: 2, diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index c241fb91cf..41e18072c0 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -443,7 +443,7 @@ void main() { WidgetTester tester, ) async { final FocusNode focusNode = FocusNode(); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -1458,7 +1458,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: TextButton(key: key, onPressed: () {}, child: const Text('TextButton')), @@ -1477,7 +1477,7 @@ void main() { final Key key = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(colorScheme: const ColorScheme.light(), useMaterial3: true), + theme: ThemeData.from(colorScheme: const ColorScheme.light()), home: Scaffold( body: Center( child: TextButton.icon( @@ -1571,7 +1571,7 @@ void main() { testWidgets( 'TextButton uses InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -2465,7 +2465,7 @@ void main() { testWidgets('treats a hovering stylus like a mouse', (WidgetTester tester) async { final FocusNode focusNode = FocusNode(); addTearDown(focusNode.dispose); - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); bool hasBeenHovered = false; await tester.pumpWidget( diff --git a/packages/flutter/test/material/text_button_theme_test.dart b/packages/flutter/test/material/text_button_theme_test.dart index 171a45b36c..a5caa6f77f 100644 --- a/packages/flutter/test/material/text_button_theme_test.dart +++ b/packages/flutter/test/material/text_button_theme_test.dart @@ -25,7 +25,7 @@ void main() { const ColorScheme colorScheme = ColorScheme.light(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.from(useMaterial3: true, colorScheme: colorScheme), + theme: ThemeData.from(colorScheme: colorScheme), home: Scaffold( body: Center(child: TextButton(onPressed: () {}, child: const Text('button'))), ), @@ -288,10 +288,7 @@ void main() { Widget buildFrame({Color? overallShadowColor, Color? themeShadowColor, Color? shadowColor}) { return MaterialApp( - theme: ThemeData.from( - useMaterial3: true, - colorScheme: colorScheme.copyWith(shadow: overallShadowColor), - ), + theme: ThemeData.from(colorScheme: colorScheme.copyWith(shadow: overallShadowColor)), home: Scaffold( body: Center( child: TextButtonTheme( diff --git a/packages/flutter/test/material/text_field_splash_test.dart b/packages/flutter/test/material/text_field_splash_test.dart index 3ec54d6187..4393b1f1b3 100644 --- a/packages/flutter/test/material/text_field_splash_test.dart +++ b/packages/flutter/test/material/text_field_splash_test.dart @@ -83,7 +83,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light().copyWith(splashFactory: const TestInkSplashFactory()), + data: ThemeData(splashFactory: const TestInkSplashFactory()), child: Material( child: Container( alignment: Alignment.topLeft, @@ -129,7 +129,7 @@ void main() { await tester.pumpWidget( MaterialApp( home: Theme( - data: ThemeData.light().copyWith(splashFactory: const TestInkSplashFactory()), + data: ThemeData(splashFactory: const TestInkSplashFactory()), child: Material( child: ListView( children: [ diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index ee6c65235f..5dc6b955c3 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -6350,7 +6350,6 @@ void main() { final TextEditingController textController = _textEditingController(); final ThemeData theme = ThemeData.from( colorScheme: const ColorScheme.light().copyWith(error: Colors.deepPurpleAccent), - useMaterial3: true, ); await tester.pumpWidget( boilerplate( @@ -6779,7 +6778,7 @@ void main() { text: 'Atwater Peel Sherbrooke Bonaventure', ); - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); await tester.pumpWidget( MaterialApp( @@ -6938,7 +6937,7 @@ void main() { text: 'Atwater Peel Sherbrooke Bonaventure', ); - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData(); Widget buildFrame(bool enabled) { return MaterialApp( @@ -9284,7 +9283,6 @@ void main() { // Regression test for https://github.com/flutter/flutter/issues/23994 final ThemeData themeData = ThemeData( - useMaterial3: true, textTheme: TextTheme(bodyLarge: TextStyle(color: Colors.blue[500])), ); diff --git a/packages/flutter/test/material/text_selection_theme_test.dart b/packages/flutter/test/material/text_selection_theme_test.dart index 0161208bd2..91c9f4cd6e 100644 --- a/packages/flutter/test/material/text_selection_theme_test.dart +++ b/packages/flutter/test/material/text_selection_theme_test.dart @@ -111,7 +111,7 @@ void main() { testWidgets('Material3 - Empty textSelectionTheme will use defaults', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final Color defaultCursorColor = theme.colorScheme.primary; final Color defaultSelectionColor = theme.colorScheme.primary.withOpacity(0.40); final Color defaultSelectionHandleColor = theme.colorScheme.primary; diff --git a/packages/flutter/test/material/text_selection_toolbar_test.dart b/packages/flutter/test/material/text_selection_toolbar_test.dart index 422aa23bdb..35a49d85d7 100644 --- a/packages/flutter/test/material/text_selection_toolbar_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_test.dart @@ -206,7 +206,7 @@ void main() { }, skip: kIsWeb); // [intended] We don't show the toolbar on the web. for (final ColorScheme colorScheme in [ - ThemeData.light().colorScheme, + ThemeData().colorScheme, ThemeData.dark().colorScheme, ]) { testWidgets('default background color', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart index ac6c867591..92b6875dad 100644 --- a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart @@ -62,7 +62,7 @@ void main() { }); for (final ColorScheme colorScheme in [ - ThemeData.light().colorScheme, + ThemeData().colorScheme, ThemeData.dark().colorScheme, ]) { testWidgets('foreground color by default', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 1185d7fc45..b18a241934 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -14,7 +14,7 @@ void main() { expect(dark, equals(dark.copyWith())); expect(dark.hashCode, equals(dark.copyWith().hashCode)); - final ThemeData light = ThemeData.light(); + final ThemeData light = ThemeData(); final ThemeData dawn = ThemeData.lerp(dark, light, 0.25); expect(dawn.brightness, Brightness.dark); @@ -108,15 +108,15 @@ void main() { }); test('light, dark and fallback constructors support useMaterial3', () { - final ThemeData lightTheme = ThemeData.light(useMaterial3: true); + final ThemeData lightTheme = ThemeData(); expect(lightTheme.useMaterial3, true); expect(lightTheme.typography, Typography.material2021(colorScheme: lightTheme.colorScheme)); - final ThemeData darkTheme = ThemeData.dark(useMaterial3: true); + final ThemeData darkTheme = ThemeData.dark(); expect(darkTheme.useMaterial3, true); expect(darkTheme.typography, Typography.material2021(colorScheme: darkTheme.colorScheme)); - final ThemeData fallbackTheme = ThemeData.light(useMaterial3: true); + final ThemeData fallbackTheme = ThemeData(); expect(fallbackTheme.useMaterial3, true); expect( fallbackTheme.typography, @@ -316,7 +316,7 @@ void main() { }); test('ThemeData can generate a default M3 light colorScheme when useMaterial3 is true', () { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); expect(theme.colorScheme.primary, const Color(0xff6750a4)); expect(theme.colorScheme.onPrimary, const Color(0xffffffff)); @@ -380,7 +380,7 @@ void main() { test( 'ThemeData.light() can generate a default M3 light colorScheme when useMaterial3 is true', () { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData.light(); expect(theme.colorScheme.primary, const Color(0xff6750a4)); expect(theme.colorScheme.onPrimary, const Color(0xffffffff)); @@ -443,7 +443,7 @@ void main() { ); test('ThemeData.dark() can generate a default M3 dark colorScheme when useMaterial3 is true', () { - final ThemeData theme = ThemeData.dark(useMaterial3: true); + final ThemeData theme = ThemeData.dark(); expect(theme.colorScheme.primary, const Color(0xffd0bcff)); expect(theme.colorScheme.onPrimary, const Color(0xff381e72)); expect(theme.colorScheme.primaryContainer, const Color(0xff4f378b)); @@ -537,7 +537,7 @@ void main() { testWidgets( 'splashFactory is InkSparkle only for Android non-web when useMaterial3 is true', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); // Basic check that this theme is in fact using material 3. expect(theme.useMaterial3, true); @@ -1005,13 +1005,11 @@ void main() { // GENERAL CONFIGURATION adaptationMap: const >{SwitchThemeData: SwitchThemeAdaptation()}, applyElevationOverlayColor: true, - cupertinoOverrideTheme: ThemeData.light().cupertinoOverrideTheme, + cupertinoOverrideTheme: ThemeData().cupertinoOverrideTheme, extensions: const >{ MyThemeExtensionB: MyThemeExtensionB(textStyle: TextStyle()), }, - inputDecorationTheme: ThemeData.light().inputDecorationTheme.copyWith( - border: InputBorder.none, - ), + inputDecorationTheme: ThemeData().inputDecorationTheme.copyWith(border: InputBorder.none), materialTapTargetSize: MaterialTapTargetSize.padded, pageTransitionsTheme: const PageTransitionsTheme(), platform: TargetPlatform.android, @@ -1038,10 +1036,10 @@ void main() { splashColor: Colors.white, unselectedWidgetColor: Colors.white, // TYPOGRAPHY & ICONOGRAPHY - iconTheme: ThemeData.light().iconTheme, - primaryIconTheme: ThemeData.light().iconTheme, - primaryTextTheme: ThemeData.light().textTheme, - textTheme: ThemeData.light().textTheme, + iconTheme: ThemeData().iconTheme, + primaryIconTheme: ThemeData().iconTheme, + primaryTextTheme: ThemeData().textTheme, + textTheme: ThemeData().textTheme, typography: Typography.material2018(platform: TargetPlatform.iOS), // COMPONENT THEMES actionIconTheme: const ActionIconThemeData(), @@ -1438,7 +1436,7 @@ void main() { }; final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); - ThemeData.light().debugFillProperties(properties); + ThemeData().debugFillProperties(properties); final List propertyNameList = properties.properties .map((final DiagnosticsNode node) => node.name) diff --git a/packages/flutter/test/material/theme_defaults_test.dart b/packages/flutter/test/material/theme_defaults_test.dart index b1b59fcd70..50f30029a1 100644 --- a/packages/flutter/test/material/theme_defaults_test.dart +++ b/packages/flutter/test/material/theme_defaults_test.dart @@ -47,7 +47,7 @@ void main() { }); testWidgets('Material3 - theme: ThemeData.light(), enabled: true', (WidgetTester tester) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData.light(); await tester.pumpWidget( MaterialApp( theme: theme, @@ -113,7 +113,7 @@ void main() { testWidgets('Material3 - theme: ThemeData.light(), enabled: false', ( WidgetTester tester, ) async { - final ThemeData theme = ThemeData.light(useMaterial3: true); + final ThemeData theme = ThemeData.light(); await tester.pumpWidget( MaterialApp( theme: theme, diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index 6bae7d1cca..9d71b8c5dc 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -13,7 +13,7 @@ void main() { const TextTheme defaultGeometryThemeM3 = Typography.englishLike2021; test('ThemeDataTween control test', () { - final ThemeData light = ThemeData.light(); + final ThemeData light = ThemeData(); final ThemeData dark = ThemeData.dark(); final ThemeDataTween tween = ThemeDataTween(begin: light, end: dark); expect(tween.lerp(0.25), equals(ThemeData.lerp(light, dark, 0.25))); @@ -119,7 +119,7 @@ void main() { late BuildContext capturedContextM3; await tester.pumpWidget( Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: Builder( builder: (BuildContext context) { capturedContextM3 = context; @@ -131,12 +131,12 @@ void main() { expect( Theme.of(capturedContextM3), - equals(ThemeData.localize(ThemeData.fallback(useMaterial3: true), defaultGeometryThemeM3)), + equals(ThemeData.localize(ThemeData.fallback(), defaultGeometryThemeM3)), ); }); testWidgets('ThemeData.localize memoizes the result', (WidgetTester tester) async { - final ThemeData light = ThemeData.light(); + final ThemeData light = ThemeData(); final ThemeData dark = ThemeData.dark(); // Same input, same output. @@ -168,7 +168,7 @@ void main() { testWidgets('Material3 - ThemeData with null typography uses proper defaults', ( WidgetTester tester, ) async { - final ThemeData m3Theme = ThemeData(useMaterial3: true); + final ThemeData m3Theme = ThemeData(); expect(m3Theme.typography, Typography.material2021(colorScheme: m3Theme.colorScheme)); }); @@ -510,7 +510,7 @@ void main() { late ThemeData theme; await tester.pumpWidget( Theme( - data: ThemeData(useMaterial3: true), + data: ThemeData(), child: Directionality( textDirection: TextDirection.ltr, child: Builder( @@ -610,7 +610,7 @@ void main() { }); testWidgets('Material3 - Default light theme has defaults', (WidgetTester tester) async { - final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData(useMaterial3: true)); + final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData()); expect(themeM3.brightness, Brightness.light); expect(themeM3.primaryColor, const Color(0xff6750a4)); @@ -635,10 +635,7 @@ void main() { }); testWidgets('Material3 - Dark theme has defaults', (WidgetTester tester) async { - final CupertinoThemeData themeM3 = await testTheme( - tester, - ThemeData.dark(useMaterial3: true), - ); + final CupertinoThemeData themeM3 = await testTheme(tester, ThemeData.dark()); expect(themeM3.brightness, Brightness.dark); expect(themeM3.primaryColor, const Color(0xffd0bcff)); @@ -652,7 +649,7 @@ void main() { await testTheme(tester, ThemeData.dark()); expect(CupertinoTheme.brightnessOf(context!), Brightness.dark); - await testTheme(tester, ThemeData.light()); + await testTheme(tester, ThemeData()); expect(CupertinoTheme.brightnessOf(context!), Brightness.light); // Overridable by cupertinoOverrideTheme. @@ -703,7 +700,6 @@ void main() { cupertinoOverrideTheme: const CupertinoThemeData( scaffoldBackgroundColor: CupertinoColors.lightBackgroundGray, ), - useMaterial3: true, ), ); @@ -746,7 +742,6 @@ void main() { // The bar colors ignore all things material except brightness. barBackgroundColor: CupertinoColors.black, ), - useMaterial3: true, ), ); @@ -780,7 +775,7 @@ void main() { ) async { CupertinoThemeData themeM3 = await testTheme( tester, - ThemeData(useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.red)), + ThemeData(colorScheme: const ColorScheme.light(primary: Colors.red)), ); expect(buildCount, 1); @@ -788,7 +783,7 @@ void main() { themeM3 = await testTheme( tester, - ThemeData(useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.orange)), + ThemeData(colorScheme: const ColorScheme.light(primary: Colors.orange)), ); expect(buildCount, 2); @@ -912,7 +907,6 @@ void main() { CupertinoThemeData theme = await testTheme( tester, ThemeData( - useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.purple), cupertinoOverrideTheme: const CupertinoThemeData( primaryContrastingColor: CupertinoColors.destructiveRed, @@ -927,7 +921,6 @@ void main() { theme = await testTheme( tester, ThemeData( - useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.green), cupertinoOverrideTheme: const CupertinoThemeData( primaryContrastingColor: CupertinoColors.destructiveRed, @@ -980,7 +973,6 @@ void main() { final CupertinoThemeData originalTheme = await testTheme( tester, ThemeData( - useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.purple), cupertinoOverrideTheme: const CupertinoThemeData( primaryContrastingColor: CupertinoColors.activeOrange, @@ -995,7 +987,6 @@ void main() { final CupertinoThemeData theme = await testTheme( tester, ThemeData( - useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.blue), cupertinoOverrideTheme: copiedTheme, ), @@ -1037,7 +1028,7 @@ void main() { ) async { final CupertinoThemeData originalTheme = await testTheme( tester, - ThemeData(useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.purple)), + ThemeData(colorScheme: const ColorScheme.light(primary: Colors.purple)), ); final CupertinoThemeData copiedTheme = originalTheme.copyWith( @@ -1047,7 +1038,6 @@ void main() { final CupertinoThemeData theme = await testTheme( tester, ThemeData( - useMaterial3: true, colorScheme: const ColorScheme.light(primary: Colors.blue), cupertinoOverrideTheme: copiedTheme, ), diff --git a/packages/flutter/test/material/time_picker_test.dart b/packages/flutter/test/material/time_picker_test.dart index c55e2a306b..309181641d 100644 --- a/packages/flutter/test/material/time_picker_test.dart +++ b/packages/flutter/test/material/time_picker_test.dart @@ -160,7 +160,7 @@ void main() { }); testWidgets('Material3 - Dialog size - input mode', (WidgetTester tester) async { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); const TimePickerEntryMode entryMode = TimePickerEntryMode.input; const double textScaleFactor = 1.0; const Size timePickerMinInputSize = Size(312, 216); @@ -225,7 +225,7 @@ void main() { testWidgets('Material3 - Dial background uses correct default color', ( WidgetTester tester, ) async { - ThemeData theme = ThemeData(useMaterial3: true); + ThemeData theme = ThemeData(); Widget buildTimePicker(ThemeData themeData) { return MaterialApp( theme: themeData, @@ -1067,7 +1067,6 @@ void main() { const String cancelString = 'Cancel'; Widget buildFrame(TextDirection textDirection) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Material( child: Center( child: Builder( diff --git a/packages/flutter/test/material/time_picker_theme_test.dart b/packages/flutter/test/material/time_picker_theme_test.dart index acfcd7a277..ecdbf31808 100644 --- a/packages/flutter/test/material/time_picker_theme_test.dart +++ b/packages/flutter/test/material/time_picker_theme_test.dart @@ -275,7 +275,7 @@ void main() { testWidgets('Material3 - Passing no TimePickerThemeData uses defaults', ( WidgetTester tester, ) async { - final ThemeData defaultTheme = ThemeData(useMaterial3: true); + final ThemeData defaultTheme = ThemeData(); await tester.pumpWidget(_TimePickerLauncher(themeData: defaultTheme)); await tester.tap(find.text('X')); await tester.pumpAndSettle(const Duration(seconds: 1)); @@ -487,7 +487,7 @@ void main() { testWidgets('Material3 - Passing no TimePickerThemeData uses defaults - input mode', ( WidgetTester tester, ) async { - final ThemeData defaultTheme = ThemeData(useMaterial3: true); + final ThemeData defaultTheme = ThemeData(); await tester.pumpWidget( _TimePickerLauncher(themeData: defaultTheme, entryMode: TimePickerEntryMode.input), ); @@ -697,7 +697,7 @@ void main() { WidgetTester tester, ) async { final TimePickerThemeData timePickerTheme = _timePickerTheme(); - final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme, useMaterial3: true); + final ThemeData theme = ThemeData(timePickerTheme: timePickerTheme); await tester.pumpWidget(_TimePickerLauncher(themeData: theme)); await tester.tap(find.text('X')); await tester.pumpAndSettle(const Duration(seconds: 1)); diff --git a/packages/flutter/test/material/typography_test.dart b/packages/flutter/test/material/typography_test.dart index ac406fbb81..b89ff8788a 100644 --- a/packages/flutter/test/material/typography_test.dart +++ b/packages/flutter/test/material/typography_test.dart @@ -399,7 +399,7 @@ void main() { }); test('Default M3 light textTheme styles all use onSurface', () { - final ThemeData theme = ThemeData(useMaterial3: true); + final ThemeData theme = ThemeData(); final TextTheme textTheme = theme.textTheme; final Color dark = theme.colorScheme.onSurface; expect(textTheme.displayLarge!.color, dark); @@ -420,7 +420,7 @@ void main() { }); test('Default M3 dark textTheme styles all use onSurface', () { - final ThemeData theme = ThemeData(useMaterial3: true, brightness: Brightness.dark); + final ThemeData theme = ThemeData(brightness: Brightness.dark); final TextTheme textTheme = theme.textTheme; final Color light = theme.colorScheme.onSurface; expect(textTheme.displayLarge!.color, light); diff --git a/packages/flutter/test/rendering/localized_fonts_test.dart b/packages/flutter/test/rendering/localized_fonts_test.dart index 92a327d5a6..0c07d7df09 100644 --- a/packages/flutter/test/rendering/localized_fonts_test.dart +++ b/packages/flutter/test/rendering/localized_fonts_test.dart @@ -64,7 +64,6 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), supportedLocales: const [Locale('en', 'US'), Locale('ja'), Locale('zh')], home: Builder( builder: (BuildContext context) { @@ -157,7 +156,6 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), supportedLocales: const [Locale('en', 'US'), Locale('ja'), Locale('zh')], home: Builder( builder: (BuildContext context) { @@ -243,7 +241,6 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), supportedLocales: const [Locale('en', 'US'), Locale('ja'), Locale('zh')], home: Builder( builder: (BuildContext context) { diff --git a/packages/flutter/test/widgets/backdrop_filter_test.dart b/packages/flutter/test/widgets/backdrop_filter_test.dart index 393f7d95f9..cbccc2ba46 100644 --- a/packages/flutter/test/widgets/backdrop_filter_test.dart +++ b/packages/flutter/test/widgets/backdrop_filter_test.dart @@ -154,7 +154,6 @@ void main() { ) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Stack( fit: StackFit.expand, @@ -242,7 +241,6 @@ void main() { testWidgets('Material3 - BackdropFilter blendMode on saveLayer', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: Opacity( opacity: 0.9, diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index eae26cf3f3..3e77dbb0e3 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -9960,7 +9960,7 @@ void main() { final _AccentColorTextEditingController controller = _AccentColorTextEditingController('a'); addTearDown(controller.dispose); const Color color = Color.fromARGB(255, 1, 2, 3); - final ThemeData lightTheme = ThemeData.light(); + final ThemeData lightTheme = ThemeData(); await tester.pumpWidget( MaterialApp( theme: lightTheme.copyWith( diff --git a/packages/flutter/test/widgets/implicit_animations_test.dart b/packages/flutter/test/widgets/implicit_animations_test.dart index 07ab9456cf..d0e755c8e4 100644 --- a/packages/flutter/test/widgets/implicit_animations_test.dart +++ b/packages/flutter/test/widgets/implicit_animations_test.dart @@ -955,7 +955,7 @@ class _TestAnimatedThemeWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedTheme( - data: toggle ? ThemeData.dark() : ThemeData.light(), + data: toggle ? ThemeData.dark() : ThemeData(), duration: duration, onEnd: widget.callback, child: child, diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index 9559426ef9..0acb948ccf 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -1249,7 +1249,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Center( child: SizedBox( width: pixel6EmulatorWidth, @@ -1300,7 +1299,6 @@ void main() { await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), home: Center( child: PageView( controller: controller, diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart index 389f0fb975..150c36a393 100644 --- a/packages/flutter/test/widgets/scrollable_test.dart +++ b/packages/flutter/test/widgets/scrollable_test.dart @@ -1626,7 +1626,7 @@ void main() { testWidgets('resolvedPhysics getter', (WidgetTester tester) async { await tester.pumpWidget( MaterialApp( - theme: ThemeData.light().copyWith(platform: TargetPlatform.android), + theme: ThemeData(platform: TargetPlatform.android), home: const CustomScrollView( physics: AlwaysScrollableScrollPhysics(), slivers: [SliverToBoxAdapter(child: SizedBox(height: 2000.0))], diff --git a/packages/flutter/test/widgets/two_dimensional_utils.dart b/packages/flutter/test/widgets/two_dimensional_utils.dart index 8081d86f26..30a2806861 100644 --- a/packages/flutter/test/widgets/two_dimensional_utils.dart +++ b/packages/flutter/test/widgets/two_dimensional_utils.dart @@ -291,7 +291,6 @@ Widget simpleListTest({ Clip? clipBehavior, }) { return MaterialApp( - theme: ThemeData(useMaterial3: true), home: Scaffold( body: SimpleListTableView( mainAxis: mainAxis, diff --git a/packages/flutter_localizations/test/basics_test.dart b/packages/flutter_localizations/test/basics_test.dart index 32e9032bf4..e9af3be199 100644 --- a/packages/flutter_localizations/test/basics_test.dart +++ b/packages/flutter_localizations/test/basics_test.dart @@ -11,7 +11,6 @@ void main() { await tester.pumpWidget( MaterialApp( // Creates the outer Localizations widget. - theme: ThemeData(useMaterial3: true), home: ListView( children: [ const LocalizationTracker(key: ValueKey('outer')), diff --git a/packages/flutter_localizations/test/material/date_picker_test.dart b/packages/flutter_localizations/test/material/date_picker_test.dart index b09e56f858..c88cd3e119 100644 --- a/packages/flutter_localizations/test/material/date_picker_test.dart +++ b/packages/flutter_localizations/test/material/date_picker_test.dart @@ -154,7 +154,6 @@ void main() { testWidgets('Material3 - locale parameter overrides ambient locale', (WidgetTester tester) async { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), locale: const Locale('en', 'US'), supportedLocales: const [Locale('en', 'US'), Locale('fr', 'CA')], localizationsDelegates: GlobalMaterialLocalizations.delegates, @@ -235,7 +234,6 @@ void main() { ) async { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), locale: const Locale('en', 'US'), home: Material( child: Builder( @@ -318,7 +316,6 @@ void main() { ) async { Widget buildFrame() { return MaterialApp( - theme: ThemeData(useMaterial3: true), locale: const Locale('en', 'US'), supportedLocales: const [Locale('en', 'US'), Locale('fr', 'CA')], localizationsDelegates: GlobalMaterialLocalizations.delegates, diff --git a/packages/flutter_localizations/test/text_test.dart b/packages/flutter_localizations/test/text_test.dart index 6bb6ab67f5..2c33c416d3 100644 --- a/packages/flutter_localizations/test/text_test.dart +++ b/packages/flutter_localizations/test/text_test.dart @@ -82,7 +82,6 @@ void main() { final Key targetKey = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), routes: { '/next': (BuildContext context) { return const Text('Next'); @@ -212,7 +211,6 @@ void main() { final Key targetKey = UniqueKey(); await tester.pumpWidget( MaterialApp( - theme: ThemeData(useMaterial3: true), routes: { '/next': (BuildContext context) { return const Text('Next'); diff --git a/packages/flutter_test/test/accessibility_test.dart b/packages/flutter_test/test/accessibility_test.dart index f7c8fb9010..b94d7e18ee 100644 --- a/packages/flutter_test/test/accessibility_test.dart +++ b/packages/flutter_test/test/accessibility_test.dart @@ -874,7 +874,6 @@ void main() { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget( MaterialApp( - theme: ThemeData.light(), home: Scaffold( backgroundColor: Colors.white, body: ElevatedButton(