Repository: flutter
Issue: Popup menu shown at wrong position
Labels: framework,f: material design,a: quality,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.io/
      * https://docs.flutter.io/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first:  https://flutter.io/bug-reports/
-->

## Steps to Reproduce

<!--
     Please tell us exactly how to reproduce the problem you are running into.

     Please attach a small application (ideally just one main.dart file) that
     reproduces the problem. You could use https://gist.github.com/ for this.

     If the problem is with your application's rendering, then please attach
     a screenshot and explain what the problem is.
-->
Please use this [code](https://gist.github.com/HubertZhang/7b2d20a062a80fc172ba2dc7200e91be) as main.dart

1. Run
2. The origin flutter SDK would give 
![origin](https://user-images.githubusercontent.com/5479962/54489149-578b4880-48e4-11e9-8c20-54a44071a9bc.gif)
where popup menu is expanded at a low position
3. Change <FLUTTER_SDK_ROOT>/packages/flutter/lib/src/material/popup_menu.dart:538
```
    double y;
    if (selectedItemOffset == null) {
      y = position.top;
    } else {
---      y = position.top + (size.height - position.top - position.bottom) / 2.0 - selectedItemOffset;
+++      y = position.top - selectedItemOffset;
    }
```
would give right result

![expected_popup](https://user-images.githubusercontent.com/5479962/54489204-e4360680-48e4-11e9-9f1b-1f9d7d2638cc.gif)

## Logs
No log needed

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->
flutter analyze result

```
Analyzing demo...                                                          
No issues found! (ran in 1.3s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->
flutter doctor result
```
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale zh-Hans-CN)
    • Flutter version 1.2.1 at /Users/Hubert/Development/flutter
    • Framework revision 8661d8aecd (4 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /usr/local/share/android-sdk/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /usr/local/share/android-sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
    • CocoaPods version 1.5.0

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.3.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2017.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.32.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • iPhone XR • 17B921C2-F5F5-4BD9-84E1-094CC9696E38 • ios • iOS 12.1 (simulator)

! Doctor found issues in 3 categories.
```