Skip to content

bug: [v1] Size animation not working #5766

@oussama-gourari

Description

@oussama-gourari

Duplicate Check

Describe the bug

Specifying the animate_size on a container seems to have no effect.

Code sample

Code
import flet as ft


class AnimatedHeightContainer(ft.Container):

    def __init__(self) -> None:
        super().__init__(
            content=ft.Container(bgcolor=ft.Colors.GREEN, height=200, width=200),
            animate_size=ft.Animation(duration=ft.Duration(milliseconds=2000)),
        )

    def reveal(self) -> None:
        self.height = None
        self.update()

    def hide(self) -> None:
        self.height = 0
        self.update()


def main(page):
    c = AnimatedHeightContainer()
    page.add(
        c,
        ft.Button("Hide", on_click=c.hide),
        ft.Button("Reveal", on_click=c.reveal),
    )


ft.run(main=main)

To reproduce

Run the code above, the container can be hidden and revealed using the buttons, but with no animation.

Expected behavior

No response

Screenshots / Videos

Operating System

Linux

Operating system details

Linux 6.12.48-1-MANJARO - GNOME 48.5

Flet version

0.70.0.dev6491

Regression

I'm not sure / I don't know

Suggestions

No response

Logs

Additional details

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions