maybeOf<M extends Object> static method

M? maybeOf<M extends Object>(
  1. BuildContext context, {
  2. required bool listen,
})
override

The model of the nearest ScopeModel<M>, or null if there is none.

Implementation

static M? maybeOf<M extends Object>(
  BuildContext context, {
  required bool listen,
}) =>
    ScopeContext.maybeOf<ScopeModel<M>, ScopeModelContext<ScopeModel<M>, M>>(
      context,
      listen: listen,
    )?.model;