of static method

FormController? of(
  1. BuildContext context, {
  2. bool listen = false,
  3. bool nullOk = false,
})

Implementation

static FormController? of(BuildContext context,
    {bool listen = false, bool nullOk = false}) {
  FormController getter() => Provider.of(context, listen: listen);
  try {
    return getter();
  } catch (e) {
    if (!nullOk) {
      rethrow;
    } else {
      return null;
    }
  }
}