1.1 KiB
1.1 KiB
Task: Global Shake Settings
Goal: Make shakeCount and shakeOffset in ShakeWidget configurable via global settings, similar to attackAnimationScale.
Context
Currently, ShakeWidget uses hardcoded defaults or constructor parameters for shakeOffset and shakeCount. The user wants to adjust these values globally from the Settings screen to fine-tune the visual feedback.
Requirements
-
Settings Provider Updates:
- Add
shakeOffset(double, default 30.0). - Add
shakeCount(int, default 3). - Implement persistence using
SharedPreferences.
- Add
-
Settings UI:
- Add sliders to the Settings screen to control these values.
Shake Offset: Range approx 0-100?Shake Count: Range approx 1-10?
-
ShakeWidget Updates:
- Consume
SettingsProviderto get the global values. - Apply these values to the shake animation logic.
- Consume
Plan
- Modify
lib/providers/settings_provider.dartto add the new settings. - Modify
lib/screens/settings_screen.dartto add the sliders. - Modify
lib/widgets/battle/shake_widget.dartto use the provider.