builder property
Used to wrap the the router outlet widget inside another widget.
final myNavigator = NavigationBuilder.create(
routes: {
'/': (_) => HomePage(),
'/Page1': (_) => RouteWidget(
builder: (routeOutlet) {
// If you extract this Scaffold to a Widget class, you do not
// need to use the Builder widget
return Scaffold(
appBar: AppBar(
title: OnReactive( // It reactive to routeData
() => Builder( // Needed only to get a child BuildContext
builder: (context) {
final location = context.routeData.location;
return Text('Routing to: $location');
},
),
),
),
body: routeOutlet,
);
},
routes: {
'/': (_) => Page1(),
'/:id': (data) => Page1(id: data.pathParam['id']),
'/page12': (_) => Page12(),
},
)
},
);
Implementation
final Widget Function(Widget routerOutlet)? builder;