Vyuh Property System
Dynamic Property Management
A type-safe property system for Dart applications. Define, observe, and bind dynamic properties with automatic change tracking and serialization.
Why Property System?
Observable Properties
Reactive properties with automatic change notification and subscriptions.
Type Safety
Full generic support with compile-time type checking.
Two-Way Binding
Seamless data binding between properties and UI widgets.
Computed Values
Derived properties that automatically update when dependencies change.
Quick Example
dart
// Define a property bag
class UserSettings extends PropertyBag {
late final Property<String> theme = property('theme', 'dark');
late final Property<int> fontSize = property('fontSize', 14);
late final Property<bool> notifications = property('notifications', true);
// Computed property
late final ComputedProperty<String> displayTheme = computed(
'displayTheme',
() => '${theme.value} mode (${fontSize.value}px)',
dependencies: [theme, fontSize],
);
}
// Usage
final settings = UserSettings();
// Subscribe to changes
settings.theme.listen((value) => print('Theme changed: $value'));
// Update value
settings.theme.value = 'light';
// Serialize to JSON
final json = settings.toJson();
// Bind to Flutter widget
PropertyBuilder<String>(
property: settings.theme,
builder: (context, theme) => Text('Current: $theme'),
);Property Types
StringText values
NumberInt, double, num
BooleanTrue/false flags
ListObservable lists
MapKey-value pairs
ComputedDerived values
Core Features
PersistenceAuto-save to SharedPreferences, Hive, or custom
Undo/RedoBuilt-in history tracking
Change TrackingKnow exactly what changed
Coming Soon
Comprehensive documentation is being developed. Check back soon for:
- Installation and setup guide
- Property definition patterns
- Flutter integration
- Persistence strategies
- Migration utilities