diff --git a/material_3_demo/lib/component_screen.dart b/material_3_demo/lib/component_screen.dart index eebaf4a27..cddee8588 100644 --- a/material_3_demo/lib/component_screen.dart +++ b/material_3_demo/lib/component_screen.dart @@ -242,6 +242,7 @@ class Containment extends StatelessWidget { return const ComponentGroupDecoration(label: 'Containment', children: [ BottomSheetSection(), Cards(), + Carousels(), Dialogs(), Dividers(), // TODO: Add Lists, https://github.com/flutter/flutter/issues/114006 @@ -2416,6 +2417,65 @@ class _SearchAnchorsState extends State { } } +class Carousels extends StatelessWidget { + const Carousels({super.key}); + + @override + Widget build(BuildContext context) { + return ComponentDecoration( + label: 'Carousel', + tooltipMessage: 'Use CarouselView', + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.only(left: 8.0), + child: Text('Uncontained Carousel'), + ), + ConstrainedBox( + constraints: const BoxConstraints.tightFor(height: 150), + child: CarouselView( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Theme.of(context).colorScheme.outline), + ), + shrinkExtent: 100, + itemExtent: 180, + children: List.generate(20, (index) { + return Center( + child: Text('Item $index'), + ); + }), + ), + ), + colDivider, + const Padding( + padding: EdgeInsets.only(left: 8.0), + child: Text('Uncontained Carousel with snapping effect'), + ), + ConstrainedBox( + constraints: const BoxConstraints.tightFor(height: 150), + child: CarouselView( + itemSnapping: true, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Theme.of(context).colorScheme.outline), + ), + shrinkExtent: 100, + itemExtent: 180, + children: List.generate(20, (index) { + return Center( + child: Text('Item $index'), + ); + }), + ), + ), + ], + ), + ); + } +} + class ComponentDecoration extends StatefulWidget { const ComponentDecoration({ super.key, diff --git a/material_3_demo/test/component_screen_test.dart b/material_3_demo/test/component_screen_test.dart index d1ebf3720..b37642c32 100644 --- a/material_3_demo/test/component_screen_test.dart +++ b/material_3_demo/test/component_screen_test.dart @@ -10,7 +10,7 @@ import 'package:material_3_demo/main.dart'; void main() { testWidgets('Default main page shows all M3 components', (tester) async { - widgetSetup(tester, 800, windowHeight: 7000); + widgetSetup(tester, 800, windowHeight: 7500); await tester.pumpWidget(const App()); // Elements on the app bar @@ -67,6 +67,9 @@ void main() { expect(find.widgetWithText(Cards, 'Filled'), findsOneWidget); expect(find.widgetWithText(Cards, 'Outlined'), findsOneWidget); + // Carousels + expect(find.byType(CarouselView), findsNWidgets(2)); + // Dialogs expect(find.widgetWithText(TextButton, 'Show dialog'), findsOneWidget); expect(find.widgetWithText(TextButton, 'Show full-screen dialog'), diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index b4f8bd5b2..3ff79879f 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -34,9 +34,6 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_platform_interface" "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" - # TODO: ewindmill to talk to team about removing. - # Depends on package context_menus, which breaks with Material3 by default. - # "experimental/linting_tool" "experimental/pedometer" "experimental/pedometer/example" "experimental/varfont_shader_puzzle" diff --git a/tool/flutter_ci_script_master.sh b/tool/flutter_ci_script_master.sh index 588a0dc2c..ccaf11d57 100755 --- a/tool/flutter_ci_script_master.sh +++ b/tool/flutter_ci_script_master.sh @@ -34,13 +34,11 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_platform_interface" "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" - # TODO: ewindmill to talk to team about removing. - # Depends on package context_menus, which breaks with Material3 by default. - # "experimental/linting_tool" "experimental/pedometer" "experimental/pedometer/example" "experimental/varfont_shader_puzzle" - "experimental/web_dashboard" +# TODO ewindmill -- whereNotNull deprecated in dart:collection +# "experimental/web_dashboard" "flutter_maps_firestore" "form_app" "game_template" diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index a96ac4052..8eb245196 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -34,9 +34,6 @@ declare -ar PROJECT_NAMES=( "experimental/federated_plugin/federated_plugin_platform_interface" "experimental/federated_plugin/federated_plugin_web" "experimental/federated_plugin/federated_plugin_windows" - # TODO: ewindmill to talk to team about removing. - # Depends on package context_menus, which breaks with Material3 by default. - # "experimental/linting_tool" "experimental/pedometer" "experimental/pedometer/example" "experimental/varfont_shader_puzzle" diff --git a/tool/flutter_clean_packages b/tool/flutter_clean_packages new file mode 100644 index 000000000..d3096b068 --- /dev/null +++ b/tool/flutter_clean_packages @@ -0,0 +1,80 @@ +#!/bin/bash + +set -e + +flutter doctor -v + +declare -ar PROJECT_NAMES=( + "add_to_app/android_view/flutter_module_using_plugin" + "add_to_app/books/flutter_module_books" + "add_to_app/fullscreen/flutter_module" + "add_to_app/multiple_flutters/multiple_flutters_module" + "add_to_app/plugin/flutter_module_using_plugin" + "add_to_app/prebuilt_module/flutter_module" + "ai_recipe_generation" + "analysis_defaults" + "android_splash_screen" + "animations" + "asset_transformation" + "background_isolate_channels" + "code_sharing/client" + "code_sharing/server" + "code_sharing/shared" + "context_menus" + "deeplink_store_example" + "desktop_photo_search/fluent_ui" + "desktop_photo_search/material" + "dynamic_theme" + "experimental/federated_plugin/federated_plugin" + "experimental/federated_plugin/federated_plugin/example" + "experimental/federated_plugin/federated_plugin_macos" + "experimental/federated_plugin/federated_plugin_platform_interface" + "experimental/federated_plugin/federated_plugin_web" + "experimental/federated_plugin/federated_plugin_windows" + "experimental/pedometer" + "experimental/pedometer/example" + "experimental/varfont_shader_puzzle" + "experimental/web_dashboard" + "flutter_maps_firestore" + "form_app" + "game_template" + "gemini_tasks" + "google_maps" + "infinite_list" + "ios_app_clip" + "isolate_example" + "material_3_demo" + "navigation_and_routing" + "place_tracker" + "platform_channels" + "platform_design" + "platform_view_swift" + "provider_counter" + "provider_shopper" + "simple_shader" + "simplistic_calculator" + "simplistic_editor" + "testing_app" + "veggieseasons" + "web_embedding/element_embedding_demo" + "web/_tool" + "web/samples_index" +) + +echo "--- Running flutter clean and flutter pub get for each sample ---" + +for PROJECT_NAME in "${PROJECT_NAMES[@]}" + do + echo "== Cleaning '${PROJECT_NAME}' with Flutter clean ==" + pushd "${PROJECT_NAME}" + + # run `flutter clean` for project + flutter clean + + # Grab packages. + flutter pub get + + popd + done + +echo "--- Success ---" \ No newline at end of file