vex_router 1.0.0
vex_router: ^1.0.0 copied to clipboard
The ultimate Flutter router. Navigation 2.0 done right — no code generation, no GetMaterialApp lock-in, full GetX controller binding support, type-safe routes, deep linking, guards, nested navigation, [...]
Changelog #
1.0.0 — 2025-05-30 #
🎉 Initial release #
Core
- Full Navigation 2.0 (
RouterDelegate+RouteInformationParser) VexRouter— root router, zero dependencies beyond Flutter SDKVexRoute— route definition with path params, guards, binding, transitionVexPage— customPage<T>backing every navigation entryVexRouteInfo— typed parameter carrier (path params, query params, extra)VexNavigatorScope—InheritedWidgetexposing navigator to widget tree
Navigation API
VexNavigator.of(context)— context-bound navigatorVexNavigator.root— global navigator, noBuildContextrequiredpush,replace,pushAndClearStack,pushAndRemoveUntilpop,popUntil,popToRoot,maybePop,canPoppushPath— navigate by raw URL string with auto param extractionshowDialog/showBottomSheet— route as overlay
Typed results
VexResult<T>sealed class —VexOk<T>,VexErr<T>,VexCancelled<T>.when(onOk, onErr, onCancelled)pattern matching.valueOrNull,.isOk,.isErr,.isCancelled
Guards
VexGuardabstract interfaceVexGuardAllow,VexGuardRedirect,VexGuardRedirectPath,VexGuardBlockVexAuthGuard— ready-to-use auth guard with excluded routes- Global guards (applied to all routes)
- Per-route guards (evaluated after global guards)
Controller Binding (GetX-compatible)
VexBindingabstract class —onInit/onDisposeVexInlineBinding— no-class inlineinit/disposeVexMultiBinding— compose multiple bindings, reversed dispose orderVexControllerScope—StatefulWidgetmanaging binding lifecycle- Works with GetX, Riverpod, Bloc, Provider, MobX — no hard dependency on any
Transitions (10 total)
material,cupertino,fade,scale,slideUp,slideLeft,slideRight,rotation,size,none,custom- Per-route
transitionoverride - Global
defaultTransitiononVexRouter - Custom
transitionBuildercallback
Shell navigation
VexShell— persistent scaffold withIndexedStacktab state preservationVexShellTab— per-tab root route, label, icon, activeIcon
Observer
VexObserver—onNavigate,onPop,onGuardBlocked,onRedirect,onDeepLinkVexNopObserver— no-op base
Extensions
BuildContextextensions:vexPush,vexPop,vexReplace,vexPushAndClear,vexPushPath,currentRouteStringextensions:vexPush,vexReplace,vexPushAndClear
Error handling
- Custom
errorBuilder— shown when a route's builder throws - Custom
notFoundBuilder— shown for unmatched URLs - Built-in default error and 404 screens
Other
- Deep link / URL sync via
PlatformRouteInformationProvider - Web URL bar sync
- Platform back button / Android back gesture support
fullscreenDialog,maintainState,opaqueper routerestorationIdfor state restorationpageTitlefor web document title- 40+ unit tests covering all public APIs