diff --git a/packages/dropdown_button2/CHANGELOG.md b/packages/dropdown_button2/CHANGELOG.md index 072b233..4c1acaf 100644 --- a/packages/dropdown_button2/CHANGELOG.md +++ b/packages/dropdown_button2/CHANGELOG.md @@ -12,6 +12,7 @@ - Add `MenuItemStyleData.useDecorationHorizontalPadding`, used to determine whether to use the horizontal padding from "decoration.contentPadding" for menu items when using `DropdownButtonFormField2`. - Use decoration hint text as the default value for dropdown button hints [Flutter core]. - Update SDK constraints: ">=3.4.0 <4.0.0" +- Fix DropdownButtonFormField clips text when large text scale is used [Flutter core]. ## 3.0.0-beta.21 diff --git a/packages/dropdown_button2/lib/src/dropdown_button2.dart b/packages/dropdown_button2/lib/src/dropdown_button2.dart index 9d1c944..5b7779e 100644 --- a/packages/dropdown_button2/lib/src/dropdown_button2.dart +++ b/packages/dropdown_button2/lib/src/dropdown_button2.dart @@ -644,7 +644,9 @@ class _DropdownButton2State extends State> with WidgetsBin double get _denseButtonHeight { final double fontSize = _textStyle!.fontSize ?? Theme.of(context).textTheme.titleMedium!.fontSize!; - final double scaledFontSize = MediaQuery.textScalerOf(context).scale(fontSize); + final double lineHeight = + _textStyle!.height ?? Theme.of(context).textTheme.titleMedium!.height ?? 1.0; + final double scaledFontSize = MediaQuery.textScalerOf(context).scale(fontSize * lineHeight); return math.max(scaledFontSize, math.max(_iconStyle.iconSize, _kDenseButtonHeight)); }