maybeOf<T> static method

T? maybeOf<T>(
  1. BuildContext context, {
  2. Object? group,
  3. bool useNopGroup = true,
  4. int? position = 0,
})

Implementation

static T? maybeOf<T>(BuildContext context,
    {Object? group, bool useNopGroup = true, int? position = 0}) {
  assert(() {
    position = position == null ? null : position! + 1;
    return true;
  }());
  return _NopState.getLocal(context, group, position) ??
      _getFromRouteOrCurrent<T>(context,
          group: group, useNopGroup: useNopGroup, position: position);
}