in nav2-usability/scenario_code/lib/nested-routing/nested_routing_beamer.dart [49:93]
Widget build(BuildContext context) {
final beamerState = Beamer.of(context).state;
return Scaffold(
body: Beamer(
key: _innerBeamer,
routerDelegate: BeamerDelegate(
transitionDelegate: NoAnimationTransitionDelegate(),
locationBuilder: SimpleLocationBuilder(
routes: {
'/books/*': (context) => BooksScreen(
appPage: beamerState.uri.pathSegments.contains('all')
? AppPage.allBooks
: AppPage.newBooks,
onTabSelected:
(index) {} // added a listener to TabController: line 118
),
'/settings': (context) => SettingsScreen(),
},
),
),
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: beamerState.uri.path == '/settings' ? 1 : 0,
onTap: (idx) {
if (idx == 0) {
_innerBeamer.currentState?.routerDelegate.beamToNamed('/books/new');
setState(() {});
} else {
_innerBeamer.currentState?.routerDelegate.beamToNamed('/settings');
setState(() {});
}
},
items: [
BottomNavigationBarItem(
label: 'Books',
icon: Icon(Icons.chrome_reader_mode_outlined),
),
BottomNavigationBarItem(
label: 'Settings',
icon: Icon(Icons.settings),
),
],
),
);
}