of static method

The nearest controller; asserts when no PrismForm is above.

Implementation

static PrismFormController of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<PrismFormScope>();
  assert(scope != null, 'PrismForm fields must be inside a PrismForm.');
  return scope!.notifier!;
}