File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
packages/dropdown_button2 Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1919- Respect inputDecoration's borderRadius when barrierCoversButton is false.
2020- Support BorderRadiusDirectional for dropdown menu.
2121- Fix barrier when using TextDirection.rtl while barrierCoversButton set to false.
22+ - Take InputDecoration's densityOffset into account when determining the button size.
2223
2324## 3.0.0-beta.21
2425
Original file line number Diff line number Diff line change @@ -570,8 +570,11 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>> with WidgetsBin
570570 // Return the contentPadding only if inputDecoration is defined.
571571 if (widget._inputDecoration case final decoration? ) {
572572 final TextDirection ? textDirection = Directionality .maybeOf (context);
573+ // Use inputDecorationTheme.visualDensity when added (https://github.com/flutter/flutter/issues/166201#issuecomment-2774622584)
574+ final Offset densityOffset = Theme .of (context).visualDensity.baseSizeAdjustment;
573575 return (decoration.contentPadding ?? Theme .of (context).inputDecorationTheme.contentPadding)
574- ? .resolve (textDirection);
576+ ? .add (EdgeInsets .symmetric (vertical: densityOffset.dy / 2 ))
577+ .resolve (textDirection);
575578 } else {
576579 return null ;
577580 }
You can’t perform that action at this time.
0 commit comments