of<T> static method

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

Implementation

static T of<T>(
  BuildContext context, {
  Object? group,
  bool useEntryGroup = true,
  int? position = 0,
}) {
  assert(() {
    position = position == null ? null : position! + 1;
    return true;
  }());

  final router = NRouter.of(context);
  return _GreenState.getLocal<T>(context, group, router, position) ??
      router.grass<T>(
          context: context,
          group: group,
          useEntryGroup: useEntryGroup,
          position: position);
}