Add scrollPadding property to DropdownMenu by ishaquehassan · Pull Request #183109 · flutter/flutter

Description

This change adds a scrollPadding property to DropdownMenu, forwarding it to the internal TextField widget.

DropdownMenu wraps a TextField internally but did not expose the scrollPadding parameter. Both TextField and SearchBar already provide this property, so DropdownMenu should forward it for consistency. The scrollPadding property controls the padding around the text field when it scrolls into view (e.g., when the keyboard appears), allowing developers to ensure the field remains visible with appropriate spacing.

The default value is EdgeInsets.all(20.0), matching TextField's default to preserve existing behavior.

This PR implements the analysis from my earlier comment on this issue.

Related Issues

Fixes #182890

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.