of static method

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

Implementation

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

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