of static method

LoginFormController of(
  1. BuildContext context, {
  2. bool nullOk = false,
})

Implementation

static LoginFormController of(BuildContext context, {bool nullOk = false}) {
  final LoginForm? result =
      context.findAncestorWidgetOfExactType<LoginForm>();
  if (nullOk || result != null) return result!.controller;
  throw FlutterError.fromParts(<DiagnosticsNode>[
    ErrorSummary(
        'LoginForm.of() called with a context that does not contain an LoginForm.'),
    ErrorDescription(
        'No LoginForm ancestor could be found starting from the context that was passed to LoginForm.of().'),
    context.describeElement('The context used was')
  ]);
}