inhMaybeOf<T extends InheritedWidget> method

T? inhMaybeOf<T extends InheritedWidget>({
  1. bool listen = true,
})

Obtain the nearest widget of the given type T, which must be the type of a concrete InheritedWidget subclass, and register this build context with that widget such that when that widget changes (or a new widget of that type is introduced, or the widget goes away), this build context is rebuilt so that it can obtain new values from that widget.

Implementation

T? inhMaybeOf<T extends InheritedWidget>({bool listen = true}) => listen
    ? dependOnInheritedWidgetOfExactType<T>()
    : getInheritedWidgetOfExactType<T>();