Is your feature request related to a problem?
The SettingsStore skeleton class exists in packages/storage_kit/lib/settings/settings_store.dart but needs full implementation to provide a high-level API for app settings management with reactive updates, type-safe access, and default values.
Describe the solution you'd like
Implement a fully functional SettingsStore service that manages app settings using KeyValueStore, provides reactive streams for setting changes, type-safe accessors, default values, and validation.
What is SettingsStore and why do we need it?
SettingsStore is a high-level service for managing app settings with type-safe access, default values, change notifications, and validation, built on top of KeyValueStore.
Why it's important:
- Type Safety: Strongly-typed settings instead of string keys
- Defaults: Automatic fallback to default values
- Reactive: Widgets rebuild when settings change
- Validation: Ensures valid setting values
- Centralized: All app settings in one place
Common use cases:
- Theme mode setting (light/dark/system)
- Language/locale preference
- Notification preferences
- Privacy settings
- Accessibility settings
- Feature toggles
Required Deliverables
-
SettingsStore implementation with:
- Theme mode getter/setter
- Locale preference getter/setter
- Notification enabled getter/setter
- Custom settings getter/setter
- Default values
- Settings change stream
- Reset to defaults method
- Integration with KeyValueStore
- Type-safe API
-
Widgetbook stories (6-8 use cases):
- Get theme mode setting
- Set theme mode setting
- Get locale setting
- Set notification preference
- Settings change stream
- Reset to defaults
- Custom settings
- Settings inspector UI
-
SPDX headers in all source files
Key Implementation Specs
- Use KeyValueStore for persistence
- ThemeMode get themeMode
- Future setThemeMode(ThemeMode)
- Locale get locale
- Future setLocale(Locale)
- bool get notificationsEnabled
- Future setNotificationsEnabled(bool)
- Stream settingsStream
- resetToDefaults() method
- Default values as static const
- Singleton pattern recommended
Acceptance Criteria
Related Files
packages/storage_kit/lib/settings/settings_store.dart (skeleton)
packages/storage_kit/lib/key_value/key_value_store.dart (storage backend)
widgetbook_kit/lib/stories/storage_kit/settings_store_story.dart (Widgetbook)
Impact: Centralizes app settings; improves settings management UX
Priority: High
Is your feature request related to a problem?
The
SettingsStoreskeleton class exists inpackages/storage_kit/lib/settings/settings_store.dartbut needs full implementation to provide a high-level API for app settings management with reactive updates, type-safe access, and default values.Describe the solution you'd like
Implement a fully functional
SettingsStoreservice that manages app settings using KeyValueStore, provides reactive streams for setting changes, type-safe accessors, default values, and validation.What is SettingsStore and why do we need it?
SettingsStore is a high-level service for managing app settings with type-safe access, default values, change notifications, and validation, built on top of KeyValueStore.
Why it's important:
Common use cases:
Required Deliverables
SettingsStore implementation with:
Widgetbook stories (6-8 use cases):
SPDX headers in all source files
Key Implementation Specs
Acceptance Criteria
Related Files
packages/storage_kit/lib/settings/settings_store.dart(skeleton)packages/storage_kit/lib/key_value/key_value_store.dart(storage backend)widgetbook_kit/lib/stories/storage_kit/settings_store_story.dart(Widgetbook)Impact: Centralizes app settings; improves settings management UX
Priority: High