Unverified Commit 406d86b4 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

PlatformMenuBar changes to bring it into line with upcoming MenuBar implementation (#104565)

When I was doing the MenuBar implementation, I made some changes to the PlatformMenuBar to allow it to understand shortcuts a little more, and to deprecate the body parameter rename it to child to match most other widgets.

These are those changes, separated out because they are separable, and I'm trying to make the MenuBar PR smaller.
parent 6efdf0ae
......@@ -126,7 +126,7 @@ class _MyMenuBarAppState extends State<MyMenuBarApp> {
],
),
],
body: Center(
child: Center(
child: Text(_showMessage
? _message
: 'This space intentionally left blank.\n'
......
......@@ -51,7 +51,6 @@ void main() {
MaterialApp(
home: Material(
child: PlatformMenuBar(
body: const Center(child: Text('Body')),
menus: createTestMenus(
onActivate: onActivate,
onOpen: onOpen,
......@@ -63,6 +62,7 @@ void main() {
subSubMenu10[3]: const SingleActivator(LogicalKeyboardKey.keyD, meta: true),
},
),
child: const Center(child: Text('Body')),
),
),
),
......@@ -163,11 +163,11 @@ void main() {
const MaterialApp(
home: Material(
child: PlatformMenuBar(
body: PlatformMenuBar(
body: SizedBox(),
menus: <MenuItem>[],
child: PlatformMenuBar(
menus: <MenuItem>[],
child: SizedBox(),
),
menus: <MenuItem>[],
),
),
),
......@@ -180,8 +180,8 @@ void main() {
shortcut: SingleActivator(LogicalKeyboardKey.keyA),
);
const PlatformMenuBar menuBar = PlatformMenuBar(
body: SizedBox(),
menus: <MenuItem>[item],
child: SizedBox(),
);
await tester.pumpWidget(
......@@ -197,7 +197,7 @@ void main() {
menuBar.toStringDeep(),
equalsIgnoringHashCodes(
'PlatformMenuBar#00000\n'
' └─PlatformMenuItem#00000\n'
' └─PlatformMenuItem#00000(label2)\n'
' label: "label2"\n'
' shortcut: SingleActivator#00000(keys: Key A)\n'
' DISABLED\n',
......
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