CCExtractor / CCExtractor/ultimate_alarm_clock

Broken Dark Mode Toggle (The State Management Leak)

Open
#945 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
112
Forks
227
PR merge metrics
No merged PRs in 30d

Description

### Description
In `hover_preset_button.dart`, the background color is assigned using a reactive GetX variable (`themeController.primaryColor.value`). However, the widget itself is not wrapped in an `Obx` stream observer.

Because of this state management leak, if the user switches the app's theme from Light Mode to Dark Mode (or vice versa), this specific button fails to rebuild. It remains stuck displaying the old theme's color palette, resulting in an unreadable UI glitch until the app is fully restarted.

### Steps to Reproduce
1. Navigate to the screen containing the `HoverPresetButton` (e.g., settings or alarm configuration).
2. Toggle the application theme from Light Mode to Dark Mode.
3. Observe that the rest of the UI updates, but the `HoverPresetButton` background color remains stuck on the Light Mode color.

### Expected Behavior
The button should reactively listen to theme changes and update its background color immediately without requiring an app restart.

### Proposed Solution
Wrap the widget returning the `themeController.primaryColor.value` inside an `Obx(() => ...)` widget so it actively listens to the theme controller's state changes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.