of<T extends ViewModel> static method
Implementation
static T of<T extends ViewModel>(BuildContext context) {
final viewModel = context
.dependOnInheritedWidgetOfExactType<ViewModelProvider<T>>()
?.notifier;
assert(viewModel != null, "No appropriate ViewModel found in the context.");
return viewModel! as T;
}