Switch your app to darkmode

Is there a way to enable darkmode on my app with a button. My app is white now but would like to set the background to black and text to white based on button press.

If you already have the button, you can do this:


then, you can change the color to get it right.