Dark Mode Button

Access the mode from within an app using theme.setMode(ā€˜modeName’, persist: true) . This method makes it easy to change modes based on user interaction—for example, you can create a Switch component that toggles between light and dark mode. The persist parameter maintains the mode selection for a user's subsequent sessions.