of<T extends BindableBase> static method
Returns a reference to a BindingWidget based on type.
This looks up the context for an ancestor that is a BindingWidget of the supplied type. If none are found, an ArgumentError is raised.
Implementation
static BindingWidget<T> of<T extends BindableBase>(BuildContext context) {
final BindingWidget<T>? bindingWidget =
context.findAncestorWidgetOfExactType<BindingWidget<T>>();
if (bindingWidget == null) {
throw ArgumentError('No BindingWidgets found for the specified type.');
}
return bindingWidget;
}