-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Closed
Labels
c: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.3Found to occur in 2.3Found to occur in 2.3frameworkflutter/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 versionwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Steps to Reproduce
Run the following code and press popup menu button (three dots on header right).
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'PopupMenuButton misplacement',
theme: ThemeData(primarySwatch: Colors.blue),
builder: (BuildContext context, Widget? child) {
final MediaQueryData m = MediaQuery.of(context);
var horzOffset = m.size.width / 4;
var d = m.copyWith(padding: EdgeInsets.fromLTRB(horzOffset, m.padding.top, horzOffset, m.padding.bottom));
return MediaQuery(
data: d,
child: Navigator(
pages: [
MaterialPage(
key: ValueKey('Page1'),
child: SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('PopupMenuButton misplacement'),
actions: [
PopupMenuButton<int>(
itemBuilder: (context) => [
PopupMenuItem<int>(
value: 0,
child: ListTile(
leading: Icon(Icons.settings),
title: Text('Settings'),
contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
dense: true,
),
),
]),
],
),
body: Center(),
),
),
)
],
onPopPage: (route, result) => route.didPop(result),
),
);
});
}
}On Web (render HTML):
On Web (render CanvasKit):
On Android:
Expected results:
Popup menu with one item named Settings.
flutter doctor -v
[√] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.0 at c:\Programs\flutter
• Framework revision b22742018b (4 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\slavap\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = C:\Users\slavap\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• CHROME_EXECUTABLE = c:\Programs\chrome-debug.bat
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• 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 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.56.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.22.0
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
• No issues found!
bernaferrari and pablodz
Metadata
Metadata
Assignees
Labels
c: regressionIt was better in the past than it is nowIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2Found to occur in 2.2found in release: 2.3Found to occur in 2.3Found to occur in 2.3frameworkflutter/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 versionwaiting for PR to land (fixed)A fix is in flightA fix is in flight


