Skip to content

Navigation & routes

OmegaNavigator registers OmegaRoute entries and listens on the channel (via OmegaFlowManager.wireNavigator) for:

  • navigation.intent with an OmegaIntent payload, or
  • navigate.<id> / navigate.push.<id> event names (converted to intents).

Assign navigatorKey: runtime.navigator.navigatorKey on MaterialApp.


Platform transitions

OmegaNavigator picks Material routes on Android (and web/desktop) and Cupertino routes on iOS (native slide + edge swipe-back), so push / pushReplacement feel native on each mobile platform.


PatternNavigator behaviour
navigate.loginReplace current route (e.g. login as root — user should not “back” into a stale screen).
navigate.push.detailPush a new route so Navigator.pop returns to the previous screen.

Intent payloads become RouteSettings.arguments. Prefer OmegaRoute.typed (API) or routeArguments so pages do not cast by hand.


Route ids and wires

OmegaRoute(id: 'login') pairs with AppIntent members whose wire is navigate.login (via OmegaIntentNameDottedCamel). A mismatch between id and wire is a frequent first bug — omega validate checks common cases when your setup references navigateLogin, navigateHome, navigateRoot, etc.


Cold start

initialNavigationIntent in OmegaConfig must align with OmegaScope.initialNavigationIntent and OmegaInitialRoute so the first frame opens the correct screen. See omega_setup.dart.


Full example

example/lib/omega/omega_setup.dart (routes) + auth_flow.dart (navigation emits) + auth_page.dart (UI).


Next