toggleTheme

Toggles the current theme preference. If the current theme is dark, it changes to light, and vice versa. This method updates the internal _isDarkTheme StateFlow, which in turn notifies any observers of isDarkTheme.

In a more complete application, this function might also trigger saving the new theme preference to persistent storage (e.g., DataStore or SharedPreferences) so that the choice is remembered across app sessions.