flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.59k stars 454 forks source link

ElevatedButton unable to update bgcolor property after upgrade to version >=0.24 #4119

Closed minh-wp closed 1 month ago

minh-wp commented 1 month ago

Duplicate Check

Describe the bug

ElevatedButton unable to update bgcolor property after upgrade to version >=0.24

Code sample

Code ```python [Paste your code here] ```

To reproduce

import flet as ft

def main(page: ft.Page):

test_button = ft.ElevatedButton(
        "Click to change color",
        icon="park_rounded",
        icon_color="green400",
        color=ft.colors.WHITE,
        bgcolor=ft.colors.BLUE_800,
    )

def on_click(e):
    if test_button.text == "red":
        test_button.text = "blue"
        test_button.bgcolor = ft.colors.BLUE_800
    else:
        test_button.text = "red"
        test_button.bgcolor = ft.colors.RED_800
    page.update()

test_button.on_click = on_click

page.add(test_button)

ft.app(main)

Expected behavior

should be able to change background color

Screenshots / Videos

Captures [Upload media here]

Operating System

Windows

Operating system details

Windows 11

Flet version

0.24

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response