Repository: flet-dev/flet
Issue category: Bug Report

Issue:
user customized style for SegmentedButton not wrapped
### Duplicate Check

- [X] I have searched the [opened issues](https://github.com/flet-dev/flet/issues) and there are no duplicates

### Describe the bug

user cutomized style is not working in SegmentButton
![image](https://github.com/user-attachments/assets/7c5f6f9c-9c29-43b5-a4d4-87f52d0d420d)


### Code sample

<details open><summary>Code</summary>

```python
import flet as ft


def main(page: ft.Page):
    page.window.width = 800
    page.window.height = 500
    page.window.alignment = ft.alignment.center

    def handle_change(e):
        print("on_change data : " + str(e.data))

    def on_error(e) -> None:
        print("error: ", e.data)

    page.on_error = on_error

    style = ft.ButtonStyle(shape=ft.RoundedRectangleBorder(radius=5))
    page.add(
        ft.SegmentedButton(
            on_change=handle_change,
            selected_icon=ft.Icon(ft.icons.ONETWOTHREE),
            selected={"1", "4"},
            allow_multiple_selection=True,
            style=style,
            segments=[
                ft.Segment(
                    value="1",
                    label=ft.Text("1"),
                    icon=ft.Icon(ft.icons.LOOKS_ONE),
                ),
                ft.Segment(
                    value="2",
                    label=ft.Text("2"),
                    icon=ft.Icon(ft.icons.LOOKS_TWO),
                ),
                ft.Segment(
                    value="3",
                    label=ft.Text("3"),
                    icon=ft.Icon(ft.icons.LOOKS_3),
                ),
                ft.Segment(
                    value="4",
                    label=ft.Text("4"),
                    icon=ft.Icon(ft.icons.LOOKS_4),
                ),
            ],
        )
    )


ft.app(main)

```

</details>


### To reproduce

pass customized style to SegmentedButton (style has customized attribute value, e.g. `style = ft.ButtonStyle(shape=ft.RoundedRectangleBorder(radius=5))`)

### Expected behavior

SegmentedButton has RoundedRectangleBorder

### Screenshots / Videos

<details open>
<summary>Captures</summary>

[Upload media here]
![Code_2eBKOg7ESB](https://github.com/user-attachments/assets/e8389abd-23e6-4328-89b4-0ebbb9ac0200)

</details>


### Operating System

Windows

### Operating system details

Windows 11 24H2

### Flet version

0.24.1

### Regression

No, it isn't

### Suggestions

_No response_

### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Additional details

_No response_


Hints:

Patch:
diff --git a/sdk/python/packages/flet/src/flet/core/segmented_button.py b/sdk/python/packages/flet/src/flet/core/segmented_button.py
index 01f303af6..7c1934834 100644
--- a/sdk/python/packages/flet/src/flet/core/segmented_button.py
+++ b/sdk/python/packages/flet/src/flet/core/segmented_button.py
@@ -203,12 +203,11 @@ def before_update(self):
         assert (
             len(self.selected) < 2 or self.allow_multiple_selection
         ), "allow_multiple_selection must be True for selected to have more than one item"
-        if self.__style is None:
-            self.__style = ButtonStyle()
-            self.__style.side = self._wrap_attr_dict(self.__style.side)
-            self.__style.shape = self._wrap_attr_dict(self.__style.shape)
-            self.__style.padding = self._wrap_attr_dict(self.__style.padding)
-        self._set_attr_json("style", self.__style)
+        style = self.__style or ButtonStyle()
+        style.side = self._wrap_attr_dict(style.side)
+        style.shape = self._wrap_attr_dict(style.shape)
+        style.padding = self._wrap_attr_dict(style.padding)
+        self._set_attr_json("style", style)
 
     def _get_children(self):
         for segment in self.segments:


Test patch: