- Fixes build warnings when using Flutter 3.0, thanks to @josephelliot-wk for the PR to fix this.
Important: this release has some major breaking changes with how Routemaster interacts with the system back button on Android and web from v0.9.
-
Minimum supported Flutter version is now 2.5.0.
-
Breaking change: by default, the Android system back button now navigates backwards chronologically, instead of just popping the navigation stack.
-
Breaking change: by default, tabs no longer add an entry to the web history stack. This means the browser back button will not navigate between tabs. To use the previous behavior, specify
backBehavior: TabBackBehavior.history
in the tab page's constructor. -
Added:
history
property onRoutemaster
for chronological history navigation, for exampleRoutemaster.of(context).history.back()
. -
Added:
popUntil
to pop multiple times with a predicate. -
Added:
TransitionPage
andTransitionBuilderPage
to make it much easier to customize page push and pop animations. -
Added: private routes - route segments that start with an underscore are not shown to the user. For example
/sign-up/_stepTwo
will be displayed as/sign-up
in the address bar, and the user can not navigate to it by URL. -
Added:
StackPage
for navigation stacks without indexed pages -
Added:
navigatorKey
property toRoutemasterDelegate
andPageStackNavigator
. Using aGlobalKey<NavigatorState>
can provide access to navigator functionality and the current context. -
Added: length property to PageStack to find out how many pages the stack will generate.
-
Added:
PageStackNavigator.builder
constructor for advanced scenarios to filter which pages are shown in the navigator. -
Fixed: an issue with getting
RouteData.of(context)
in some advanced circumstances. -
Fixed: when navigating to a relative route, uses the current context's path as the base, instead of the router's current path.
- Fixed: an issue where pages were incorrectly rebuilding, causing state such as the active tab to reset
- Fixed: you can now use the ternary operator in page builders without having to do extra casts
- Fixed: incorrect path reference in file (thanks to Thomas Frantz for PR)
- Fixed: navigating to an unknown page on startup could throw an exception
- Fixed: issue where
routesBuilder
could be called outside the build phase.
- Breaking change:
PageStackNavigator
no longer automatically provides aHeroController
- to use heroes, wrap the navigator in aHeroControllerScope
- Breaking change: refactored
PageWrapper
andStatefulPage
(this is unlikely to affect you) - Added a new property to get the current route:
Routemaster.of(context).currentRoute
- Added documentation to all classes, properties and methods
- Fixed:
RouteData.of(context)
sometimes throwing when navigating away from a page - Fixed: issue with rebuilding routes when
RoutemasterDelegate
is recreated - Fixed: widgets rebuilding when
RoutemasterDelegate
is recreated
- Breaking change:
Guard
properties have been renamed:validate
is nowcanNavigate
andonValidationFailed
is nowonNavigationFailed
- Breaking change: removed abstract
RouteConfig
class; to create custom routing maps, inherit fromRouteMap
- Deprecation:
StackNavigator
has been renamedPageStackNavigator
- Added
NotFound
return page type - Added ability to customise the top-level navigator with
RoutemasterDelegate.builder
- Added ability to use tabs with a custom page type
- Fixed
replace()
not working with hashes on web - Fixed path URL strategy not working when it's set outside Routemaster
- Fixed tabs creating a redirect loop on web
- Note: Use of
Guard
is no longer recommended - use standardif
statements andNotFound
orRedirect
- Fixed
pathTemplate
property onRouteData
- Fixed paths using backslashes on Windows
- Breaking change:
RouteData.path
no longer returns the full path with query string, to match Dart'sUri
object. UseRouteData.toString()
orRouteData.fullPath
for the entire path including query string. - Breaking change:
Guard
now takes abuilder
method instead of achild
property - Added support for return values via
pop('Result')
- Added support for getting the
Route
object when pushing a new path - Fixed an issue where subpages wouldn't push on top of a tab page
- Fixed an issue where query string values were lost after using the back button
- Support for absolute paths in tab child routes
- Fixed building against Flutter master branch
- Added
SafeArea
to default 404 page - Fixed an issue navigating with relative paths and query strings
- Fixed an issue where the controller didn't update when tab length changed
- Fixed an issue where the root navigator would rebuild unnecessarily
- Added more useful assert errors
- Added default body for
RoutemasterObserver.didChangeRoute
so you're not forced to override it
- Added support for
RoutemasterObserver
inRoutemasterDelegate
- Added support for
NavigatorObserver
inStackNavigator
- Renamed
tabController
tocontroller
- Bug fix for reusing stacks in multiple navigators
- Added
StackNavigator
to simplify API - Support for non-hash URLs on web -
Routemaster.setPathUrlStrategy()
- Support for hero animations in nested navigators
- Re-work guards and redirects to make API simpler
- API hopefully becoming stable
- More flexible and customisable router config
- Support for "404" pages via
onUnknownRoute
- Added Dashazon example, see
example/book_store/
- Hugely improved and totally refactored API
- Null safety
- Initial first version