of<T> static method
Implementation
static T of<T>(BuildContext context, {bool rebuild = false}) {
final inheritedElement =
context.getElementForInheritedWidgetOfExactType<Binder<T>>()
as BindElement<T>?;
if (inheritedElement == null) {
throw BindError(controller: '$T', tag: null);
}
if (rebuild) {
context.dependOnInheritedElement(inheritedElement);
}
final controller = inheritedElement.controller;
return controller;
}