of static method

Returns the nearest model up its widget tree.

If no model is founded, then null is returned.

Implementation

static ReactiveFormConfig? of(BuildContext context) {
  final element =
      context.getElementForInheritedWidgetOfExactType<ReactiveFormConfig>();

  return element != null ? (element.widget as ReactiveFormConfig) : null;
}