Skip to content

Container border-radius and border don't work if before_update method is used #3962

Description

@azhago

Duplicate Check

Describe the bug

If the before_update method is used, border-radius and border params for container don't work

Code sample

Code
import flet as ft

# 0.19: OK
# 0.21.2 and > : KO
class Test(ft.Container):
    def __init__(self):
        super().__init__()
        self.border_radius = 15
        self.width=100
        self.height = 100
        self.bgcolor=ft.colors.BLUE_100
        self.border=ft.border.all(3,ft.colors.BLUE_ACCENT_700)
        self.content=ft.Icon(name=ft.icons.ADD)

    def before_update(self):
        print("doing something before update")

def main(page:ft.Page):
    page.theme_mode = ft.ThemeMode.LIGHT
    page.add(Test())

if __name__ == "__main__":
    ft.app(target=main)

To reproduce

simply run the code and compare with flet 0.19 or less, or with before_update() commented

Expected behavior

No response

Screenshots / Videos

Captures Wrong:

Capture d'écran 2024-09-10 194524
Good:
Capture d'écran 2024-09-10 194618

Operating System

Windows

Operating system details

W11

Flet version

21.2 and >

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions