TabShellAppRouterDelegate constructor

TabShellAppRouterDelegate({
  1. required List<TabDefinition> tabs,
  2. required TabController tabController,
  3. double? appBarMaxWidth,
})

Create delegate with navigation controller which contains state of current page.

Implementation

TabShellAppRouterDelegate({
  required this.tabs,
  required this.tabController,
  this.appBarMaxWidth,
  this.logo,
}) {
  _navigatorKey = GlobalKey<NavigatorState>();

  // Listen tab changes to update url with route information parser
  tabController.addListener(() {
    // Notify changes only if current tab index changed
    if (tabController.index != _index) {
      _index = tabController.index;
      notifyListeners();
    }
  });
}