'theme style not working on other screens and dialogs KIVY - KIVYMD

I created a button that changes the color of the application. In the main screen it works totally fine, however it does not change the color of the theme in the dialogs and in the other screens. I dont know if I need to change the color of theme manually in each screen (using screen manager) or in the dialagos I create.

Here is my code

class MainMenu(Screen):
   def build(self):
       self.theme_cls.primary_palette = "Cyan"
       self.theme_cls.accent_palette = "Indigo"  # Lime
       self.theme_cls.theme_style = "Light"

       sm.add_widget(SignInScreen(name='sign_in_screen'))
       sm.add_widget(MainMenu(name='main_menu'))
       sm.add_widget(TermsConditionsScreen(name='terms_conditions_screen'))
       sm.add_widget(MyInformation(name='my_information'))

       return sm

   def color_changer(self):
       if self.theme_cls.theme_style == "Dark":
           self.theme_cls.theme_style = "Light"
           self.theme_cls.primary_palette = "Cyan"
           self.theme_cls.accent_palette = "Indigo"
       elif self.theme_cls.theme_style == "Light":
           self.theme_cls.theme_style = "Dark"
           self.theme_cls.primary_palette = "DeepPurple"
           self.theme_cls.accent_palette = "Teal"

Here are some screenshots of my problem (In the last picture, the color of the text is white)

enter image description here enter image description here enter image description here enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source