Repository: flutter
Issue: Tapping on DropdownButtonFormField throws `menuLimits.top + menuLimits.height <= size.height is not true` and Menu items open at different location.
Labels: framework,f: material design,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-design,triaged-design

The error will occur when the DropdownButton is near the border of the browser.
You can see this video below.

https://user-images.githubusercontent.com/59549741/162422884-156788bc-fdfe-4894-8180-403dd8ac9743.mp4

Minimal code:
```
Widget tablePaging() {
  String value = "";
  List<String> list = [for (int i = 1; i <= 10; i++) (i * 10).toString()];
  List<DropdownMenuItem<String>> items = [
    for (String i in list) DropdownMenuItem(child: Text(i), value: i)
  ];

  if (!list.contains(value)) {
    value = list.first;
  }

  return Container(
    padding: PaddingStyle().allBasic,
    decoration: BoxDecoration(
        color: ColorStyle().second, borderRadius: BorderRadiusStyle().botBasic),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.end,
      children: [
        DropdownButtonFormField<String>(
              items: items,
              onChanged: (String? value) {
              },
            ),
      ],
    ),
  );
}
```

Error message:
```
======== Exception caught by rendering library =====================================================
The following assertion was thrown during performLayout():
Assertion failed: file:///C:/flutter/packages/flutter/lib/src/material/dropdown.dart:378:16
menuLimits.top + menuLimits.height <= size.height
is not true

The relevant error-causing widget was: 
  GetMaterialApp GetMaterialApp:file:///D:/Desktop/Project-programming/Flutter/KT%20eclaim/lib/main.dart:37:12
When the exception was thrown, this was the stack: 
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49  throw_
C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3    assertFailed
packages/flutter/src/material/dropdown.dart 378:58                                                                         <fn>
packages/flutter/src/material/dropdown.dart 380:14                                                                         getPositionForChild
packages/flutter/src/rendering/shifted_box.dart 1363:41                                                                    performLayout
packages/flutter/src/rendering/object.dart 1731:7                                                                          [_layoutWithoutResize]
packages/flutter/src/rendering/object.dart 887:17                                                                          flushLayout
packages/flutter/src/rendering/binding.dart 497:19                                                                         drawFrame
packages/flutter/src/widgets/binding.dart 883:13                                                                           drawFrame
packages/flutter/src/rendering/binding.dart 363:5                                                                          [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1144:15                                                                        [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1081:9                                                                         handleDrawFrame
packages/flutter/src/scheduler/binding.dart 995:5                                                                          [_handleDrawFrame]
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 1011:13           invoke
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 159:5             invokeOnDrawFrame
C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/initialization.dart 128:45                 <fn>
The following RenderObject was being processed when the exception was fired: RenderCustomSingleChildLayoutBox#e6f00 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...  needs compositing
...  parentData: offset=Offset(0.0, 0.0) (can use size)
...  constraints: BoxConstraints(w=806.0, h=706.0)
...  size: Size(806.0, 706.0)
RenderObject: RenderCustomSingleChildLayoutBox#e6f00 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
  needs compositing
  parentData: offset=Offset(0.0, 0.0) (can use size)
  constraints: BoxConstraints(w=806.0, h=706.0)
  size: Size(806.0, 706.0)
...  child: RenderAnimatedOpacity#e84cf relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
...    needs compositing
...    parentData: offset=Offset(0.0, 0.0) (can use size)
...    constraints: BoxConstraints(w=83.0, 0.0<=h<=610.0)
...    layer: OpacityLayer#ddf9d
...      engine layer: OpacityEngineLayer#0d859
...      handles: 2
...      offset: Offset(0.0, 0.0)
...      alpha: 19
...    size: Size(83.0, 496.0)
...    opacity: AnimationController#d344d(◀ 0.745; for _DropdownRoute<String>)➩ProxyAnimation➩Interval(0⋯0.25)/Interval(0.75⋯1)ₒₙ
...    child: RenderCustomPaint#6ccba relayoutBoundary=up2 NEEDS-PAINT
...      needs compositing
...      parentData: <none> (can use size)
...      constraints: BoxConstraints(w=83.0, 0.0<=h<=610.0)
...      size: Size(83.0, 496.0)
...      painter: _DropdownMenuPainter#3b1ca(AnimationController#d344d(◀ 0.745; for _DropdownRoute<String>)➩ProxyAnimation➩Interval(0.25⋯0.5)/Thresholdₒₙ)
...      child: RenderSemanticsAnnotations#091ae relayoutBoundary=up3 NEEDS-PAINT
...        needs compositing
...        parentData: <none> (can use size)
...        constraints: BoxConstraints(w=83.0, 0.0<=h<=610.0)
...        size: Size(83.0, 496.0)
...        child: RenderCustomPaint#cdd80 relayoutBoundary=up4 NEEDS-PAINT
...          needs compositing
...          parentData: <none> (can use size)
...          constraints: BoxConstraints(w=83.0, 0.0<=h<=610.0)
...          size: Size(83.0, 496.0)
...          painter: null
...          foregroundPainter: _ShapeBorderPainter#c6e38()
====================================================================================================
```


Flutter doctor:
```
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19044.1586], locale th-TH)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.66.0)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 1 category.
```