Hello, I am developing an application. And I wanted the user to be able to choose between the light and dark theme. I know I need to use a database to make the theme permanent, even if the user closes the application. Has tinydb and sqlite, which would be better?
But my question is how I would make the chosen theme stay on all screens, especially when they have different components
Example I put all the texts in a color, how do I get that color on a different screen than the one I created the database?
In this case, you can store values in tinydb. Add the component in each screen using the same namespace. Than get the values using the same tag created in first screen.
Use this method, when screen initialize store a variable value to get tinydb tag value, and set component background color and if text is required then text color to according to theme…
The “configs” screen is responsible for choosing between themes
this block is on all screens, but it is part of “value if label does not exist”
and there is no “if” block
the first procedure it is a navigation button menu
This block checks, changes and saves the theme that the user chooses
when I start the “menu” screen which is the second screen (the first is a splash screen) this error occurs. Property setter was expecting a com.google.appinventor.components.runtime.TextBox component but got a Label instead.
when I start a screen that has some text boxes (I don’t know if this has anything to do with it, but I imported this screen from another application) these themes don’t change the colors of the screen, the rest works, and if I go back to the screen " menu "the application exits alone.
And when changing screens in the navigation menu, the theme doesn’t get the color as soon as it changes screens, there is a short space that shows the colors with the default theme and then changing to the chosen theme, does that really happen?