Skip to content

fix: wrap hover_preset_button in Obx for reactive theme updates#946

Open
vibhutomer wants to merge 1 commit intoCCExtractor:mainfrom
vibhutomer:fix-dark-mode-state
Open

fix: wrap hover_preset_button in Obx for reactive theme updates#946
vibhutomer wants to merge 1 commit intoCCExtractor:mainfrom
vibhutomer:fix-dark-mode-state

Conversation

@vibhutomer
Copy link
Copy Markdown
Contributor

Description

This PR addresses a UI state management leak in hover_preset_button.dart. Previously, the button's background color relied on a reactive GetX variable (themeController.primaryColor.value) but was not wrapped in an Obx observer. This caused the button to get "stuck" on the previous theme's color palette when a user switched between Light Mode and Dark Mode.

Proposed Changes

  • Wrapped the returned ElevatedButton inside hoverPresetButton with an Obx(() => ...) stream observer.
  • The button now properly listens to themeController state changes and reactively updates its UI the instant the theme is toggled.

Fixes #945

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken Dark Mode Toggle (The State Management Leak)

1 participant