of static method

_RoutebornBranchParamsState of(
  1. BuildContext context
)

Gets the _RoutebornBranchParamsState to acquire the page params. NOTICE: call this from a context in the given branch.

Implementation

static _RoutebornBranchParamsState of(BuildContext context) {
  final state =
      context.findAncestorStateOfType<_RoutebornBranchParamsState>();

  assert(() {
    if (state == null) {
      throw NavigationStackError(
        'RoutebornBranchParamsState could not be found '
        'in the given context\'s widget tree.',
      );
    }
    return true;
  }());

  return state!;
}