From d4c975439c2aac3b675f8e5766c8667bee748063 Mon Sep 17 00:00:00 2001 From: Hehs Jesuh Date: Wed, 21 Jan 2026 23:41:10 +0300 Subject: [PATCH 1/5] fix: allow Dropdown to expand horizontally (#6044) --- packages/flet/lib/src/controls/dropdown.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/flet/lib/src/controls/dropdown.dart b/packages/flet/lib/src/controls/dropdown.dart index dc472f1d6..faa8bb809 100644 --- a/packages/flet/lib/src/controls/dropdown.dart +++ b/packages/flet/lib/src/controls/dropdown.dart @@ -10,6 +10,7 @@ import '../utils/buttons.dart'; import '../utils/colors.dart'; import '../utils/edge_insets.dart'; import '../utils/form_field.dart'; +import '../utils/layout.dart'; import '../utils/menu.dart'; import '../utils/numbers.dart'; import '../utils/text.dart'; @@ -291,6 +292,7 @@ class _DropdownControlState extends State { hintText: widget.control.getString("hint_text"), helperText: widget.control.getString("helper_text"), menuStyle: menuStyle, + expandedInsets: widget.control.getExpand("expand") == 1 ? EdgeInsets.zero : null, inputDecorationTheme: inputDecorationTheme, inputFormatters: inputFormatters.isEmpty ? null : inputFormatters, onSelected: widget.control.disabled From 7e44f6334d05f4fb421695406e83288083005ac8 Mon Sep 17 00:00:00 2001 From: Hehs Jesuh Date: Wed, 21 Jan 2026 23:41:25 +0300 Subject: [PATCH 2/5] fix: apply ButtonStyle in TextButton (#6047) --- packages/flet/lib/src/controls/button.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flet/lib/src/controls/button.dart b/packages/flet/lib/src/controls/button.dart index c154ec97e..cb53430ed 100644 --- a/packages/flet/lib/src/controls/button.dart +++ b/packages/flet/lib/src/controls/button.dart @@ -98,7 +98,7 @@ class _ButtonControlState extends State with FletStoreMixin { var theme = Theme.of(context); var style = parseButtonStyle( - widget.control.internals?["style"], + widget.control.properties["style"], theme, defaultForegroundColor: widget.control.getColor("color", context, theme.colorScheme.primary)!, From 5e894d2ed24bd08813b06267624913bd063e7eb6 Mon Sep 17 00:00:00 2001 From: Hehs Jesuh Date: Thu, 22 Jan 2026 14:15:40 +0300 Subject: [PATCH 3/5] fix: TextButton style handling; allow Dropdown to expand horizontally --- packages/flet/lib/src/controls/button.dart | 2 +- packages/flet/lib/src/controls/dropdown.dart | 7 ++++++- .../flet/src/flet/controls/material/text_button.py | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/flet/lib/src/controls/button.dart b/packages/flet/lib/src/controls/button.dart index cb53430ed..c154ec97e 100644 --- a/packages/flet/lib/src/controls/button.dart +++ b/packages/flet/lib/src/controls/button.dart @@ -98,7 +98,7 @@ class _ButtonControlState extends State with FletStoreMixin { var theme = Theme.of(context); var style = parseButtonStyle( - widget.control.properties["style"], + widget.control.internals?["style"], theme, defaultForegroundColor: widget.control.getColor("color", context, theme.colorScheme.primary)!, diff --git a/packages/flet/lib/src/controls/dropdown.dart b/packages/flet/lib/src/controls/dropdown.dart index faa8bb809..61ef882e8 100644 --- a/packages/flet/lib/src/controls/dropdown.dart +++ b/packages/flet/lib/src/controls/dropdown.dart @@ -271,6 +271,11 @@ class _DropdownControlState extends State { _focusNode.canRequestFocus = editable; + int? expand = widget.control.getExpand("expand"); + EdgeInsets? expandedInsets = (expand ?? 0) > 0 + ? EdgeInsets.all((expand ?? 0).toDouble()) + : null; + Widget dropDown = DropdownMenu( enabled: !widget.control.disabled, focusNode: _focusNode, @@ -292,7 +297,7 @@ class _DropdownControlState extends State { hintText: widget.control.getString("hint_text"), helperText: widget.control.getString("helper_text"), menuStyle: menuStyle, - expandedInsets: widget.control.getExpand("expand") == 1 ? EdgeInsets.zero : null, + expandedInsets: expandedInsets, inputDecorationTheme: inputDecorationTheme, inputFormatters: inputFormatters.isEmpty ? null : inputFormatters, onSelected: widget.control.disabled diff --git a/sdk/python/packages/flet/src/flet/controls/material/text_button.py b/sdk/python/packages/flet/src/flet/controls/material/text_button.py index 89c9a7e39..50aad13aa 100644 --- a/sdk/python/packages/flet/src/flet/controls/material/text_button.py +++ b/sdk/python/packages/flet/src/flet/controls/material/text_button.py @@ -101,5 +101,10 @@ class TextButton(LayoutControl, AdaptiveControl): Called when this button has lost focus. """ + def before_update(self): + super().before_update() + if self.style is not None: + self._internals["style"] = self.style.copy() + async def focus(self): await self._invoke_method("focus") From e805b8094bd6158f6cc84f96cab6c378acdc00d5 Mon Sep 17 00:00:00 2001 From: Islam Asabaev <105982046+7576457@users.noreply.github.com> Date: Fri, 23 Jan 2026 01:55:00 -0800 Subject: [PATCH 4/5] fix(dropdown): correct expand logic Co-authored-by: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com> --- packages/flet/lib/src/controls/dropdown.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/flet/lib/src/controls/dropdown.dart b/packages/flet/lib/src/controls/dropdown.dart index 61ef882e8..abaa6511a 100644 --- a/packages/flet/lib/src/controls/dropdown.dart +++ b/packages/flet/lib/src/controls/dropdown.dart @@ -271,10 +271,8 @@ class _DropdownControlState extends State { _focusNode.canRequestFocus = editable; - int? expand = widget.control.getExpand("expand"); - EdgeInsets? expandedInsets = (expand ?? 0) > 0 - ? EdgeInsets.all((expand ?? 0).toDouble()) - : null; + int expand = widget.control.getExpand("expand", 0)!; + EdgeInsets? expandedInsets = expand > 0 ? EdgeInsets.zero : null; Widget dropDown = DropdownMenu( enabled: !widget.control.disabled, From ea8ce80ade84be05887ff611ee4cf6922d23f2c7 Mon Sep 17 00:00:00 2001 From: Hehs Jesuh Date: Fri, 23 Jan 2026 13:01:36 +0300 Subject: [PATCH 5/5] fix(button): correctly resolve merged style without _internals --- packages/flet/lib/src/controls/button.dart | 2 +- .../packages/flet/src/flet/controls/material/text_button.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/flet/lib/src/controls/button.dart b/packages/flet/lib/src/controls/button.dart index c154ec97e..3d2b276ad 100644 --- a/packages/flet/lib/src/controls/button.dart +++ b/packages/flet/lib/src/controls/button.dart @@ -98,7 +98,7 @@ class _ButtonControlState extends State with FletStoreMixin { var theme = Theme.of(context); var style = parseButtonStyle( - widget.control.internals?["style"], + widget.control.internals?["style"] ?? widget.control.get("style"), theme, defaultForegroundColor: widget.control.getColor("color", context, theme.colorScheme.primary)!, diff --git a/sdk/python/packages/flet/src/flet/controls/material/text_button.py b/sdk/python/packages/flet/src/flet/controls/material/text_button.py index 50aad13aa..89c9a7e39 100644 --- a/sdk/python/packages/flet/src/flet/controls/material/text_button.py +++ b/sdk/python/packages/flet/src/flet/controls/material/text_button.py @@ -101,10 +101,5 @@ class TextButton(LayoutControl, AdaptiveControl): Called when this button has lost focus. """ - def before_update(self): - super().before_update() - if self.style is not None: - self._internals["style"] = self.style.copy() - async def focus(self): await self._invoke_method("focus")