From 7ea2d406f33d5a372ea9bfbbac949ac292530a4b Mon Sep 17 00:00:00 2001 From: michep <> Date: Sat, 8 Mar 2025 13:36:10 +0300 Subject: [PATCH] isDense for DropdownMenu --- packages/flet/lib/src/controls/dropdown.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/flet/lib/src/controls/dropdown.dart b/packages/flet/lib/src/controls/dropdown.dart index cb01b45bc..42f78e5a0 100644 --- a/packages/flet/lib/src/controls/dropdown.dart +++ b/packages/flet/lib/src/controls/dropdown.dart @@ -110,6 +110,7 @@ class _DropdownControlState extends State with FletStoreMixin { var borderWidth = widget.control.attrDouble("borderWidth"); var focusedBorderWidth = widget.control.attrDouble("focusedBorderWidth"); var menuWidth = widget.control.attrDouble("menuWidth") ?? double.infinity; + var isDense = widget.control.attrBool("dense") ?? false; FormFieldInputBorder inputBorder = parseFormFieldInputBorder( widget.control.attrString("border"), @@ -178,8 +179,10 @@ class _DropdownControlState extends State with FletStoreMixin { border: border, enabledBorder: border, focusedBorder: focusedBorder, - isDense: widget.control.attrBool("dense") ?? false, contentPadding: parseEdgeInsets(widget.control, "contentPadding"), + isDense: isDense, + isCollapsed: isDense, + constraints: isDense ? BoxConstraints.tight(const Size.fromHeight(24)) : null, ); TextStyle? textStyle =