Skip to content

Commit dfc4dea

Browse files
Merge branch 'master' into fix/slider_text_null_error
* master: (29 commits) Add tests for actions.0.dart API example. (flutter#148678) Introduce `WidgetStateBorderSide.lerp` (flutter#148122) add `default-flavor` field to flutter pubspec, which will be used as the flavor in `flutter build/run` if `--flavor` is not provided (flutter#147968) [wiki migration] Pages under docs/postmortems/ (flutter#148798) Roll Flutter Engine from e5a73e520e89 to c89defa55801 (2 revisions) (flutter#148812) Make hover tests functional and cleanup mouse pointers in Material toggleables (flutter#148808) Fix two dimensional viewport unexpected null exception when no child is laid out (flutter#148256) Roll Flutter Engine from bc1345b6b50a to e5a73e520e89 (3 revisions) (flutter#148807) Add test for undo_history_controller.0.dart (flutter#148205) Roll Flutter Engine from a8872c8915a2 to bc1345b6b50a (6 revisions) (flutter#148802) Fix test that leaks images. (flutter#148494) Fix warnings in `dependency_version_checker.gradle.kts` (flutter#148699) [wiki migration] Android team pages (flutter#148585) Fix leaky test. (flutter#148788) Add DropdownButton.menuWidth (flutter#148125) Add test for focus example 2 (flutter#147624) Add a migrator to remove `FlutterMultiDexApplication.java` (flutter#148515) [wiki migration] Infra team pages (flutter#148718) Roll Flutter Engine from 8a352f01e503 to a8872c8915a2 (1 revision) (flutter#148776) Fix the output of the CDN test. (flutter#148730) ...
2 parents dccb4c9 + 112e8b5 commit dfc4dea

File tree

127 files changed

+1573
-914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1573
-914
lines changed

.github/labeler.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
- any-glob-to-any-file:
4949
- examples/api/**/*
5050

51+
'd: docs/':
52+
- changed-files:
53+
- any-glob-to-any-file:
54+
- docs/**/*
55+
5156
'd: examples':
5257
- changed-files:
5358
- any-glob-to-any-file:
@@ -126,6 +131,11 @@ package:
126131
- any-glob-to-any-file:
127132
- docs/ecosystem/**/*
128133

134+
platform-android:
135+
- changed-files:
136+
- any-glob-to-any-file:
137+
- docs/platform/android/**/*
138+
129139
platform-ios:
130140
- changed-files:
131141
- any-glob-to-any-file:
@@ -148,6 +158,16 @@ platform-web:
148158
- '**/*.expect'
149159
- '**/*test_fixes*'
150160

161+
team:
162+
- changed-files:
163+
- any-glob-to-any-file:
164+
- docs/postmortems/**/*
165+
166+
team-android:
167+
- changed-files:
168+
- any-glob-to-any-file:
169+
- docs/platform/android/**/*
170+
151171
team-ecosystem:
152172
- changed-files:
153173
- any-glob-to-any-file:
@@ -158,6 +178,16 @@ team-engine:
158178
- any-glob-to-any-file:
159179
- docs/engine/**/*
160180

181+
team-infra:
182+
- changed-files:
183+
- any-glob-to-any-file:
184+
- docs/infra/**/*
185+
186+
team-release:
187+
- changed-files:
188+
- any-glob-to-any-file:
189+
- docs/releases/**/*
190+
161191
tool:
162192
- changed-files:
163193
- any-glob-to-any-file:

bin/internal/engine.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c2ef01f6f1ab74f59b0ca27d6649f8a425a66d6f
1+
c89defa558013d7790ab0fec0819c30fccae3aba

bin/internal/fuchsia-linux.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
jXE7fqJI6VWFMaIdVFOYsP39O5i8wsvIrBGYhR35Y_EC
1+
HHwlAJN5imwf3yX4i6DhvMFhgYzp7YIXIsEYuvsx9JEC

dev/benchmarks/test_apps/stocks/lib/main.dart

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,14 @@ class StocksAppState extends State<StocksApp> {
4747
}
4848

4949
ThemeData get theme {
50-
switch (_configuration.stockMode) {
51-
case StockMode.optimistic:
52-
return ThemeData(
53-
useMaterial3: false,
54-
brightness: Brightness.light,
55-
primarySwatch: Colors.purple,
56-
);
57-
case StockMode.pessimistic:
58-
return ThemeData(
59-
useMaterial3: false,
60-
brightness: Brightness.dark,
61-
primarySwatch: Colors.purple,
62-
);
63-
}
50+
return ThemeData(
51+
useMaterial3: false,
52+
brightness: switch (_configuration.stockMode) {
53+
StockMode.optimistic => Brightness.light,
54+
StockMode.pessimistic => Brightness.dark,
55+
},
56+
primarySwatch: Colors.purple,
57+
);
6458
}
6559

6660
Route<dynamic>? _getRoute(RouteSettings settings) {

dev/bots/check_code_samples.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,6 @@ final Set<String> _knownMissingTests = <String>{
385385
'examples/api/test/widgets/sliver/decorated_sliver.0_test.dart',
386386
'examples/api/test/widgets/autofill/autofill_group.0_test.dart',
387387
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view_state.0_test.dart',
388-
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view.2_test.dart',
389-
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view.1_test.dart',
390-
'examples/api/test/widgets/nested_scroll_view/nested_scroll_view.0_test.dart',
391388
'examples/api/test/widgets/scroll_position/scroll_metrics_notification.0_test.dart',
392389
'examples/api/test/widgets/media_query/media_query_data.system_gesture_insets.0_test.dart',
393390
'examples/api/test/widgets/async/future_builder.0_test.dart',
@@ -423,18 +420,15 @@ final Set<String> _knownMissingTests = <String>{
423420
'examples/api/test/widgets/notification_listener/notification.0_test.dart',
424421
'examples/api/test/widgets/editable_text/text_editing_controller.0_test.dart',
425422
'examples/api/test/widgets/editable_text/editable_text.on_changed.0_test.dart',
426-
'examples/api/test/widgets/undo_history/undo_history_controller.0_test.dart',
427423
'examples/api/test/widgets/overscroll_indicator/glowing_overscroll_indicator.1_test.dart',
428424
'examples/api/test/widgets/overscroll_indicator/glowing_overscroll_indicator.0_test.dart',
429425
'examples/api/test/widgets/tween_animation_builder/tween_animation_builder.0_test.dart',
430426
'examples/api/test/widgets/single_child_scroll_view/single_child_scroll_view.1_test.dart',
431427
'examples/api/test/widgets/single_child_scroll_view/single_child_scroll_view.0_test.dart',
432428
'examples/api/test/widgets/restoration/restoration_mixin.0_test.dart',
433-
'examples/api/test/widgets/actions/actions.0_test.dart',
434429
'examples/api/test/widgets/actions/action_listener.0_test.dart',
435430
'examples/api/test/widgets/actions/focusable_action_detector.0_test.dart',
436431
'examples/api/test/widgets/color_filter/color_filtered.0_test.dart',
437-
'examples/api/test/widgets/focus_scope/focus.2_test.dart',
438432
'examples/api/test/widgets/focus_scope/focus_scope.0_test.dart',
439433
'examples/api/test/widgets/scroll_view/custom_scroll_view.1_test.dart',
440434
'examples/api/test/widgets/inherited_notifier/inherited_notifier.0_test.dart',

dev/conductor/core/lib/src/globals.dart

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,13 @@ String getNewPrLink({
152152
}) {
153153
assert(state.releaseChannel.isNotEmpty);
154154
assert(state.releaseVersion.isNotEmpty);
155-
late final String candidateBranch;
156-
late final String workingBranch;
157-
late final String repoLabel;
158-
switch (repoName) {
159-
case 'flutter':
160-
candidateBranch = state.framework.candidateBranch;
161-
workingBranch = state.framework.workingBranch;
162-
repoLabel = 'Framework';
163-
case 'engine':
164-
candidateBranch = state.engine.candidateBranch;
165-
workingBranch = state.engine.workingBranch;
166-
repoLabel = 'Engine';
167-
default:
168-
throw ConductorException('Expected repoName to be one of flutter or engine but got $repoName.');
169-
}
155+
final (pb.Repository repository, String repoLabel) = switch (repoName) {
156+
'flutter' => (state.framework, 'Framework'),
157+
'engine' => (state.engine, 'Engine'),
158+
_ => throw ConductorException('Expected repoName to be one of flutter or engine but got $repoName.'),
159+
};
160+
final String candidateBranch = repository.candidateBranch;
161+
final String workingBranch = repository.workingBranch;
170162
assert(candidateBranch.isNotEmpty);
171163
assert(workingBranch.isNotEmpty);
172164
final String title = '[flutter_releases] Flutter ${state.releaseChannel} '

dev/integration_tests/flutter_gallery/lib/demo/material/cards_demo.dart

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -377,22 +377,17 @@ class _CardsDemoState extends State<CardsDemo> {
377377
child: ListView(
378378
primary: true,
379379
padding: const EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0),
380-
children: destinations.map<Widget>((TravelDestination destination) {
381-
Widget? child;
382-
switch (destination.type) {
383-
case CardDemoType.standard:
384-
child = TravelDestinationItem(destination: destination, shape: _shape);
385-
case CardDemoType.tappable:
386-
child = TappableTravelDestinationItem(destination: destination, shape: _shape);
387-
case CardDemoType.selectable:
388-
child = SelectableTravelDestinationItem(destination: destination, shape: _shape);
389-
}
390-
391-
return Container(
392-
margin: const EdgeInsets.only(bottom: 8.0),
393-
child: child,
394-
);
395-
}).toList(),
380+
children: <Widget>[
381+
for (final TravelDestination destination in destinations)
382+
Padding(
383+
padding: const EdgeInsets.only(bottom: 8.0),
384+
child: switch (destination.type) {
385+
CardDemoType.standard => TravelDestinationItem(destination: destination, shape: _shape),
386+
CardDemoType.tappable => TappableTravelDestinationItem(destination: destination, shape: _shape),
387+
CardDemoType.selectable => SelectableTravelDestinationItem(destination: destination, shape: _shape),
388+
},
389+
),
390+
],
396391
),
397392
),
398393
);

dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/cut_corners_border.dart

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,13 @@ class CutCornersBorder extends OutlineInputBorder {
100100
if (gapStart == null || gapExtent <= 0.0 || gapPercentage == 0.0) {
101101
canvas.drawPath(_notchedCornerPath(outer.middleRect), paint);
102102
} else {
103-
final double? extent = lerpDouble(0.0, gapExtent + gapPadding * 2.0, gapPercentage);
104-
switch (textDirection) {
105-
case TextDirection.rtl: {
106-
final Path path = _notchedCornerPath(outer.middleRect, gapStart + gapPadding - extent!, extent);
107-
canvas.drawPath(path, paint);
108-
break;
109-
}
110-
case TextDirection.ltr: {
111-
final Path path = _notchedCornerPath(outer.middleRect, gapStart - gapPadding, extent);
112-
canvas.drawPath(path, paint);
113-
break;
114-
}
115-
case null:
116-
break;
103+
final double extent = lerpDouble(0.0, gapExtent + gapPadding * 2.0, gapPercentage)!;
104+
if (textDirection != null) {
105+
final double start = switch (textDirection) {
106+
TextDirection.rtl => gapStart + gapPadding - extent,
107+
TextDirection.ltr => gapStart - gapPadding,
108+
};
109+
canvas.drawPath(_notchedCornerPath(outer.middleRect, start, extent), paint);
117110
}
118111
}
119112
}

dev/integration_tests/new_gallery/lib/demos/cupertino/cupertino_alert_demo.dart

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -298,37 +298,26 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo>
298298
),
299299
child: Builder(
300300
builder: (BuildContext context) {
301+
final GalleryLocalizations localizations = GalleryLocalizations.of(context)!;
302+
final Widget showAlertButton = CupertinoButton.filled(
303+
onPressed: () => switch (widget.type) {
304+
AlertDemoType.alert => _alertDialogRoute,
305+
AlertDemoType.alertTitle => _alertWithTitleDialogRoute,
306+
AlertDemoType.alertButtons => _alertWithButtonsDialogRoute,
307+
AlertDemoType.alertButtonsOnly => _alertWithButtonsOnlyDialogRoute,
308+
AlertDemoType.actionSheet => _modalPopupRoute,
309+
}.present(),
310+
child: Text(localizations.cupertinoShowAlert),
311+
);
312+
301313
return Column(
302314
children: <Widget>[
303-
Expanded(
304-
child: Center(
305-
child: CupertinoButton.filled(
306-
onPressed: () {
307-
switch (widget.type) {
308-
case AlertDemoType.alert:
309-
_alertDialogRoute.present();
310-
case AlertDemoType.alertTitle:
311-
_alertWithTitleDialogRoute.present();
312-
case AlertDemoType.alertButtons:
313-
_alertWithButtonsDialogRoute.present();
314-
case AlertDemoType.alertButtonsOnly:
315-
_alertWithButtonsOnlyDialogRoute.present();
316-
case AlertDemoType.actionSheet:
317-
_modalPopupRoute.present();
318-
}
319-
},
320-
child: Text(
321-
GalleryLocalizations.of(context)!.cupertinoShowAlert,
322-
),
323-
),
324-
),
325-
),
315+
Expanded(child: Center(child: showAlertButton)),
326316
if (lastSelectedValue.value != null)
327317
Padding(
328318
padding: const EdgeInsets.all(16),
329319
child: Text(
330-
GalleryLocalizations.of(context)!
331-
.dialogSelectedOption(lastSelectedValue.value!),
320+
localizations.dialogSelectedOption(lastSelectedValue.value!),
332321
style: CupertinoTheme.of(context).textTheme.textStyle,
333322
textAlign: TextAlign.center,
334323
),

dev/integration_tests/new_gallery/lib/demos/material/button_demo.dart

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,18 @@ class ButtonDemo extends StatelessWidget {
2424

2525
@override
2626
Widget build(BuildContext context) {
27-
Widget? buttons;
28-
switch (type) {
29-
case ButtonDemoType.text:
30-
buttons = _TextButtonDemo();
31-
case ButtonDemoType.elevated:
32-
buttons = _ElevatedButtonDemo();
33-
case ButtonDemoType.outlined:
34-
buttons = _OutlinedButtonDemo();
35-
case ButtonDemoType.toggle:
36-
buttons = _ToggleButtonsDemo();
37-
case ButtonDemoType.floating:
38-
buttons = _FloatingActionButtonDemo();
39-
}
40-
4127
return Scaffold(
4228
appBar: AppBar(
4329
automaticallyImplyLeading: false,
4430
title: Text(_title(context)),
4531
),
46-
body: buttons,
32+
body: switch (type) {
33+
ButtonDemoType.text => _TextButtonDemo(),
34+
ButtonDemoType.elevated => _ElevatedButtonDemo(),
35+
ButtonDemoType.outlined => _OutlinedButtonDemo(),
36+
ButtonDemoType.toggle => _ToggleButtonsDemo(),
37+
ButtonDemoType.floating => _FloatingActionButtonDemo(),
38+
},
4739
);
4840
}
4941
}

dev/integration_tests/new_gallery/lib/demos/material/chip_demo.dart

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,17 @@ class ChipDemo extends StatelessWidget {
2626

2727
@override
2828
Widget build(BuildContext context) {
29-
Widget? buttons;
30-
switch (type) {
31-
case ChipDemoType.action:
32-
buttons = _ActionChipDemo();
33-
case ChipDemoType.choice:
34-
buttons = _ChoiceChipDemo();
35-
case ChipDemoType.filter:
36-
buttons = _FilterChipDemo();
37-
case ChipDemoType.input:
38-
buttons = _InputChipDemo();
39-
}
40-
4129
return Scaffold(
4230
appBar: AppBar(
4331
automaticallyImplyLeading: false,
4432
title: Text(_title(context)),
4533
),
46-
body: buttons,
34+
body: switch (type) {
35+
ChipDemoType.action => _ActionChipDemo(),
36+
ChipDemoType.choice => _ChoiceChipDemo(),
37+
ChipDemoType.filter => _FilterChipDemo(),
38+
ChipDemoType.input => _InputChipDemo(),
39+
},
4740
);
4841
}
4942
}

dev/integration_tests/new_gallery/lib/demos/material/divider_demo.dart

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,23 @@ class DividerDemo extends StatelessWidget {
1111

1212
final DividerDemoType type;
1313

14-
String _title(BuildContext context) {
15-
switch (type) {
16-
case DividerDemoType.horizontal:
17-
return GalleryLocalizations.of(context)!.demoDividerTitle;
18-
case DividerDemoType.vertical:
19-
return GalleryLocalizations.of(context)!.demoVerticalDividerTitle;
20-
}
21-
}
22-
2314
@override
2415
Widget build(BuildContext context) {
25-
late Widget dividers;
26-
switch (type) {
27-
case DividerDemoType.horizontal:
28-
dividers = _HorizontalDividerDemo();
29-
case DividerDemoType.vertical:
30-
dividers = _VerticalDividerDemo();
31-
}
32-
16+
final GalleryLocalizations localizations = GalleryLocalizations.of(context)!;
3317
return Scaffold(
3418
appBar: AppBar(
3519
automaticallyImplyLeading: false,
3620
title: Text(
37-
_title(context),
21+
switch (type) {
22+
DividerDemoType.horizontal => localizations.demoDividerTitle,
23+
DividerDemoType.vertical => localizations.demoVerticalDividerTitle,
24+
},
3825
),
3926
),
40-
body: dividers,
27+
body: switch (type) {
28+
DividerDemoType.horizontal => _HorizontalDividerDemo(),
29+
DividerDemoType.vertical => _VerticalDividerDemo(),
30+
},
4131
);
4232
}
4333
}

0 commit comments

Comments
 (0)