Unverified Commit 62952891 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Remove deprecated `PlatformMenuBar.body` (#138509)

Part of https://github.com/flutter/flutter/issues/139243

## Description

This removes the `PlatformMenuBar.body` attribute and constructor parameter, since its deprecation period has elapsed.

## Tests
 - No tests were using the deprecated attribute, so no tests were removed.

#FlutterDeprecations
parent 60d5c8ab
......@@ -23,6 +23,27 @@
# * ListWheelScrollView: fix_list_wheel_scroll_view.yaml
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/138509
- title: "Migrate to 'PlatformMenuBar.child'"
date: 2023-11-15
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
field: 'body'
inClass: 'PlatformMenuBar'
changes:
- kind: 'rename'
newName: 'child'
- title: "Migrate PlatformMenuBar(body:) to PlatformMenuBar(child:)"
date: 2023-11-15
element:
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ]
constructor: ''
inClass: 'PlatformMenuBar'
changes:
- kind: 'renameParameter'
oldName: 'body'
newName: 'child'
# Changes made in https://github.com/flutter/flutter/pull/123352
- title: "Migrate to 'rootElement'"
date: 2023-03-13
......
......@@ -438,28 +438,13 @@ class PlatformMenuBar extends StatefulWidget with DiagnosticableTreeMixin {
super.key,
required this.menus,
this.child,
@Deprecated(
'Use the child attribute instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
)
this.body,
}) : assert(body == null || child == null,
'The body argument is deprecated, and only one of body or child may be used.');
});
/// The widget below this widget in the tree.
///
/// {@macro flutter.widgets.ProxyWidget.child}
final Widget? child;
/// The widget below this widget in the tree.
///
/// This attribute is deprecated, use [child] instead.
@Deprecated(
'Use the child attribute instead. '
'This feature was deprecated after v3.1.0-0.0.pre.'
)
final Widget? body;
/// The list of menu items that are the top level children of the
/// [PlatformMenuBar].
///
......@@ -530,7 +515,7 @@ class _PlatformMenuBarState extends State<PlatformMenuBar> {
Widget build(BuildContext context) {
// PlatformMenuBar is really about managing the platform menu bar, and
// doesn't do any rendering or event handling in Flutter.
return widget.child ?? widget.body ?? const SizedBox();
return widget.child ?? const SizedBox();
}
}
......
......@@ -245,4 +245,7 @@ void main() {
clipBehavior: Clip.none,
);
final Clip clip = details.clipBehavior;
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox());
final Widget bodyValue = platformMenuBar.body;
}
......@@ -245,4 +245,7 @@ void main() {
decorationClipBehavior: Clip.none,
);
final Clip clip = details.decorationClipBehavior;
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox());
final Widget bodyValue = platformMenuBar.child;
}
......@@ -323,4 +323,7 @@ void main() {
// const Curve curve = standardEasing; expect Easing.legacy
// const Curve curve = accelerateEasing; expect Easing.legacyAccelerate
// const Curve curve = decelerateEasing; expect Easing.legacyDecelerate
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox());
final Widget bodyValue = platformMenuBar.body;
}
......@@ -319,4 +319,7 @@ void main() {
// const Curve curve = standardEasing; expect Easing.legacy
// const Curve curve = accelerateEasing; expect Easing.legacyAccelerate
// const Curve curve = decelerateEasing; expect Easing.legacyDecelerate
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox());
final Widget bodyValue = platformMenuBar.child;
}
......@@ -170,4 +170,7 @@ void main() {
clipBehavior: Clip.none,
);
final Clip clip = details.clipBehavior;
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], body: const SizedBox());
final Widget bodyValue = platformMenuBar.body;
}
......@@ -170,4 +170,7 @@ void main() {
decorationClipBehavior: Clip.none,
);
final Clip clip = details.decorationClipBehavior;
final PlatformMenuBar platformMenuBar = PlatformMenuBar(menus: <PlatformMenuItem>[], child: const SizedBox());
final Widget bodyValue = platformMenuBar.child;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment