NavigationSidebarController<T> constructor

NavigationSidebarController<T>({
  1. required List<NavSection<T>> sections,
  2. NavNodeId? active,
  3. Set<NavNodeId>? expanded,
  4. bool collapsed = false,
  5. bool drawerOpen = false,
  6. bool autoExpandActive = true,
})

Implementation

NavigationSidebarController({
  required List<NavSection<T>> sections,
  NavNodeId? active,
  Set<NavNodeId>? expanded,
  bool collapsed = false,
  bool drawerOpen = false,
  bool autoExpandActive = true,
})  : _sections = List.unmodifiable(sections),
      _active = active,
      _expanded = {...?expanded},
      _collapsed = collapsed,
      _drawerOpen = drawerOpen,
      _autoExpandActive = autoExpandActive {
  if (_autoExpandActive && active != null) {
    _expanded.addAll(NavOps.ancestorsOf<T>(_sections, active));
  }
}