Change Color Checkbox when clicked

Guys help me please.

By clicking on the checkboxes the color changes as expected. But every time I leave the app or switch screens and come back, the color stays the original color. That is, the color of when I clicked does not remain.

blocks

I thank in advance to those who help me

Generally, to store information permanently, we use a database.
Check It And your logic.

1 Like

Hi, @Rogerio_Rios
Yes. I am using TinyDB.
Can I store colors in TinyDB?

Check your logic…
Where does it store?
When do you store?
When does the previous color change?
When do you use the stored color?

1 Like

But in the blocks above, it shows what I’m storing when clicked or not on TinyDB. Was to save

Well it looks like it’s working now.

I just removed that block and everything worked as expected.

1 Like

Saw ? It is a matter of analyzing your algorithm. Check if removing this block will cause any other problems.

1 Like

@Rogerio_Rios Thanks for the tip.
I already took a look here and everything works perfectly.

1 Like

I can’t understand what are you trying to code as it is in a different language but I think you have 2 colours and you want them to change with the click of a checkbox and you also want to store the value of colour so that it remains same. To do this you can use a tiny DB component…

when screen init…
If TinyDB get value = color1
then set colour to your colour
else another colour…

1 Like