-
Notifications
You must be signed in to change notification settings - Fork 62
Breaking changes
Tom Gilder edited this page May 6, 2021
·
4 revisions
Sorry for the large number of breaking changes in 0.8, this is to get the API in a stable state leading to a 1.0 release. There hopefully won't be any more now.
The onUnknownRoute
method signature has changed, and no longer provides a BuildContext
object.
If you need a context, you can get it from the routeBuilder
callback:
RoutemasterDelegate(routesBuilder: (BuildContext context) {
// Context is available here
})
onUnknownRoute: (String route, BuildContext context) {
return MaterialPage(child: NotFoundPage());
}
onUnknownRoute: (String route) {
return MaterialPage(child: NotFoundPage());
}
The path property on RouteData no longer returns the full path, including query string, to match Dart's Uri object. The full including query string is now available from the fullPath property.
routeData.path == '/route?query=string'
routeData.path == '/route'
routeData.fullPath == '/route?query=string'
Builder
now takes a builder
property instead of child
. This is to make sure the child
doesn't get built when the guard fails.
Guard(
validate: (info, context) => canShowPage(),
child: MaterialPage<void>(child: MyPage()),
)
Guard(
validate: (info, context) => canShowPage(),
builder: () => MaterialPage<void>(child: MyPage()),
)