Feature Request: Built-in Animation Widget for Automatic Animations on Load #5152
Replies: 5 comments
-
Animation is to be done manually. If you need it to happen immediately when the app gets shown, the add your control to the page and execute the animation. import time
import flet as ft
def main(page: ft.Page):
c = ft.Container(
width=150,
height=150,
bgcolor="blue",
border_radius=10,
animate_opacity=300,
)
def animate_opacity():
c.opacity = 0 if c.opacity == 1 else 1
c.update()
page.add(c)
time.sleep(0.4) # some little sleep inorder to see the effect
animate_opacity()
ft.app(main) If you have a Flutter example showcasing the idea you have, feel free to share. |
Beta Was this translation helpful? Give feedback.
-
its fine but its complex to create animate method and assign each object an attribute like scale,opacity etc... by using widget we can reduce complexity and code also |
Beta Was this translation helpful? Give feedback.
-
i cant implement it but you can i try an example with the help of Groak Ai #main.py
#test.py
|
Beta Was this translation helpful? Give feedback.
-
i need this type of functionality in flet means just have a animated widget which accepts some flet control @ndonkoHenri @InesaFitsner @FeodorFitsner |
Beta Was this translation helpful? Give feedback.
-
Check it out |
Beta Was this translation helpful? Give feedback.
-
Duplicate Check
Describe the requested feature
Currently, animations in Flet require manual triggering via a button click or calling a method explicitly. This makes automatic animations on screen load somewhat complex. I propose a new widget that automatically applies an animation to its child when it appears on the screen.
Suggest a solution
Introduce a widget like:
or a more generic:
This would allow animations to be applied automatically when a screen loads without needing extra logic.
Screenshots
No response
Additional details
Benefits
Simplifies automatic animations.
Reduces boilerplate code.
Makes animations more accessible to beginners.
Beta Was this translation helpful? Give feedback.
All reactions