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
- I read the Contributor Guide and followed the process outlined there for submitting PRs.
- I read the Tree Hygiene wiki page, which explains my responsibilities.
- I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
- I signed the CLA.
- I listed at least one issue that this PR fixes in the description above.
- I updated/added relevant documentation (doc comments with
///). - I added new tests to check the change I am making, or this PR is test-exempt.
- I followed the breaking change policy and added Data Driven Fixes where supported.
- All existing and new tests are passing.
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.