of static method

ReservationForm? of(
  1. BuildContext context, {
  2. bool listen = true,
})

Implementation

static ReservationForm? of(
  BuildContext context, {
  bool listen = true,
}) {
  if (listen) {
    return context
        .dependOnInheritedWidgetOfExactType<
            ReservationFormInheritedStreamer>()
        ?.form;
  }

  final element = context.getElementForInheritedWidgetOfExactType<
      ReservationFormInheritedStreamer>();
  return element == null
      ? null
      : (element.widget as ReservationFormInheritedStreamer).form;
}