How to apply linear gradient on a container. #937
-
|
Hi @ndonkoHenri Is there a way to apply a linear gradient to a container, I tried using ft.LinearGradient() but nothing is displayed, here is the code : Plus this is what I am trying to achieve : |
Beta Was this translation helpful? Give feedback.
Answered by
ndonkoHenri
Jan 28, 2023
Replies: 1 comment 1 reply
-
|
ft.Container(
height=610, width=700,
border_radius=100,
gradient=ft.LinearGradient(
colors=[ft.colors.BLUE, ft.colors.CYAN],
stops=[100.5, 100.00]
)
) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Haadi-A
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


bgcolortakes only strings. You have to use thegradientproperty of thecontainer. See docs here: https://flet.dev/docs/controls/container#gradientSo, modify your code as follows: