File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
packages/dropdown_button2/lib/src Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -572,9 +572,13 @@ class _DropdownButton2State<T> extends State<DropdownButton2<T>> with WidgetsBin
572572 final TextDirection ? textDirection = Directionality .maybeOf (context);
573573 // Use inputDecorationTheme.visualDensity when added (https://github.com/flutter/flutter/issues/166201#issuecomment-2774622584)
574574 final Offset densityOffset = Theme .of (context).visualDensity.baseSizeAdjustment;
575- return (decoration.contentPadding ?? Theme .of (context).inputDecorationTheme.contentPadding)
576- ? .add (EdgeInsets .symmetric (vertical: densityOffset.dy / 2 ))
577- .resolve (textDirection);
575+ final EdgeInsets ? contentPadding =
576+ (decoration.contentPadding ?? Theme .of (context).inputDecorationTheme.contentPadding)
577+ ? .resolve (textDirection);
578+ return contentPadding? .copyWith (
579+ top: math.max (0 , contentPadding.top + densityOffset.dy / 2 ),
580+ bottom: math.max (0 , contentPadding.bottom + densityOffset.dy / 2 ),
581+ );
578582 } else {
579583 return null ;
580584 }
You can’t perform that action at this time.
0 commit comments