Skip to content

Why Does My Custom Control Start with a Deep Blue Color in My Flet App? #4749

Answered by ndonkoHenri
Ricman1029 asked this question in Q&A
Discussion options

You must be logged in to vote

Issue's origin

What happens is a switch from Flet's default theme color_scheme_seed (whose Colors.PRIMARY_CONTAINER is that blue-ish color we see at the start) to the color_scheme_seed=green defined in your code (whose Colors.PRIMARY_CONTAINER is the green-ish color).
This change is slowed down by your container's animation config (can be verified by setting the animation duration below to a bigger value):

self._container_animado = flet.Container(
  animate=flet.animation.Animation(duration=600, curve=flet.AnimationCurve.EASE),
  bgcolor=flet.Colors.PRIMARY_CONTAINER,
  ....
)

Solution

To make it more fast and spontaneous, I will suggest the following:

  • set duration=0 when creating the co…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Ricman1029
Comment options

Comment options

You must be logged in to vote
2 replies
@Ricman1029
Comment options

@ndonkoHenri
Comment options

Answer selected by Ricman1029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
3 participants