MenuRouter constructor

MenuRouter({
  1. Key? key,
  2. String? initialRoute,
  3. required BartRouteBuilder routesBuilder,
  4. required GlobalKey<NavigatorState> navigationKey,
  5. required ValueNotifier<int> indexNotifier,
  6. required ValueNotifier<BartMenuRouteType> routingTypeNotifier,
  7. OnRouteChanged? onRouteChanged,
  8. required Widget child,
})

Implementation

MenuRouter({
  super.key,
  String? initialRoute,
  required this.routesBuilder,
  required this.navigationKey,
  required this.indexNotifier,
  required this.routingTypeNotifier,
  this.onRouteChanged,
  required super.child,
}) {
  if (initialRoute != null) {
    final index = _currentIndex(initialRoute);
    indexNotifier.value = index;
  }
}