present method

Future<void> present(
  1. Object location
)

Implementation

Future<void> present(Object location) {
  return _enqueueNavigation<void>(() async {
    final targetLocation = _locationFrom(location);
    final transaction = _beginTransaction(
      source: LmNavigationSource.programmaticPush,
      to: targetLocation,
    );
    final guardResult = await _guardPipeline.evaluate(transaction);
    switch (guardResult) {
      case LmGuardAllowed(:final transaction):
        _emitGuardNavigationAllow(guardResult);
        return _presentAllowed(transaction.to);
      case LmGuardBlocked():
      case LmGuardRedirectLoop():
      case LmGuardStale():
      case LmGuardErrored():
        _emitGuardNavigationStop(guardResult);
        return const _NavigationOutcome<void>(null, Duration.zero);
    }
  });
}