LeoColman / Petals

🌻 The Open Source app Petals aims to help its users to either quit weed, reduce usage or simply know how much they're using.
GNU Affero General Public License v3.0
82 stars 32 forks source link

✨ Add a Day/Night switch that doesn't depend on the System Theme #608

Closed gBL17 closed 3 months ago

gBL17 commented 3 months ago
  1. Added a Flow in the DataStore to keep track of whether dark mode is on or off.
  2. Created a function to set the status of Dark Mode in the DataStore.
  3. Implemented changes in MaterialTheme to decide the color palette based on the status of Dark Mode.
  4. Added an icon in the AppBar that toggles Dark Mode on and off.
  5. Provided a functionality to detect the system's theme settings, and use it as a fallback when the user has not explicitly chosen a theme.