Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 485 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 485 Bytes

auto_expanding_navigation_rail

An example project of how to add an "auto expanding" navigation rail.

tldr;

Wrap a NavigationRail in a MouseRegion:

MouseRegion(
  onEnter: (_) => setState(() => expanded = true),
  onExit: (_) => setState(() => expanded = false),
  child: NavigationRail(
    destinations: [ ... ],
    selectedIndex: index,
    extended: expanded,
    onDestinationSelected: (i) => setState(() => index = i),
  ),
)