If hideColorSchemeToggle is true, darkModeToggle will not be rendered and adding a listener to a non-existing object will cause error.