getRegistry method Null safety
Implementation
ComponentRegistry getRegistry() {
var widget = dependOnInheritedWidgetOfExactType<InheritedRegistry>();
if (widget == null) {
throw FlutterError(
'You cannot find a componentRegistry in your context '
'if none were ever provided',
);
}
return widget.componentRegistry;
}