-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
- Run sample
- Open menus
Expected results
SubmenuButton and MenuItemButton should have the same vertical offset.
Actual results
First MenuItemButton is above Submenu button text. It appears to be an offset of 8px. This may be because the menu is supposed to have 8px vertical padding applied to each menu panel.
I would normally do a PR, but I wasn't sure if this would need to be handled using Material 3 tokens.
Code sample
Code sample
import 'package:flutter/material.dart';
void main() => runApp(const Bug());
class Bug extends StatelessWidget {
const Bug({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorSchemeSeed: Colors.blue,
brightness: Brightness.dark,
),
home: const BugApp(),
);
}
}
class BugApp extends StatefulWidget {
const BugApp({
super.key,
});
@override
State<BugApp> createState() => _BugAppState();
}
class _BugAppState extends State<BugApp> {
FocusNode focusNode = FocusNode();
@override
Widget build(BuildContext context) {
return Material(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
MenuBar(children: <Widget>[
SubmenuButton(menuChildren: <Widget>[
SubmenuButton(menuChildren: <Widget>[
MenuItemButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Colors.white.withOpacity(0.1)),
),
child: const Text('Item 1.1.1'),
onPressed: () {},
),
MenuItemButton(
child: const Text('Item 1.1.2'),
onPressed: () {},
),
MenuItemButton(
child: const Text('Item 1.1.3'),
onPressed: () {},
),
], child: const Text('Submenu 1.1')),
], child: const Text('Submenu 1')),
])
],
),
),
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Expected (from Angular Material):

With 8px vertical offset applied:

Logs
Logs
None applicableFlutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.23.0-14.0.pre.50, on macOS 14.0 23A344 darwin-arm64, locale en-US)
• Flutter version 3.23.0-14.0.pre.50 on channel master at /Users/davidhicks/fvm/versions/master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9a673175ab (4 days ago), 2024-06-27 09:42:21 +0200
• Engine revision a9194f0f01
• Dart version 3.5.0 (build 3.5.0-304.0.dev)
• DevTools version 2.36.0
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/davidhicks/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/davidhicks/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
[✓] VS Code (version 1.90.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.0 23A344 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.0 23A344 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 126.0.6478.127
! Error: Browsing on the local area network for David’s iPhone. Ensure the device is unlocked and attached with a cable or associated
with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
! Error: Browsing on the local area network for Holly’s iPad. Ensure the device is unlocked and attached with a cable or associated
with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
• No issues found!```
</details>Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.22Found to occur in 3.22Found to occur in 3.22found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
