diff --git a/lib/src/widgets/navi_rail/yaru_navigation_page.dart b/lib/src/widgets/navi_rail/yaru_navigation_page.dart index d78fc9a19..01e5583e0 100644 --- a/lib/src/widgets/navi_rail/yaru_navigation_page.dart +++ b/lib/src/widgets/navi_rail/yaru_navigation_page.dart @@ -27,8 +27,10 @@ class YaruNavigationPage extends StatefulWidget { this.controller, this.leading, this.trailing, - this.onGenerateRoute, this.navigatorKey, + this.initialRoute, + this.onGenerateRoute, + this.onUnknownRoute, }) : assert(initialIndex == null || controller == null), assert((length == null) != (controller == null)); @@ -62,11 +64,17 @@ class YaruNavigationPage extends StatefulWidget { /// The trailing widget in the rail that is placed below the destinations. final Widget? trailing; + /// A key to use when building the [Navigator] widget. + final GlobalKey? navigatorKey; + + /// The route name for the initial route. + final String? initialRoute; + /// Called to generate a route for a given [RouteSettings]. final RouteFactory? onGenerateRoute; - /// A key to use when building the [Navigator] widget. - final GlobalKey? navigatorKey; + /// Called when [onGenerateRoute] fails to generate a route. + final RouteFactory? onUnknownRoute; @override State createState() => _YaruNavigationPageState(); @@ -191,7 +199,9 @@ class _YaruNavigationPageState extends State { : widget.pageBuilder(context, 0), ), ], + initialRoute: widget.initialRoute, onGenerateRoute: widget.onGenerateRoute, + onUnknownRoute: widget.onUnknownRoute, onPopPage: (route, result) => route.didPop(result), observers: [HeroController()], ),