build method
Of course, You're free to override this function if you like
Implementation
@override
Widget build(BuildContext context) => Navigator(
key: navigatorKey,
pages: [
homePage ??= _materialPage(context, '/', home),
// Navigator 2.0 is declarative! Update _pages appropriately.
if (_pages.isNotEmpty) _pages.last,
],
// Navigator 1.0
onPopPage: (route, result) {
//
final pop = route.didPop(result);
if (pop) {
//
_currentConfiguration = _previousRoute();
// Notify Navigator 2.0
notifyListeners();
}
return pop;
},
reportsRouteUpdateToEngine: true,
);