Skip to content

DropdownButtonFormField arrow icon is misaligned vertically #157074

@Reprevise

Description

@Reprevise

Steps to reproduce

  1. Run sample
  2. Observe dropdown icon is aligned to where the content would be instead of the field as a whole

Expected results

The dropdown icon should be vertically centered within the form field.

Actual results

The dropdown icon is centered vertically relative to the selected content.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Center(
              child: SizedBox(
                width: 200,
                child: DropdownButtonFormField<String>(
                  onChanged: (_) {},
                  decoration: InputDecoration(
                    labelText: 'Label text',
                  ),
                  items: [
                    DropdownMenuItem(
                      value: 'selected',
                      child: Text('Selected item'),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

Flutter:
image

M3 Design:
Material 3 dropdown phases design

Logs

N/A

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.27.0-1.0.pre.87, on Microsoft Windows [Version 10.0.22631.4317], locale en-US)
    ! Flutter version 3.27.0-1.0.pre.87 on channel [user-branch] at C:\Users\bscho\.puro\envs\master\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Warning: `flutter` on your path resolves to C:\Users\bscho\.puro\envs\stable\flutter\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\bscho\.puro\envs\master\flutter. Consider adding       
      C:\Users\bscho\.puro\envs\master\flutter\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\bscho\.puro\envs\stable\flutter\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\bscho\.puro\envs\master\flutter. Consider adding
      C:\Users\bscho\.puro\envs\master\flutter\bin to the front of your path.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 9bb056822e (62 minutes ago), 2024-10-16 22:52:18 -0400
    • Engine revision e2188ee9ab
    • Dart version 3.6.0 (build 3.6.0-334.2.beta)
    • DevTools version 2.40.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\bscho\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.11.35312.102
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • 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.9+0--11185874)

[√] Android Studio (version 2022.3)
    • 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
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.94.2)
    • VS Code at C:\Users\bscho\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.98.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22631.4317]
    • Chrome (web)      • chrome  • web-javascript • unknown
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 129.0.2792.89

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterf: material designflutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions