currentBindings property
Iterable<CurrentViewModelBinding>
get
currentBindings
Provides a list of helper bindings that should attach after the view model has assigned itself to all currentProps.
This is useful for helper types that depend on CurrentProperty.viewModel being available before they can subscribe to state changes or emit their own metadata events.
This remains the low-level generic extension point for attachable helper objects. Validation no longer requires overriding this getter in the common path because validators can register themselves directly on the property they validate.
Example
class AnalyticsBinding implements CurrentViewModelBinding {
bool attached = false;
@override
void attachToViewModel() {
attached = true;
}
}
class DashboardViewModel extends CurrentViewModel {
final title = CurrentStringProperty('Home', propertyName: 'title');
final analyticsBinding = AnalyticsBinding();
@override
Iterable<CurrentProperty> get currentProps => [title];
@override
Iterable<CurrentViewModelBinding> get currentBindings => [
analyticsBinding,
];
}
Implementation
Iterable<CurrentViewModelBinding> get currentBindings => const [];