Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions material_3_demo/lib/component_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2416,6 +2417,65 @@ class _SearchAnchorsState extends State<SearchAnchors> {
}
}

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<Widget>.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<Widget>.generate(20, (index) {
return Center(
child: Text('Item $index'),
);
}),
),
),
],
),
);
}
}

class ComponentDecoration extends StatefulWidget {
const ComponentDecoration({
super.key,
Expand Down
5 changes: 4 additions & 1 deletion material_3_demo/test/component_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),
Expand Down
3 changes: 0 additions & 3 deletions tool/flutter_ci_script_beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 2 additions & 4 deletions tool/flutter_ci_script_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions tool/flutter_ci_script_stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
80 changes: 80 additions & 0 deletions tool/flutter_clean_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this because I'm treating this PR as the Flutter 3.24 update branch


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 ---"