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.